# 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 CloudError(Model):
"""CloudError.
"""
_attribute_map = {
}
[docs]class OperationDefinition(Model):
"""The definition of a container registry operation.
:param name: Operation name: {provider}/{resource}/{operation}.
:type name: str
:param display: The display information for the container registry
operation.
:type display:
~azure.mgmt.containerregistry.v2017_03_01.models.OperationDisplayDefinition
"""
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'display': {'key': 'display', 'type': 'OperationDisplayDefinition'},
}
def __init__(self, *, name: str=None, display=None, **kwargs) -> None:
super(OperationDefinition, self).__init__(**kwargs)
self.name = name
self.display = display
[docs]class OperationDisplayDefinition(Model):
"""The display information for a container registry operation.
:param provider: The resource provider name: Microsoft.ContainerRegistry.
:type provider: str
:param resource: The resource on which the operation is performed.
:type resource: str
:param operation: The operation that users can perform.
:type operation: str
:param description: The description for the operation.
:type description: str
"""
_attribute_map = {
'provider': {'key': 'provider', 'type': 'str'},
'resource': {'key': 'resource', 'type': 'str'},
'operation': {'key': 'operation', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
}
def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None:
super(OperationDisplayDefinition, self).__init__(**kwargs)
self.provider = provider
self.resource = resource
self.operation = operation
self.description = description
[docs]class RegenerateCredentialParameters(Model):
"""The parameters used to regenerate the login credential.
All required parameters must be populated in order to send to Azure.
:param name: Required. Specifies name of the password which should be
regenerated -- password or password2. Possible values include: 'password',
'password2'
:type name: str or
~azure.mgmt.containerregistry.v2017_03_01.models.PasswordName
"""
_validation = {
'name': {'required': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'PasswordName'},
}
def __init__(self, *, name, **kwargs) -> None:
super(RegenerateCredentialParameters, self).__init__(**kwargs)
self.name = name
[docs]class Resource(Model):
"""An Azure resource.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: The resource ID.
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource.
:vartype type: str
:param location: Required. The location of the resource. This cannot be
changed after the resource is created.
:type location: str
:param tags: The tags of the resource.
:type tags: dict[str, str]
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'location': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
}
def __init__(self, *, location: str, tags=None, **kwargs) -> None:
super(Resource, self).__init__(**kwargs)
self.id = None
self.name = None
self.type = None
self.location = location
self.tags = tags
[docs]class Registry(Resource):
"""An object that represents a container registry.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: The resource ID.
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource.
:vartype type: str
:param location: Required. The location of the resource. This cannot be
changed after the resource is created.
:type location: str
:param tags: The tags of the resource.
:type tags: dict[str, str]
:param sku: Required. The SKU of the container registry.
:type sku: ~azure.mgmt.containerregistry.v2017_03_01.models.Sku
:ivar login_server: The URL that can be used to log into the container
registry.
:vartype login_server: str
:ivar creation_date: The creation date of the container registry in
ISO8601 format.
:vartype creation_date: datetime
:ivar provisioning_state: The provisioning state of the container registry
at the time the operation was called. Possible values include: 'Creating',
'Succeeded'
:vartype provisioning_state: str or
~azure.mgmt.containerregistry.v2017_03_01.models.ProvisioningState
:param admin_user_enabled: The value that indicates whether the admin user
is enabled. Default value: False .
:type admin_user_enabled: bool
:param storage_account: The properties of the storage account for the
container registry.
:type storage_account:
~azure.mgmt.containerregistry.v2017_03_01.models.StorageAccountProperties
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'location': {'required': True},
'sku': {'required': True},
'login_server': {'readonly': True},
'creation_date': {'readonly': True},
'provisioning_state': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'sku': {'key': 'sku', 'type': 'Sku'},
'login_server': {'key': 'properties.loginServer', 'type': 'str'},
'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'},
'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'},
'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountProperties'},
}
def __init__(self, *, location: str, sku, tags=None, admin_user_enabled: bool=False, storage_account=None, **kwargs) -> None:
super(Registry, self).__init__(location=location, tags=tags, **kwargs)
self.sku = sku
self.login_server = None
self.creation_date = None
self.provisioning_state = None
self.admin_user_enabled = admin_user_enabled
self.storage_account = storage_account
[docs]class RegistryCreateParameters(Model):
"""The parameters for creating a container registry.
All required parameters must be populated in order to send to Azure.
:param tags: The tags for the container registry.
:type tags: dict[str, str]
:param location: Required. The location of the container registry. This
cannot be changed after the resource is created.
:type location: str
:param sku: Required. The SKU of the container registry.
:type sku: ~azure.mgmt.containerregistry.v2017_03_01.models.Sku
:param admin_user_enabled: The value that indicates whether the admin user
is enabled. Default value: False .
:type admin_user_enabled: bool
:param storage_account: Required. The parameters of a storage account for
the container registry. If specified, the storage account must be in the
same physical location as the container registry.
:type storage_account:
~azure.mgmt.containerregistry.v2017_03_01.models.StorageAccountParameters
"""
_validation = {
'location': {'required': True},
'sku': {'required': True},
'storage_account': {'required': True},
}
_attribute_map = {
'tags': {'key': 'tags', 'type': '{str}'},
'location': {'key': 'location', 'type': 'str'},
'sku': {'key': 'sku', 'type': 'Sku'},
'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'},
'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountParameters'},
}
def __init__(self, *, location: str, sku, storage_account, tags=None, admin_user_enabled: bool=False, **kwargs) -> None:
super(RegistryCreateParameters, self).__init__(**kwargs)
self.tags = tags
self.location = location
self.sku = sku
self.admin_user_enabled = admin_user_enabled
self.storage_account = storage_account
[docs]class RegistryListCredentialsResult(Model):
"""The response from the ListCredentials operation.
:param username: The username for a container registry.
:type username: str
:param passwords: The list of passwords for a container registry.
:type passwords:
list[~azure.mgmt.containerregistry.v2017_03_01.models.RegistryPassword]
"""
_attribute_map = {
'username': {'key': 'username', 'type': 'str'},
'passwords': {'key': 'passwords', 'type': '[RegistryPassword]'},
}
def __init__(self, *, username: str=None, passwords=None, **kwargs) -> None:
super(RegistryListCredentialsResult, self).__init__(**kwargs)
self.username = username
self.passwords = passwords
[docs]class RegistryNameCheckRequest(Model):
"""A request to check whether a container registry name is available.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the container registry.
:type name: str
:ivar type: Required. The resource type of the container registry. This
field must be set to 'Microsoft.ContainerRegistry/registries'. Default
value: "Microsoft.ContainerRegistry/registries" .
:vartype type: str
"""
_validation = {
'name': {'required': True, 'max_length': 50, 'min_length': 5, 'pattern': r'^[a-zA-Z0-9]*$'},
'type': {'required': True, 'constant': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
}
type = "Microsoft.ContainerRegistry/registries"
def __init__(self, *, name: str, **kwargs) -> None:
super(RegistryNameCheckRequest, self).__init__(**kwargs)
self.name = name
[docs]class RegistryNameStatus(Model):
"""The result of a request to check the availability of a container registry
name.
:param name_available: The value that indicates whether the name is
available.
:type name_available: bool
:param reason: If any, the reason that the name is not available.
:type reason: str
:param message: If any, the error message that provides more detail for
the reason that the name is not available.
:type message: str
"""
_attribute_map = {
'name_available': {'key': 'nameAvailable', 'type': 'bool'},
'reason': {'key': 'reason', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
}
def __init__(self, *, name_available: bool=None, reason: str=None, message: str=None, **kwargs) -> None:
super(RegistryNameStatus, self).__init__(**kwargs)
self.name_available = name_available
self.reason = reason
self.message = message
[docs]class RegistryPassword(Model):
"""The login password for the container registry.
:param name: The password name. Possible values include: 'password',
'password2'
:type name: str or
~azure.mgmt.containerregistry.v2017_03_01.models.PasswordName
:param value: The password value.
:type value: str
"""
_attribute_map = {
'name': {'key': 'name', 'type': 'PasswordName'},
'value': {'key': 'value', 'type': 'str'},
}
def __init__(self, *, name=None, value: str=None, **kwargs) -> None:
super(RegistryPassword, self).__init__(**kwargs)
self.name = name
self.value = value
[docs]class RegistryUpdateParameters(Model):
"""The parameters for updating a container registry.
:param tags: The tags for the container registry.
:type tags: dict[str, str]
:param admin_user_enabled: The value that indicates whether the admin user
is enabled.
:type admin_user_enabled: bool
:param storage_account: The parameters of a storage account for the
container registry. If specified, the storage account must be in the same
physical location as the container registry.
:type storage_account:
~azure.mgmt.containerregistry.v2017_03_01.models.StorageAccountParameters
"""
_attribute_map = {
'tags': {'key': 'tags', 'type': '{str}'},
'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'},
'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountParameters'},
}
def __init__(self, *, tags=None, admin_user_enabled: bool=None, storage_account=None, **kwargs) -> None:
super(RegistryUpdateParameters, self).__init__(**kwargs)
self.tags = tags
self.admin_user_enabled = admin_user_enabled
self.storage_account = storage_account
[docs]class Sku(Model):
"""The SKU of a container registry.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:param name: Required. The SKU name of the container registry. Required
for registry creation. Allowed value: Basic.
:type name: str
:ivar tier: The SKU tier based on the SKU name. Possible values include:
'Basic'
:vartype tier: str or
~azure.mgmt.containerregistry.v2017_03_01.models.SkuTier
"""
_validation = {
'name': {'required': True},
'tier': {'readonly': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'tier': {'key': 'tier', 'type': 'str'},
}
def __init__(self, *, name: str, **kwargs) -> None:
super(Sku, self).__init__(**kwargs)
self.name = name
self.tier = None
[docs]class StorageAccountParameters(Model):
"""The parameters of a storage account for a container registry.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the storage account.
:type name: str
:param access_key: Required. The access key to the storage account.
:type access_key: str
"""
_validation = {
'name': {'required': True},
'access_key': {'required': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'access_key': {'key': 'accessKey', 'type': 'str'},
}
def __init__(self, *, name: str, access_key: str, **kwargs) -> None:
super(StorageAccountParameters, self).__init__(**kwargs)
self.name = name
self.access_key = access_key
[docs]class StorageAccountProperties(Model):
"""The properties of a storage account for a container registry.
:param name: The name of the storage account.
:type name: str
"""
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
}
def __init__(self, *, name: str=None, **kwargs) -> None:
super(StorageAccountProperties, self).__init__(**kwargs)
self.name = name