Skip to content

Commit

Permalink
[AutoPR containerregistry/resource-manager] [ACR] Add empty resource …
Browse files Browse the repository at this point in the history
…group name validation, minor cleanup (#3832)

* Generated from 404ce04b1a1c4cac92a67328f319a021f320935a

Add empty resource group name validation, minor cleanup

* Generated from 9f8eefc2216772a9f2713725aec5ba1b92c26104

Add network rule set properties, empty resource group validation

* Generated from 4acb1b6d259fdd431a87a4d4f3ce25458432078c

Fix network rule set default value

* Generated from 43b818a4578f6fa9b0237aad66b14d896ff6a614

Fix resource group name

* Generated from 3e12549e66336e4ca6fa81b49aaf9ed7d2797cce

Add network rule set properties, empty resource group validation

* Generated from dd007e2442dd2126ce789aaad017872ea4adaa1e

Add a missing comma
  • Loading branch information
AutorestCI authored Nov 30, 2018
1 parent ade0c7d commit a044064
Show file tree
Hide file tree
Showing 44 changed files with 664 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def get(
url = self.get.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1),
'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$')
}
url = self._client.format_url(url, **path_format_arguments)
Expand Down Expand Up @@ -176,7 +176,7 @@ def _create_initial(
url = self.create.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1),
'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$')
}
url = self._client.format_url(url, **path_format_arguments)
Expand Down Expand Up @@ -294,7 +294,7 @@ def delete(
url = self.delete.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1),
'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$')
}
url = self._client.format_url(url, **path_format_arguments)
Expand Down Expand Up @@ -353,7 +353,7 @@ def update(
url = self.update.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1),
'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$')
}
url = self._client.format_url(url, **path_format_arguments)
Expand Down Expand Up @@ -421,7 +421,7 @@ def internal_paging(next_link=None, raw=False):
url = self.list_by_resource_group.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str')
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1)
}
url = self._client.format_url(url, **path_format_arguments)

Expand Down Expand Up @@ -554,7 +554,7 @@ def list_credentials(
url = self.list_credentials.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1),
'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$')
}
url = self._client.format_url(url, **path_format_arguments)
Expand Down Expand Up @@ -627,7 +627,7 @@ def regenerate_credential(
url = self.regenerate_credential.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1),
'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$')
}
url = self._client.format_url(url, **path_format_arguments)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
from .sku_py3 import Sku
from .status_py3 import Status
from .storage_account_properties_py3 import StorageAccountProperties
from .virtual_network_rule_py3 import VirtualNetworkRule
from .network_rule_set_py3 import NetworkRuleSet
from .registry_py3 import Registry
from .registry_update_parameters_py3 import RegistryUpdateParameters
from .registry_password_py3 import RegistryPassword
Expand Down Expand Up @@ -61,6 +63,8 @@
from .sku import Sku
from .status import Status
from .storage_account_properties import StorageAccountProperties
from .virtual_network_rule import VirtualNetworkRule
from .network_rule_set import NetworkRuleSet
from .registry import Registry
from .registry_update_parameters import RegistryUpdateParameters
from .registry_password import RegistryPassword
Expand Down Expand Up @@ -97,6 +101,7 @@
SkuName,
SkuTier,
ProvisioningState,
DefaultAction,
PasswordName,
RegistryUsageUnit,
PolicyStatus,
Expand All @@ -118,6 +123,8 @@
'Sku',
'Status',
'StorageAccountProperties',
'VirtualNetworkRule',
'NetworkRuleSet',
'Registry',
'RegistryUpdateParameters',
'RegistryPassword',
Expand Down Expand Up @@ -153,6 +160,7 @@
'SkuName',
'SkuTier',
'ProvisioningState',
'DefaultAction',
'PasswordName',
'RegistryUsageUnit',
'PolicyStatus',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ class ProvisioningState(str, Enum):
canceled = "Canceled"


class DefaultAction(str, Enum):

allow = "Allow"
deny = "Deny"


class PasswordName(str, Enum):

password = "password"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class NetworkRuleSet(Model):
"""The network rule set for a container registry.
All required parameters must be populated in order to send to Azure.
:param default_action: Required. The default action of allow or deny when
no other rules match. Possible values include: 'Allow', 'Deny'. Default
value: "Allow" .
:type default_action: str or
~azure.mgmt.containerregistry.v2017_10_01.models.DefaultAction
:param virtual_network_rules: The virtual network rules.
:type virtual_network_rules:
list[~azure.mgmt.containerregistry.v2017_10_01.models.VirtualNetworkRule]
"""

_validation = {
'default_action': {'required': True},
}

_attribute_map = {
'default_action': {'key': 'defaultAction', 'type': 'str'},
'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'},
}

def __init__(self, **kwargs):
super(NetworkRuleSet, self).__init__(**kwargs)
self.default_action = kwargs.get('default_action', "Allow")
self.virtual_network_rules = kwargs.get('virtual_network_rules', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class NetworkRuleSet(Model):
"""The network rule set for a container registry.
All required parameters must be populated in order to send to Azure.
:param default_action: Required. The default action of allow or deny when
no other rules match. Possible values include: 'Allow', 'Deny'. Default
value: "Allow" .
:type default_action: str or
~azure.mgmt.containerregistry.v2017_10_01.models.DefaultAction
:param virtual_network_rules: The virtual network rules.
:type virtual_network_rules:
list[~azure.mgmt.containerregistry.v2017_10_01.models.VirtualNetworkRule]
"""

_validation = {
'default_action': {'required': True},
}

_attribute_map = {
'default_action': {'key': 'defaultAction', 'type': 'str'},
'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'},
}

def __init__(self, *, default_action="Allow", virtual_network_rules=None, **kwargs) -> None:
super(NetworkRuleSet, self).__init__(**kwargs)
self.default_action = default_action
self.virtual_network_rules = virtual_network_rules
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ class Registry(Resource):
container registry. Only applicable to Classic SKU.
:type storage_account:
~azure.mgmt.containerregistry.v2017_10_01.models.StorageAccountProperties
:param network_rule_set: The network rule set for a container registry.
:type network_rule_set:
~azure.mgmt.containerregistry.v2017_10_01.models.NetworkRuleSet
"""

_validation = {
Expand Down Expand Up @@ -81,6 +84,7 @@ class Registry(Resource):
'status': {'key': 'properties.status', 'type': 'Status'},
'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'},
'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountProperties'},
'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'},
}

def __init__(self, **kwargs):
Expand All @@ -92,3 +96,4 @@ def __init__(self, **kwargs):
self.status = None
self.admin_user_enabled = kwargs.get('admin_user_enabled', False)
self.storage_account = kwargs.get('storage_account', None)
self.network_rule_set = kwargs.get('network_rule_set', None)
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ class Registry(Resource):
container registry. Only applicable to Classic SKU.
:type storage_account:
~azure.mgmt.containerregistry.v2017_10_01.models.StorageAccountProperties
:param network_rule_set: The network rule set for a container registry.
:type network_rule_set:
~azure.mgmt.containerregistry.v2017_10_01.models.NetworkRuleSet
"""

_validation = {
Expand Down Expand Up @@ -81,9 +84,10 @@ class Registry(Resource):
'status': {'key': 'properties.status', 'type': 'Status'},
'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'},
'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountProperties'},
'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'},
}

def __init__(self, *, location: str, sku, tags=None, admin_user_enabled: bool=False, storage_account=None, **kwargs) -> None:
def __init__(self, *, location: str, sku, tags=None, admin_user_enabled: bool=False, storage_account=None, network_rule_set=None, **kwargs) -> None:
super(Registry, self).__init__(location=location, tags=tags, **kwargs)
self.sku = sku
self.login_server = None
Expand All @@ -92,3 +96,4 @@ def __init__(self, *, location: str, sku, tags=None, admin_user_enabled: bool=Fa
self.status = None
self.admin_user_enabled = admin_user_enabled
self.storage_account = storage_account
self.network_rule_set = network_rule_set
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ class RegistryUpdateParameters(Model):
registry.
:type storage_account:
~azure.mgmt.containerregistry.v2017_10_01.models.StorageAccountProperties
:param network_rule_set: The network rule set for a container registry.
:type network_rule_set:
~azure.mgmt.containerregistry.v2017_10_01.models.NetworkRuleSet
"""

_attribute_map = {
'tags': {'key': 'tags', 'type': '{str}'},
'sku': {'key': 'sku', 'type': 'Sku'},
'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'},
'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountProperties'},
'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'},
}

def __init__(self, **kwargs):
Expand All @@ -43,3 +47,4 @@ def __init__(self, **kwargs):
self.sku = kwargs.get('sku', None)
self.admin_user_enabled = kwargs.get('admin_user_enabled', None)
self.storage_account = kwargs.get('storage_account', None)
self.network_rule_set = kwargs.get('network_rule_set', None)
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,23 @@ class RegistryUpdateParameters(Model):
registry.
:type storage_account:
~azure.mgmt.containerregistry.v2017_10_01.models.StorageAccountProperties
:param network_rule_set: The network rule set for a container registry.
:type network_rule_set:
~azure.mgmt.containerregistry.v2017_10_01.models.NetworkRuleSet
"""

_attribute_map = {
'tags': {'key': 'tags', 'type': '{str}'},
'sku': {'key': 'sku', 'type': 'Sku'},
'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'},
'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountProperties'},
'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'},
}

def __init__(self, *, tags=None, sku=None, admin_user_enabled: bool=None, storage_account=None, **kwargs) -> None:
def __init__(self, *, tags=None, sku=None, admin_user_enabled: bool=None, storage_account=None, network_rule_set=None, **kwargs) -> None:
super(RegistryUpdateParameters, self).__init__(**kwargs)
self.tags = tags
self.sku = sku
self.admin_user_enabled = admin_user_enabled
self.storage_account = storage_account
self.network_rule_set = network_rule_set
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class VirtualNetworkRule(Model):
"""The virtual network rule for a container registry.
All required parameters must be populated in order to send to Azure.
:param id: Required. Resource ID of a subnet, for example:
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}.
:type id: str
"""

_validation = {
'id': {'required': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
}

def __init__(self, **kwargs):
super(VirtualNetworkRule, self).__init__(**kwargs)
self.id = kwargs.get('id', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class VirtualNetworkRule(Model):
"""The virtual network rule for a container registry.
All required parameters must be populated in order to send to Azure.
:param id: Required. Resource ID of a subnet, for example:
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}.
:type id: str
"""

_validation = {
'id': {'required': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
}

def __init__(self, *, id: str, **kwargs) -> None:
super(VirtualNetworkRule, self).__init__(**kwargs)
self.id = id
Loading

0 comments on commit a044064

Please sign in to comment.