diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_container_registry_management_client.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_container_registry_management_client.py index b74b097eb912..550d84bfb6c9 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_container_registry_management_client.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_container_registry_management_client.py @@ -114,6 +114,22 @@ def models(cls, api_version=DEFAULT_API_VERSION): return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) + @property + def agent_pools(self): + """Instance depends on the API version: + + * 2019-06-01-preview: :class:`AgentPoolsOperations` + * 2019-12-01-preview: :class:`AgentPoolsOperations` + """ + api_version = self._get_api_version('agent_pools') + if api_version == '2019-06-01-preview': + from .v2019_06_01_preview.operations import AgentPoolsOperations as OperationClass + elif api_version == '2019-12-01-preview': + from .v2019_12_01_preview.operations import AgentPoolsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def build_steps(self): """Instance depends on the API version: diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/_container_registry_management_client.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/_container_registry_management_client.py index 83f4fb5b4cc1..e87b7289880a 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/_container_registry_management_client.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/_container_registry_management_client.py @@ -17,6 +17,7 @@ from .operations import Operations from .operations import ReplicationsOperations from .operations import WebhooksOperations +from .operations import AgentPoolsOperations from .operations import RunsOperations from .operations import TaskRunsOperations from .operations import TasksOperations @@ -39,6 +40,8 @@ class ContainerRegistryManagementClient(SDKClient): :vartype replications: azure.mgmt.containerregistry.v2019_06_01_preview.operations.ReplicationsOperations :ivar webhooks: Webhooks operations :vartype webhooks: azure.mgmt.containerregistry.v2019_06_01_preview.operations.WebhooksOperations + :ivar agent_pools: AgentPools operations + :vartype agent_pools: azure.mgmt.containerregistry.v2019_06_01_preview.operations.AgentPoolsOperations :ivar runs: Runs operations :vartype runs: azure.mgmt.containerregistry.v2019_06_01_preview.operations.RunsOperations :ivar task_runs: TaskRuns operations @@ -76,6 +79,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.webhooks = WebhooksOperations( self._client, self.config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations( + self._client, self.config, self._serialize, self._deserialize) self.runs = RunsOperations( self._client, self.config, self._serialize, self._deserialize) self.task_runs = TaskRunsOperations( diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/__init__.py index 057f2076e513..9cd6d5e6ec38 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/__init__.py @@ -12,6 +12,9 @@ try: from ._models_py3 import ActiveDirectoryObject from ._models_py3 import Actor + from ._models_py3 import AgentPool + from ._models_py3 import AgentPoolQueueStatus + from ._models_py3 import AgentPoolUpdateParameters from ._models_py3 import AgentProperties from ._models_py3 import Argument from ._models_py3 import AuthInfo @@ -119,6 +122,9 @@ except (SyntaxError, ImportError): from ._models import ActiveDirectoryObject from ._models import Actor + from ._models import AgentPool + from ._models import AgentPoolQueueStatus + from ._models import AgentPoolUpdateParameters from ._models import AgentProperties from ._models import Argument from ._models import AuthInfo @@ -223,6 +229,7 @@ from ._models import Webhook from ._models import WebhookCreateParameters from ._models import WebhookUpdateParameters +from ._paged_models import AgentPoolPaged from ._paged_models import EventPaged from ._paged_models import OperationDefinitionPaged from ._paged_models import RegistryPaged @@ -246,9 +253,9 @@ RegistryUsageUnit, WebhookStatus, WebhookAction, + OS, RunStatus, RunType, - OS, Architecture, Variant, ResourceIdentityType, @@ -270,6 +277,9 @@ __all__ = [ 'ActiveDirectoryObject', 'Actor', + 'AgentPool', + 'AgentPoolQueueStatus', + 'AgentPoolUpdateParameters', 'AgentProperties', 'Argument', 'AuthInfo', @@ -379,6 +389,7 @@ 'ReplicationPaged', 'WebhookPaged', 'EventPaged', + 'AgentPoolPaged', 'RunPaged', 'TaskRunPaged', 'TaskPaged', @@ -396,9 +407,9 @@ 'RegistryUsageUnit', 'WebhookStatus', 'WebhookAction', + 'OS', 'RunStatus', 'RunType', - 'OS', 'Architecture', 'Variant', 'ResourceIdentityType', diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_container_registry_management_client_enums.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_container_registry_management_client_enums.py index 4c2a8c859503..63e6bb6d8314 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_container_registry_management_client_enums.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_container_registry_management_client_enums.py @@ -93,6 +93,12 @@ class WebhookAction(str, Enum): chart_delete = "chart_delete" +class OS(str, Enum): + + windows = "Windows" + linux = "Linux" + + class RunStatus(str, Enum): queued = "Queued" @@ -113,12 +119,6 @@ class RunType(str, Enum): auto_run = "AutoRun" -class OS(str, Enum): - - windows = "Windows" - linux = "Linux" - - class Architecture(str, Enum): amd64 = "amd64" diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_models.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_models.py index 06449a7a1acb..314321af4eb3 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_models.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_models.py @@ -56,6 +56,155 @@ def __init__(self, **kwargs): self.name = kwargs.get('name', None) +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, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class AgentPool(Resource): + """The agentpool that has the ARM resource and properties. + The agentpool will have all information to create an agent pool. + + 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 count: The count of agent machine + :type count: int + :param tier: The Tier of agent machine + :type tier: str + :param os: The OS of agent machine. Possible values include: 'Windows', + 'Linux' + :type os: str or + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.OS + :param virtual_network_subnet_resource_id: The Virtual Network Subnet + Resource Id of the agent machine + :type virtual_network_subnet_resource_id: str + :ivar provisioning_state: The provisioning state of this agent pool. + Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + 'count': {'key': 'properties.count', 'type': 'int'}, + 'tier': {'key': 'properties.tier', 'type': 'str'}, + 'os': {'key': 'properties.os', 'type': 'str'}, + 'virtual_network_subnet_resource_id': {'key': 'properties.virtualNetworkSubnetResourceId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AgentPool, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.tier = kwargs.get('tier', None) + self.os = kwargs.get('os', None) + self.virtual_network_subnet_resource_id = kwargs.get('virtual_network_subnet_resource_id', None) + self.provisioning_state = None + + +class AgentPoolQueueStatus(Model): + """The QueueStatus of Agent Pool. + + :param count: The number of pending runs in the queue + :type count: int + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(AgentPoolQueueStatus, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + + +class AgentPoolUpdateParameters(Model): + """The parameters for updating an agent pool. + + :param count: The count of agent machine + :type count: int + :param tags: The ARM resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'count': {'key': 'properties.count', 'type': 'int'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(AgentPoolUpdateParameters, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.tags = kwargs.get('tags', None) + + class AgentProperties(Model): """The properties that determine the run agent configuration. @@ -420,6 +569,8 @@ class RunRequest(Model): :param is_archive_enabled: The value that indicates whether archiving is enabled for the run or not. Default value: False . :type is_archive_enabled: bool + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param type: Required. Constant filled by server. :type type: str """ @@ -430,6 +581,7 @@ class RunRequest(Model): _attribute_map = { 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, } @@ -440,6 +592,7 @@ class RunRequest(Model): def __init__(self, **kwargs): super(RunRequest, self).__init__(**kwargs) self.is_archive_enabled = kwargs.get('is_archive_enabled', False) + self.agent_pool_name = kwargs.get('agent_pool_name', None) self.type = None @@ -451,6 +604,8 @@ class DockerBuildRequest(RunRequest): :param is_archive_enabled: The value that indicates whether archiving is enabled for the run or not. Default value: False . :type is_archive_enabled: bool + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param type: Required. Constant filled by server. :type type: str :param image_names: The fully qualified image names including the @@ -500,6 +655,7 @@ class DockerBuildRequest(RunRequest): _attribute_map = { 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'image_names': {'key': 'imageNames', 'type': '[str]'}, 'is_push_enabled': {'key': 'isPushEnabled', 'type': 'bool'}, @@ -755,6 +911,8 @@ class EncodedTaskRunRequest(RunRequest): :param is_archive_enabled: The value that indicates whether archiving is enabled for the run or not. Default value: False . :type is_archive_enabled: bool + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param type: Required. Constant filled by server. :type type: str :param encoded_task_content: Required. Base64 encoded value of the @@ -796,6 +954,7 @@ class EncodedTaskRunRequest(RunRequest): _attribute_map = { 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, @@ -1139,6 +1298,8 @@ class FileTaskRunRequest(RunRequest): :param is_archive_enabled: The value that indicates whether archiving is enabled for the run or not. Default value: False . :type is_archive_enabled: bool + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param type: Required. Constant filled by server. :type type: str :param task_file_path: Required. The template/definition file path @@ -1180,6 +1341,7 @@ class FileTaskRunRequest(RunRequest): _attribute_map = { 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, @@ -1946,51 +2108,6 @@ def __init__(self, **kwargs): self.name = kwargs.get('name', None) -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, **kwargs): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - - class Registry(Resource): """An object that represents a container registry. @@ -2435,6 +2552,8 @@ class Run(ProxyResource): 'QuickRun', 'AutoBuild', 'AutoRun' :type run_type: str or ~azure.mgmt.containerregistry.v2019_06_01_preview.models.RunType + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param create_time: The time the run was scheduled. :type create_time: datetime :param start_time: The time the run started. @@ -2500,6 +2619,7 @@ class Run(ProxyResource): 'status': {'key': 'properties.status', 'type': 'str'}, 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, 'run_type': {'key': 'properties.runType', 'type': 'str'}, + 'agent_pool_name': {'key': 'properties.agentPoolName', 'type': 'str'}, 'create_time': {'key': 'properties.createTime', 'type': 'iso-8601'}, 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, 'finish_time': {'key': 'properties.finishTime', 'type': 'iso-8601'}, @@ -2524,6 +2644,7 @@ def __init__(self, **kwargs): self.status = kwargs.get('status', None) self.last_updated_time = kwargs.get('last_updated_time', None) self.run_type = kwargs.get('run_type', None) + self.agent_pool_name = kwargs.get('agent_pool_name', None) self.create_time = kwargs.get('create_time', None) self.start_time = kwargs.get('start_time', None) self.finish_time = kwargs.get('finish_time', None) @@ -2569,6 +2690,9 @@ class RunFilter(Model): :type is_archive_enabled: bool :param task_name: The name of the task that the run corresponds to. :type task_name: str + :param agent_pool_name: The name of the agent pool that the run + corresponds to. + :type agent_pool_name: str """ _attribute_map = { @@ -2580,6 +2704,7 @@ class RunFilter(Model): 'output_image_manifests': {'key': 'outputImageManifests', 'type': 'str'}, 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, 'task_name': {'key': 'taskName', 'type': 'str'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, } def __init__(self, **kwargs): @@ -2592,6 +2717,7 @@ def __init__(self, **kwargs): self.output_image_manifests = kwargs.get('output_image_manifests', None) self.is_archive_enabled = kwargs.get('is_archive_enabled', None) self.task_name = kwargs.get('task_name', None) + self.agent_pool_name = kwargs.get('agent_pool_name', None) class RunGetLogResult(Model): @@ -3217,6 +3343,8 @@ class Task(Resource): :param agent_configuration: The machine configuration of the run agent. :type agent_configuration: ~azure.mgmt.containerregistry.v2019_06_01_preview.models.AgentProperties + :param agent_pool_name: The dedicated agent pool for the task. + :type agent_pool_name: str :param timeout: Run timeout in seconds. Default value: 3600 . :type timeout: int :param step: Required. The properties of a task step. @@ -3255,6 +3383,7 @@ class Task(Resource): 'status': {'key': 'properties.status', 'type': 'str'}, 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'agent_pool_name': {'key': 'properties.agentPoolName', 'type': 'str'}, 'timeout': {'key': 'properties.timeout', 'type': 'int'}, 'step': {'key': 'properties.step', 'type': 'TaskStepProperties'}, 'trigger': {'key': 'properties.trigger', 'type': 'TriggerProperties'}, @@ -3269,6 +3398,7 @@ def __init__(self, **kwargs): self.status = kwargs.get('status', None) self.platform = kwargs.get('platform', None) self.agent_configuration = kwargs.get('agent_configuration', None) + self.agent_pool_name = kwargs.get('agent_pool_name', None) self.timeout = kwargs.get('timeout', 3600) self.step = kwargs.get('step', None) self.trigger = kwargs.get('trigger', None) @@ -3353,6 +3483,8 @@ class TaskRunRequest(RunRequest): :param is_archive_enabled: The value that indicates whether archiving is enabled for the run or not. Default value: False . :type is_archive_enabled: bool + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param type: Required. Constant filled by server. :type type: str :param task_id: Required. The resource ID of task against which run has to @@ -3371,6 +3503,7 @@ class TaskRunRequest(RunRequest): _attribute_map = { 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'task_id': {'key': 'taskId', 'type': 'str'}, 'override_task_step_properties': {'key': 'overrideTaskStepProperties', 'type': 'OverrideTaskStepProperties'}, @@ -3431,6 +3564,8 @@ class TaskUpdateParameters(Model): :param agent_configuration: The machine configuration of the run agent. :type agent_configuration: ~azure.mgmt.containerregistry.v2019_06_01_preview.models.AgentProperties + :param agent_pool_name: The dedicated agent pool for the task. + :type agent_pool_name: str :param timeout: Run timeout in seconds. :type timeout: int :param step: The properties for updating a task step. @@ -3452,6 +3587,7 @@ class TaskUpdateParameters(Model): 'status': {'key': 'properties.status', 'type': 'str'}, 'platform': {'key': 'properties.platform', 'type': 'PlatformUpdateParameters'}, 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'agent_pool_name': {'key': 'properties.agentPoolName', 'type': 'str'}, 'timeout': {'key': 'properties.timeout', 'type': 'int'}, 'step': {'key': 'properties.step', 'type': 'TaskStepUpdateParameters'}, 'trigger': {'key': 'properties.trigger', 'type': 'TriggerUpdateParameters'}, @@ -3465,6 +3601,7 @@ def __init__(self, **kwargs): self.status = kwargs.get('status', None) self.platform = kwargs.get('platform', None) self.agent_configuration = kwargs.get('agent_configuration', None) + self.agent_pool_name = kwargs.get('agent_pool_name', None) self.timeout = kwargs.get('timeout', None) self.step = kwargs.get('step', None) self.trigger = kwargs.get('trigger', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_models_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_models_py3.py index 260f2a3bd805..db49ad0e8972 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_models_py3.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_models_py3.py @@ -56,6 +56,155 @@ def __init__(self, *, name: str=None, **kwargs) -> None: self.name = name +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 + + +class AgentPool(Resource): + """The agentpool that has the ARM resource and properties. + The agentpool will have all information to create an agent pool. + + 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 count: The count of agent machine + :type count: int + :param tier: The Tier of agent machine + :type tier: str + :param os: The OS of agent machine. Possible values include: 'Windows', + 'Linux' + :type os: str or + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.OS + :param virtual_network_subnet_resource_id: The Virtual Network Subnet + Resource Id of the agent machine + :type virtual_network_subnet_resource_id: str + :ivar provisioning_state: The provisioning state of this agent pool. + Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + 'count': {'key': 'properties.count', 'type': 'int'}, + 'tier': {'key': 'properties.tier', 'type': 'str'}, + 'os': {'key': 'properties.os', 'type': 'str'}, + 'virtual_network_subnet_resource_id': {'key': 'properties.virtualNetworkSubnetResourceId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, count: int=None, tier: str=None, os=None, virtual_network_subnet_resource_id: str=None, **kwargs) -> None: + super(AgentPool, self).__init__(location=location, tags=tags, **kwargs) + self.count = count + self.tier = tier + self.os = os + self.virtual_network_subnet_resource_id = virtual_network_subnet_resource_id + self.provisioning_state = None + + +class AgentPoolQueueStatus(Model): + """The QueueStatus of Agent Pool. + + :param count: The number of pending runs in the queue + :type count: int + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__(self, *, count: int=None, **kwargs) -> None: + super(AgentPoolQueueStatus, self).__init__(**kwargs) + self.count = count + + +class AgentPoolUpdateParameters(Model): + """The parameters for updating an agent pool. + + :param count: The count of agent machine + :type count: int + :param tags: The ARM resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'count': {'key': 'properties.count', 'type': 'int'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, count: int=None, tags=None, **kwargs) -> None: + super(AgentPoolUpdateParameters, self).__init__(**kwargs) + self.count = count + self.tags = tags + + class AgentProperties(Model): """The properties that determine the run agent configuration. @@ -420,6 +569,8 @@ class RunRequest(Model): :param is_archive_enabled: The value that indicates whether archiving is enabled for the run or not. Default value: False . :type is_archive_enabled: bool + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param type: Required. Constant filled by server. :type type: str """ @@ -430,6 +581,7 @@ class RunRequest(Model): _attribute_map = { 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, } @@ -437,9 +589,10 @@ class RunRequest(Model): 'type': {'DockerBuildRequest': 'DockerBuildRequest', 'FileTaskRunRequest': 'FileTaskRunRequest', 'TaskRunRequest': 'TaskRunRequest', 'EncodedTaskRunRequest': 'EncodedTaskRunRequest'} } - def __init__(self, *, is_archive_enabled: bool=False, **kwargs) -> None: + def __init__(self, *, is_archive_enabled: bool=False, agent_pool_name: str=None, **kwargs) -> None: super(RunRequest, self).__init__(**kwargs) self.is_archive_enabled = is_archive_enabled + self.agent_pool_name = agent_pool_name self.type = None @@ -451,6 +604,8 @@ class DockerBuildRequest(RunRequest): :param is_archive_enabled: The value that indicates whether archiving is enabled for the run or not. Default value: False . :type is_archive_enabled: bool + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param type: Required. Constant filled by server. :type type: str :param image_names: The fully qualified image names including the @@ -500,6 +655,7 @@ class DockerBuildRequest(RunRequest): _attribute_map = { 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'image_names': {'key': 'imageNames', 'type': '[str]'}, 'is_push_enabled': {'key': 'isPushEnabled', 'type': 'bool'}, @@ -514,8 +670,8 @@ class DockerBuildRequest(RunRequest): 'credentials': {'key': 'credentials', 'type': 'Credentials'}, } - def __init__(self, *, docker_file_path: str, platform, is_archive_enabled: bool=False, image_names=None, is_push_enabled: bool=True, no_cache: bool=False, target: str=None, arguments=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: - super(DockerBuildRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) + def __init__(self, *, docker_file_path: str, platform, is_archive_enabled: bool=False, agent_pool_name: str=None, image_names=None, is_push_enabled: bool=True, no_cache: bool=False, target: str=None, arguments=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: + super(DockerBuildRequest, self).__init__(is_archive_enabled=is_archive_enabled, agent_pool_name=agent_pool_name, **kwargs) self.image_names = image_names self.is_push_enabled = is_push_enabled self.no_cache = no_cache @@ -755,6 +911,8 @@ class EncodedTaskRunRequest(RunRequest): :param is_archive_enabled: The value that indicates whether archiving is enabled for the run or not. Default value: False . :type is_archive_enabled: bool + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param type: Required. Constant filled by server. :type type: str :param encoded_task_content: Required. Base64 encoded value of the @@ -796,6 +954,7 @@ class EncodedTaskRunRequest(RunRequest): _attribute_map = { 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, @@ -807,8 +966,8 @@ class EncodedTaskRunRequest(RunRequest): 'credentials': {'key': 'credentials', 'type': 'Credentials'}, } - def __init__(self, *, encoded_task_content: str, platform, is_archive_enabled: bool=False, encoded_values_content: str=None, values=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: - super(EncodedTaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) + def __init__(self, *, encoded_task_content: str, platform, is_archive_enabled: bool=False, agent_pool_name: str=None, encoded_values_content: str=None, values=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: + super(EncodedTaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, agent_pool_name=agent_pool_name, **kwargs) self.encoded_task_content = encoded_task_content self.encoded_values_content = encoded_values_content self.values = values @@ -1139,6 +1298,8 @@ class FileTaskRunRequest(RunRequest): :param is_archive_enabled: The value that indicates whether archiving is enabled for the run or not. Default value: False . :type is_archive_enabled: bool + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param type: Required. Constant filled by server. :type type: str :param task_file_path: Required. The template/definition file path @@ -1180,6 +1341,7 @@ class FileTaskRunRequest(RunRequest): _attribute_map = { 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, @@ -1191,8 +1353,8 @@ class FileTaskRunRequest(RunRequest): 'credentials': {'key': 'credentials', 'type': 'Credentials'}, } - def __init__(self, *, task_file_path: str, platform, is_archive_enabled: bool=False, values_file_path: str=None, values=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: - super(FileTaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) + def __init__(self, *, task_file_path: str, platform, is_archive_enabled: bool=False, agent_pool_name: str=None, values_file_path: str=None, values=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: + super(FileTaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, agent_pool_name=agent_pool_name, **kwargs) self.task_file_path = task_file_path self.values_file_path = values_file_path self.values = values @@ -1946,51 +2108,6 @@ def __init__(self, *, name, **kwargs) -> None: self.name = name -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 - - class Registry(Resource): """An object that represents a container registry. @@ -2435,6 +2552,8 @@ class Run(ProxyResource): 'QuickRun', 'AutoBuild', 'AutoRun' :type run_type: str or ~azure.mgmt.containerregistry.v2019_06_01_preview.models.RunType + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param create_time: The time the run was scheduled. :type create_time: datetime :param start_time: The time the run started. @@ -2500,6 +2619,7 @@ class Run(ProxyResource): 'status': {'key': 'properties.status', 'type': 'str'}, 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, 'run_type': {'key': 'properties.runType', 'type': 'str'}, + 'agent_pool_name': {'key': 'properties.agentPoolName', 'type': 'str'}, 'create_time': {'key': 'properties.createTime', 'type': 'iso-8601'}, 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, 'finish_time': {'key': 'properties.finishTime', 'type': 'iso-8601'}, @@ -2518,12 +2638,13 @@ class Run(ProxyResource): 'is_archive_enabled': {'key': 'properties.isArchiveEnabled', 'type': 'bool'}, } - def __init__(self, *, run_id: str=None, status=None, last_updated_time=None, run_type=None, create_time=None, start_time=None, finish_time=None, output_images=None, task: str=None, image_update_trigger=None, source_trigger=None, timer_trigger=None, platform=None, agent_configuration=None, source_registry_auth: str=None, custom_registries=None, update_trigger_token: str=None, provisioning_state=None, is_archive_enabled: bool=False, **kwargs) -> None: + def __init__(self, *, run_id: str=None, status=None, last_updated_time=None, run_type=None, agent_pool_name: str=None, create_time=None, start_time=None, finish_time=None, output_images=None, task: str=None, image_update_trigger=None, source_trigger=None, timer_trigger=None, platform=None, agent_configuration=None, source_registry_auth: str=None, custom_registries=None, update_trigger_token: str=None, provisioning_state=None, is_archive_enabled: bool=False, **kwargs) -> None: super(Run, self).__init__(**kwargs) self.run_id = run_id self.status = status self.last_updated_time = last_updated_time self.run_type = run_type + self.agent_pool_name = agent_pool_name self.create_time = create_time self.start_time = start_time self.finish_time = finish_time @@ -2569,6 +2690,9 @@ class RunFilter(Model): :type is_archive_enabled: bool :param task_name: The name of the task that the run corresponds to. :type task_name: str + :param agent_pool_name: The name of the agent pool that the run + corresponds to. + :type agent_pool_name: str """ _attribute_map = { @@ -2580,9 +2704,10 @@ class RunFilter(Model): 'output_image_manifests': {'key': 'outputImageManifests', 'type': 'str'}, 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, 'task_name': {'key': 'taskName', 'type': 'str'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, } - def __init__(self, *, run_id: str=None, run_type=None, status=None, create_time=None, finish_time=None, output_image_manifests: str=None, is_archive_enabled: bool=None, task_name: str=None, **kwargs) -> None: + def __init__(self, *, run_id: str=None, run_type=None, status=None, create_time=None, finish_time=None, output_image_manifests: str=None, is_archive_enabled: bool=None, task_name: str=None, agent_pool_name: str=None, **kwargs) -> None: super(RunFilter, self).__init__(**kwargs) self.run_id = run_id self.run_type = run_type @@ -2592,6 +2717,7 @@ def __init__(self, *, run_id: str=None, run_type=None, status=None, create_time= self.output_image_manifests = output_image_manifests self.is_archive_enabled = is_archive_enabled self.task_name = task_name + self.agent_pool_name = agent_pool_name class RunGetLogResult(Model): @@ -3217,6 +3343,8 @@ class Task(Resource): :param agent_configuration: The machine configuration of the run agent. :type agent_configuration: ~azure.mgmt.containerregistry.v2019_06_01_preview.models.AgentProperties + :param agent_pool_name: The dedicated agent pool for the task. + :type agent_pool_name: str :param timeout: Run timeout in seconds. Default value: 3600 . :type timeout: int :param step: Required. The properties of a task step. @@ -3255,13 +3383,14 @@ class Task(Resource): 'status': {'key': 'properties.status', 'type': 'str'}, 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'agent_pool_name': {'key': 'properties.agentPoolName', 'type': 'str'}, 'timeout': {'key': 'properties.timeout', 'type': 'int'}, 'step': {'key': 'properties.step', 'type': 'TaskStepProperties'}, 'trigger': {'key': 'properties.trigger', 'type': 'TriggerProperties'}, 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, } - def __init__(self, *, location: str, platform, step, tags=None, identity=None, status=None, agent_configuration=None, timeout: int=3600, trigger=None, credentials=None, **kwargs) -> None: + def __init__(self, *, location: str, platform, step, tags=None, identity=None, status=None, agent_configuration=None, agent_pool_name: str=None, timeout: int=3600, trigger=None, credentials=None, **kwargs) -> None: super(Task, self).__init__(location=location, tags=tags, **kwargs) self.identity = identity self.provisioning_state = None @@ -3269,6 +3398,7 @@ def __init__(self, *, location: str, platform, step, tags=None, identity=None, s self.status = status self.platform = platform self.agent_configuration = agent_configuration + self.agent_pool_name = agent_pool_name self.timeout = timeout self.step = step self.trigger = trigger @@ -3353,6 +3483,8 @@ class TaskRunRequest(RunRequest): :param is_archive_enabled: The value that indicates whether archiving is enabled for the run or not. Default value: False . :type is_archive_enabled: bool + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param type: Required. Constant filled by server. :type type: str :param task_id: Required. The resource ID of task against which run has to @@ -3371,13 +3503,14 @@ class TaskRunRequest(RunRequest): _attribute_map = { 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'task_id': {'key': 'taskId', 'type': 'str'}, 'override_task_step_properties': {'key': 'overrideTaskStepProperties', 'type': 'OverrideTaskStepProperties'}, } - def __init__(self, *, task_id: str, is_archive_enabled: bool=False, override_task_step_properties=None, **kwargs) -> None: - super(TaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) + def __init__(self, *, task_id: str, is_archive_enabled: bool=False, agent_pool_name: str=None, override_task_step_properties=None, **kwargs) -> None: + super(TaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, agent_pool_name=agent_pool_name, **kwargs) self.task_id = task_id self.override_task_step_properties = override_task_step_properties self.type = 'TaskRunRequest' @@ -3431,6 +3564,8 @@ class TaskUpdateParameters(Model): :param agent_configuration: The machine configuration of the run agent. :type agent_configuration: ~azure.mgmt.containerregistry.v2019_06_01_preview.models.AgentProperties + :param agent_pool_name: The dedicated agent pool for the task. + :type agent_pool_name: str :param timeout: Run timeout in seconds. :type timeout: int :param step: The properties for updating a task step. @@ -3452,6 +3587,7 @@ class TaskUpdateParameters(Model): 'status': {'key': 'properties.status', 'type': 'str'}, 'platform': {'key': 'properties.platform', 'type': 'PlatformUpdateParameters'}, 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'agent_pool_name': {'key': 'properties.agentPoolName', 'type': 'str'}, 'timeout': {'key': 'properties.timeout', 'type': 'int'}, 'step': {'key': 'properties.step', 'type': 'TaskStepUpdateParameters'}, 'trigger': {'key': 'properties.trigger', 'type': 'TriggerUpdateParameters'}, @@ -3459,12 +3595,13 @@ class TaskUpdateParameters(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, identity=None, status=None, platform=None, agent_configuration=None, timeout: int=None, step=None, trigger=None, credentials=None, tags=None, **kwargs) -> None: + def __init__(self, *, identity=None, status=None, platform=None, agent_configuration=None, agent_pool_name: str=None, timeout: int=None, step=None, trigger=None, credentials=None, tags=None, **kwargs) -> None: super(TaskUpdateParameters, self).__init__(**kwargs) self.identity = identity self.status = status self.platform = platform self.agent_configuration = agent_configuration + self.agent_pool_name = agent_pool_name self.timeout = timeout self.step = step self.trigger = trigger diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_paged_models.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_paged_models.py index 62da7b150809..322635ae0824 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_paged_models.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_paged_models.py @@ -77,6 +77,19 @@ class EventPaged(Paged): def __init__(self, *args, **kwargs): super(EventPaged, self).__init__(*args, **kwargs) +class AgentPoolPaged(Paged): + """ + A paging container for iterating over a list of :class:`AgentPool ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AgentPool]'} + } + + def __init__(self, *args, **kwargs): + + super(AgentPoolPaged, self).__init__(*args, **kwargs) class RunPaged(Paged): """ A paging container for iterating over a list of :class:`Run ` object diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/__init__.py index fe07fc43b190..ee3c5c8427b6 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/__init__.py @@ -13,6 +13,7 @@ from ._operations import Operations from ._replications_operations import ReplicationsOperations from ._webhooks_operations import WebhooksOperations +from ._agent_pools_operations import AgentPoolsOperations from ._runs_operations import RunsOperations from ._task_runs_operations import TaskRunsOperations from ._tasks_operations import TasksOperations @@ -24,6 +25,7 @@ 'Operations', 'ReplicationsOperations', 'WebhooksOperations', + 'AgentPoolsOperations', 'RunsOperations', 'TaskRunsOperations', 'TasksOperations', diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_agent_pools_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_agent_pools_operations.py new file mode 100644 index 000000000000..6e8c584d2310 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_agent_pools_operations.py @@ -0,0 +1,546 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class AgentPoolsOperations(object): + """AgentPoolsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The client API version. Constant value: "2019-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01-preview" + + self.config = config + + def get( + self, resource_group_name, registry_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + """Gets the detailed information for a given agent pool. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AgentPool or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.AgentPool or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorSchemaException` + """ + # Construct URL + 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str', max_length=20, min_length=3, pattern=r'^[a-zA-Z0-9-]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorSchemaException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AgentPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}'} + + + def _create_initial( + self, resource_group_name, registry_name, agent_pool_name, agent_pool, custom_headers=None, raw=False, **operation_config): + # Construct URL + 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str', max_length=20, min_length=3, pattern=r'^[a-zA-Z0-9-]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(agent_pool, 'AgentPool') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorSchemaException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AgentPool', response) + if response.status_code == 201: + deserialized = self._deserialize('AgentPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, registry_name, agent_pool_name, agent_pool, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates an agent pool for a container registry with the specified + parameters. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :param agent_pool: The parameters of an agent pool that needs to + scheduled. + :type agent_pool: + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.AgentPool + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AgentPool or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_06_01_preview.models.AgentPool] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_06_01_preview.models.AgentPool]] + :raises: + :class:`ErrorSchemaException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + agent_pool_name=agent_pool_name, + agent_pool=agent_pool, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('AgentPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}'} + + + def _delete_initial( + self, resource_group_name, registry_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str', max_length=20, min_length=3, pattern=r'^[a-zA-Z0-9-]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorSchemaException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, registry_name, agent_pool_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a specified agent pool resource. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorSchemaException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + agent_pool_name=agent_pool_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}'} + + + def _update_initial( + self, resource_group_name, registry_name, agent_pool_name, count=None, tags=None, custom_headers=None, raw=False, **operation_config): + update_parameters = models.AgentPoolUpdateParameters(count=count, tags=tags) + + # Construct URL + 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str', max_length=20, min_length=3, pattern=r'^[a-zA-Z0-9-]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(update_parameters, 'AgentPoolUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorSchemaException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AgentPool', response) + if response.status_code == 201: + deserialized = self._deserialize('AgentPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, registry_name, agent_pool_name, count=None, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates an agent pool with the specified parameters. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :param count: The count of agent machine + :type count: int + :param tags: The ARM resource tags. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AgentPool or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_06_01_preview.models.AgentPool] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_06_01_preview.models.AgentPool]] + :raises: + :class:`ErrorSchemaException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + agent_pool_name=agent_pool_name, + count=count, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('AgentPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}'} + + def list( + self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): + """Lists all the agent pools for a specified container registry. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AgentPool + :rtype: + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.AgentPoolPaged[~azure.mgmt.containerregistry.v2019_06_01_preview.models.AgentPool] + :raises: + :class:`ErrorSchemaException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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', 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) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorSchemaException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AgentPoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools'} + + def get_queue_status( + self, resource_group_name, registry_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + """Gets the count of queued runs for a given agent pool. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AgentPoolQueueStatus or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.AgentPoolQueueStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorSchemaException` + """ + # Construct URL + url = self.get_queue_status.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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str', max_length=20, min_length=3, pattern=r'^[a-zA-Z0-9-]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorSchemaException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AgentPoolQueueStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_queue_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}/listQueueStatus'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_task_runs_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_task_runs_operations.py index cada44ad3e40..eed099741e3c 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_task_runs_operations.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_task_runs_operations.py @@ -403,6 +403,72 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}'} + def get_details( + self, resource_group_name, registry_name, task_run_name, custom_headers=None, raw=False, **operation_config): + """Gets the detailed information for a given task run that includes all + secrets. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param task_run_name: The run request name. + :type task_run_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TaskRun or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.TaskRun or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorSchemaException` + """ + # Construct URL + url = self.get_details.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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'taskRunName': self._serialize.url("task_run_name", task_run_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorSchemaException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TaskRun', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_details.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}/listDetails'} + def list( self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): """Lists all the task runs for a specified container registry. diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/_container_registry_management_client.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/_container_registry_management_client.py index 24c6279b6d2f..62accd4b246d 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/_container_registry_management_client.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/_container_registry_management_client.py @@ -18,6 +18,7 @@ from .operations import PrivateEndpointConnectionsOperations from .operations import ReplicationsOperations from .operations import WebhooksOperations +from .operations import AgentPoolsOperations from .operations import RunsOperations from .operations import TaskRunsOperations from .operations import TasksOperations @@ -42,6 +43,8 @@ class ContainerRegistryManagementClient(SDKClient): :vartype replications: azure.mgmt.containerregistry.v2019_12_01_preview.operations.ReplicationsOperations :ivar webhooks: Webhooks operations :vartype webhooks: azure.mgmt.containerregistry.v2019_12_01_preview.operations.WebhooksOperations + :ivar agent_pools: AgentPools operations + :vartype agent_pools: azure.mgmt.containerregistry.v2019_12_01_preview.operations.AgentPoolsOperations :ivar runs: Runs operations :vartype runs: azure.mgmt.containerregistry.v2019_12_01_preview.operations.RunsOperations :ivar task_runs: TaskRuns operations @@ -81,6 +84,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.webhooks = WebhooksOperations( self._client, self.config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations( + self._client, self.config, self._serialize, self._deserialize) self.runs = RunsOperations( self._client, self.config, self._serialize, self._deserialize) self.task_runs = TaskRunsOperations( diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/models/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/models/__init__.py index 704e5ad09424..e4c3cc73b757 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/models/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/models/__init__.py @@ -12,6 +12,9 @@ try: from ._models_py3 import ActiveDirectoryObject from ._models_py3 import Actor + from ._models_py3 import AgentPool + from ._models_py3 import AgentPoolQueueStatus + from ._models_py3 import AgentPoolUpdateParameters from ._models_py3 import AgentProperties from ._models_py3 import Argument from ._models_py3 import AuthInfo @@ -125,6 +128,9 @@ except (SyntaxError, ImportError): from ._models import ActiveDirectoryObject from ._models import Actor + from ._models import AgentPool + from ._models import AgentPoolQueueStatus + from ._models import AgentPoolUpdateParameters from ._models import AgentProperties from ._models import Argument from ._models import AuthInfo @@ -235,6 +241,7 @@ from ._models import Webhook from ._models import WebhookCreateParameters from ._models import WebhookUpdateParameters +from ._paged_models import AgentPoolPaged from ._paged_models import EventPaged from ._paged_models import OperationDefinitionPaged from ._paged_models import PrivateEndpointConnectionPaged @@ -264,9 +271,9 @@ RegistryUsageUnit, WebhookStatus, WebhookAction, + OS, RunStatus, RunType, - OS, Architecture, Variant, TaskStatus, @@ -287,6 +294,9 @@ __all__ = [ 'ActiveDirectoryObject', 'Actor', + 'AgentPool', + 'AgentPoolQueueStatus', + 'AgentPoolUpdateParameters', 'AgentProperties', 'Argument', 'AuthInfo', @@ -404,6 +414,7 @@ 'ReplicationPaged', 'WebhookPaged', 'EventPaged', + 'AgentPoolPaged', 'RunPaged', 'TaskRunPaged', 'TaskPaged', @@ -425,9 +436,9 @@ 'RegistryUsageUnit', 'WebhookStatus', 'WebhookAction', + 'OS', 'RunStatus', 'RunType', - 'OS', 'Architecture', 'Variant', 'TaskStatus', diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/models/_container_registry_management_client_enums.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/models/_container_registry_management_client_enums.py index 9e398ed88a22..7ed9fe6b6dce 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/models/_container_registry_management_client_enums.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/models/_container_registry_management_client_enums.py @@ -121,6 +121,12 @@ class WebhookAction(str, Enum): chart_delete = "chart_delete" +class OS(str, Enum): + + windows = "Windows" + linux = "Linux" + + class RunStatus(str, Enum): queued = "Queued" @@ -141,12 +147,6 @@ class RunType(str, Enum): auto_run = "AutoRun" -class OS(str, Enum): - - windows = "Windows" - linux = "Linux" - - class Architecture(str, Enum): amd64 = "amd64" diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/models/_models.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/models/_models.py index d40b9cba05e4..24c1bbfcd86f 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/models/_models.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/models/_models.py @@ -56,6 +56,155 @@ def __init__(self, **kwargs): self.name = kwargs.get('name', None) +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, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class AgentPool(Resource): + """The agentpool that has the ARM resource and properties. + The agentpool will have all information to create an agent pool. + + 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 count: The count of agent machine + :type count: int + :param tier: The Tier of agent machine + :type tier: str + :param os: The OS of agent machine. Possible values include: 'Windows', + 'Linux' + :type os: str or + ~azure.mgmt.containerregistry.v2019_12_01_preview.models.OS + :param virtual_network_subnet_resource_id: The Virtual Network Subnet + Resource Id of the agent machine + :type virtual_network_subnet_resource_id: str + :ivar provisioning_state: The provisioning state of this agent pool. + Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2019_12_01_preview.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + 'count': {'key': 'properties.count', 'type': 'int'}, + 'tier': {'key': 'properties.tier', 'type': 'str'}, + 'os': {'key': 'properties.os', 'type': 'str'}, + 'virtual_network_subnet_resource_id': {'key': 'properties.virtualNetworkSubnetResourceId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AgentPool, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.tier = kwargs.get('tier', None) + self.os = kwargs.get('os', None) + self.virtual_network_subnet_resource_id = kwargs.get('virtual_network_subnet_resource_id', None) + self.provisioning_state = None + + +class AgentPoolQueueStatus(Model): + """The QueueStatus of Agent Pool. + + :param count: The number of pending runs in the queue + :type count: int + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(AgentPoolQueueStatus, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + + +class AgentPoolUpdateParameters(Model): + """The parameters for updating an agent pool. + + :param count: The count of agent machine + :type count: int + :param tags: The ARM resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'count': {'key': 'properties.count', 'type': 'int'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(AgentPoolUpdateParameters, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.tags = kwargs.get('tags', None) + + class AgentProperties(Model): """The properties that determine the run agent configuration. @@ -420,6 +569,8 @@ class RunRequest(Model): :param is_archive_enabled: The value that indicates whether archiving is enabled for the run or not. Default value: False . :type is_archive_enabled: bool + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param type: Required. Constant filled by server. :type type: str """ @@ -430,6 +581,7 @@ class RunRequest(Model): _attribute_map = { 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, } @@ -440,6 +592,7 @@ class RunRequest(Model): def __init__(self, **kwargs): super(RunRequest, self).__init__(**kwargs) self.is_archive_enabled = kwargs.get('is_archive_enabled', False) + self.agent_pool_name = kwargs.get('agent_pool_name', None) self.type = None @@ -451,6 +604,8 @@ class DockerBuildRequest(RunRequest): :param is_archive_enabled: The value that indicates whether archiving is enabled for the run or not. Default value: False . :type is_archive_enabled: bool + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param type: Required. Constant filled by server. :type type: str :param image_names: The fully qualified image names including the @@ -500,6 +655,7 @@ class DockerBuildRequest(RunRequest): _attribute_map = { 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'image_names': {'key': 'imageNames', 'type': '[str]'}, 'is_push_enabled': {'key': 'isPushEnabled', 'type': 'bool'}, @@ -755,6 +911,8 @@ class EncodedTaskRunRequest(RunRequest): :param is_archive_enabled: The value that indicates whether archiving is enabled for the run or not. Default value: False . :type is_archive_enabled: bool + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param type: Required. Constant filled by server. :type type: str :param encoded_task_content: Required. Base64 encoded value of the @@ -796,6 +954,7 @@ class EncodedTaskRunRequest(RunRequest): _attribute_map = { 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, @@ -1162,6 +1321,8 @@ class FileTaskRunRequest(RunRequest): :param is_archive_enabled: The value that indicates whether archiving is enabled for the run or not. Default value: False . :type is_archive_enabled: bool + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param type: Required. Constant filled by server. :type type: str :param task_file_path: Required. The template/definition file path @@ -1203,6 +1364,7 @@ class FileTaskRunRequest(RunRequest): _attribute_map = { 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, @@ -2144,51 +2306,6 @@ def __init__(self, **kwargs): self.name = kwargs.get('name', None) -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, **kwargs): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - - class Registry(Resource): """An object that represents a container registry. @@ -2676,6 +2793,8 @@ class Run(ProxyResource): 'QuickRun', 'AutoBuild', 'AutoRun' :type run_type: str or ~azure.mgmt.containerregistry.v2019_12_01_preview.models.RunType + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param create_time: The time the run was scheduled. :type create_time: datetime :param start_time: The time the run started. @@ -2741,6 +2860,7 @@ class Run(ProxyResource): 'status': {'key': 'properties.status', 'type': 'str'}, 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, 'run_type': {'key': 'properties.runType', 'type': 'str'}, + 'agent_pool_name': {'key': 'properties.agentPoolName', 'type': 'str'}, 'create_time': {'key': 'properties.createTime', 'type': 'iso-8601'}, 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, 'finish_time': {'key': 'properties.finishTime', 'type': 'iso-8601'}, @@ -2765,6 +2885,7 @@ def __init__(self, **kwargs): self.status = kwargs.get('status', None) self.last_updated_time = kwargs.get('last_updated_time', None) self.run_type = kwargs.get('run_type', None) + self.agent_pool_name = kwargs.get('agent_pool_name', None) self.create_time = kwargs.get('create_time', None) self.start_time = kwargs.get('start_time', None) self.finish_time = kwargs.get('finish_time', None) @@ -2810,6 +2931,9 @@ class RunFilter(Model): :type is_archive_enabled: bool :param task_name: The name of the task that the run corresponds to. :type task_name: str + :param agent_pool_name: The name of the agent pool that the run + corresponds to. + :type agent_pool_name: str """ _attribute_map = { @@ -2821,6 +2945,7 @@ class RunFilter(Model): 'output_image_manifests': {'key': 'outputImageManifests', 'type': 'str'}, 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, 'task_name': {'key': 'taskName', 'type': 'str'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, } def __init__(self, **kwargs): @@ -2833,6 +2958,7 @@ def __init__(self, **kwargs): self.output_image_manifests = kwargs.get('output_image_manifests', None) self.is_archive_enabled = kwargs.get('is_archive_enabled', None) self.task_name = kwargs.get('task_name', None) + self.agent_pool_name = kwargs.get('agent_pool_name', None) class RunGetLogResult(Model): @@ -3458,6 +3584,8 @@ class Task(Resource): :param agent_configuration: The machine configuration of the run agent. :type agent_configuration: ~azure.mgmt.containerregistry.v2019_12_01_preview.models.AgentProperties + :param agent_pool_name: The dedicated agent pool for the task. + :type agent_pool_name: str :param timeout: Run timeout in seconds. Default value: 3600 . :type timeout: int :param step: Required. The properties of a task step. @@ -3496,6 +3624,7 @@ class Task(Resource): 'status': {'key': 'properties.status', 'type': 'str'}, 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'agent_pool_name': {'key': 'properties.agentPoolName', 'type': 'str'}, 'timeout': {'key': 'properties.timeout', 'type': 'int'}, 'step': {'key': 'properties.step', 'type': 'TaskStepProperties'}, 'trigger': {'key': 'properties.trigger', 'type': 'TriggerProperties'}, @@ -3510,6 +3639,7 @@ def __init__(self, **kwargs): self.status = kwargs.get('status', None) self.platform = kwargs.get('platform', None) self.agent_configuration = kwargs.get('agent_configuration', None) + self.agent_pool_name = kwargs.get('agent_pool_name', None) self.timeout = kwargs.get('timeout', 3600) self.step = kwargs.get('step', None) self.trigger = kwargs.get('trigger', None) @@ -3594,6 +3724,8 @@ class TaskRunRequest(RunRequest): :param is_archive_enabled: The value that indicates whether archiving is enabled for the run or not. Default value: False . :type is_archive_enabled: bool + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param type: Required. Constant filled by server. :type type: str :param task_id: Required. The resource ID of task against which run has to @@ -3612,6 +3744,7 @@ class TaskRunRequest(RunRequest): _attribute_map = { 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'task_id': {'key': 'taskId', 'type': 'str'}, 'override_task_step_properties': {'key': 'overrideTaskStepProperties', 'type': 'OverrideTaskStepProperties'}, @@ -3672,6 +3805,8 @@ class TaskUpdateParameters(Model): :param agent_configuration: The machine configuration of the run agent. :type agent_configuration: ~azure.mgmt.containerregistry.v2019_12_01_preview.models.AgentProperties + :param agent_pool_name: The dedicated agent pool for the task. + :type agent_pool_name: str :param timeout: Run timeout in seconds. :type timeout: int :param step: The properties for updating a task step. @@ -3693,6 +3828,7 @@ class TaskUpdateParameters(Model): 'status': {'key': 'properties.status', 'type': 'str'}, 'platform': {'key': 'properties.platform', 'type': 'PlatformUpdateParameters'}, 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'agent_pool_name': {'key': 'properties.agentPoolName', 'type': 'str'}, 'timeout': {'key': 'properties.timeout', 'type': 'int'}, 'step': {'key': 'properties.step', 'type': 'TaskStepUpdateParameters'}, 'trigger': {'key': 'properties.trigger', 'type': 'TriggerUpdateParameters'}, @@ -3706,6 +3842,7 @@ def __init__(self, **kwargs): self.status = kwargs.get('status', None) self.platform = kwargs.get('platform', None) self.agent_configuration = kwargs.get('agent_configuration', None) + self.agent_pool_name = kwargs.get('agent_pool_name', None) self.timeout = kwargs.get('timeout', None) self.step = kwargs.get('step', None) self.trigger = kwargs.get('trigger', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/models/_models_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/models/_models_py3.py index a8bf60ba83a3..922b5fbf99f0 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/models/_models_py3.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/models/_models_py3.py @@ -56,6 +56,155 @@ def __init__(self, *, name: str=None, **kwargs) -> None: self.name = name +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 + + +class AgentPool(Resource): + """The agentpool that has the ARM resource and properties. + The agentpool will have all information to create an agent pool. + + 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 count: The count of agent machine + :type count: int + :param tier: The Tier of agent machine + :type tier: str + :param os: The OS of agent machine. Possible values include: 'Windows', + 'Linux' + :type os: str or + ~azure.mgmt.containerregistry.v2019_12_01_preview.models.OS + :param virtual_network_subnet_resource_id: The Virtual Network Subnet + Resource Id of the agent machine + :type virtual_network_subnet_resource_id: str + :ivar provisioning_state: The provisioning state of this agent pool. + Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2019_12_01_preview.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + 'count': {'key': 'properties.count', 'type': 'int'}, + 'tier': {'key': 'properties.tier', 'type': 'str'}, + 'os': {'key': 'properties.os', 'type': 'str'}, + 'virtual_network_subnet_resource_id': {'key': 'properties.virtualNetworkSubnetResourceId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, count: int=None, tier: str=None, os=None, virtual_network_subnet_resource_id: str=None, **kwargs) -> None: + super(AgentPool, self).__init__(location=location, tags=tags, **kwargs) + self.count = count + self.tier = tier + self.os = os + self.virtual_network_subnet_resource_id = virtual_network_subnet_resource_id + self.provisioning_state = None + + +class AgentPoolQueueStatus(Model): + """The QueueStatus of Agent Pool. + + :param count: The number of pending runs in the queue + :type count: int + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__(self, *, count: int=None, **kwargs) -> None: + super(AgentPoolQueueStatus, self).__init__(**kwargs) + self.count = count + + +class AgentPoolUpdateParameters(Model): + """The parameters for updating an agent pool. + + :param count: The count of agent machine + :type count: int + :param tags: The ARM resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'count': {'key': 'properties.count', 'type': 'int'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, count: int=None, tags=None, **kwargs) -> None: + super(AgentPoolUpdateParameters, self).__init__(**kwargs) + self.count = count + self.tags = tags + + class AgentProperties(Model): """The properties that determine the run agent configuration. @@ -420,6 +569,8 @@ class RunRequest(Model): :param is_archive_enabled: The value that indicates whether archiving is enabled for the run or not. Default value: False . :type is_archive_enabled: bool + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param type: Required. Constant filled by server. :type type: str """ @@ -430,6 +581,7 @@ class RunRequest(Model): _attribute_map = { 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, } @@ -437,9 +589,10 @@ class RunRequest(Model): 'type': {'DockerBuildRequest': 'DockerBuildRequest', 'FileTaskRunRequest': 'FileTaskRunRequest', 'TaskRunRequest': 'TaskRunRequest', 'EncodedTaskRunRequest': 'EncodedTaskRunRequest'} } - def __init__(self, *, is_archive_enabled: bool=False, **kwargs) -> None: + def __init__(self, *, is_archive_enabled: bool=False, agent_pool_name: str=None, **kwargs) -> None: super(RunRequest, self).__init__(**kwargs) self.is_archive_enabled = is_archive_enabled + self.agent_pool_name = agent_pool_name self.type = None @@ -451,6 +604,8 @@ class DockerBuildRequest(RunRequest): :param is_archive_enabled: The value that indicates whether archiving is enabled for the run or not. Default value: False . :type is_archive_enabled: bool + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param type: Required. Constant filled by server. :type type: str :param image_names: The fully qualified image names including the @@ -500,6 +655,7 @@ class DockerBuildRequest(RunRequest): _attribute_map = { 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'image_names': {'key': 'imageNames', 'type': '[str]'}, 'is_push_enabled': {'key': 'isPushEnabled', 'type': 'bool'}, @@ -514,8 +670,8 @@ class DockerBuildRequest(RunRequest): 'credentials': {'key': 'credentials', 'type': 'Credentials'}, } - def __init__(self, *, docker_file_path: str, platform, is_archive_enabled: bool=False, image_names=None, is_push_enabled: bool=True, no_cache: bool=False, target: str=None, arguments=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: - super(DockerBuildRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) + def __init__(self, *, docker_file_path: str, platform, is_archive_enabled: bool=False, agent_pool_name: str=None, image_names=None, is_push_enabled: bool=True, no_cache: bool=False, target: str=None, arguments=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: + super(DockerBuildRequest, self).__init__(is_archive_enabled=is_archive_enabled, agent_pool_name=agent_pool_name, **kwargs) self.image_names = image_names self.is_push_enabled = is_push_enabled self.no_cache = no_cache @@ -755,6 +911,8 @@ class EncodedTaskRunRequest(RunRequest): :param is_archive_enabled: The value that indicates whether archiving is enabled for the run or not. Default value: False . :type is_archive_enabled: bool + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param type: Required. Constant filled by server. :type type: str :param encoded_task_content: Required. Base64 encoded value of the @@ -796,6 +954,7 @@ class EncodedTaskRunRequest(RunRequest): _attribute_map = { 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, @@ -807,8 +966,8 @@ class EncodedTaskRunRequest(RunRequest): 'credentials': {'key': 'credentials', 'type': 'Credentials'}, } - def __init__(self, *, encoded_task_content: str, platform, is_archive_enabled: bool=False, encoded_values_content: str=None, values=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: - super(EncodedTaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) + def __init__(self, *, encoded_task_content: str, platform, is_archive_enabled: bool=False, agent_pool_name: str=None, encoded_values_content: str=None, values=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: + super(EncodedTaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, agent_pool_name=agent_pool_name, **kwargs) self.encoded_task_content = encoded_task_content self.encoded_values_content = encoded_values_content self.values = values @@ -1162,6 +1321,8 @@ class FileTaskRunRequest(RunRequest): :param is_archive_enabled: The value that indicates whether archiving is enabled for the run or not. Default value: False . :type is_archive_enabled: bool + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param type: Required. Constant filled by server. :type type: str :param task_file_path: Required. The template/definition file path @@ -1203,6 +1364,7 @@ class FileTaskRunRequest(RunRequest): _attribute_map = { 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, @@ -1214,8 +1376,8 @@ class FileTaskRunRequest(RunRequest): 'credentials': {'key': 'credentials', 'type': 'Credentials'}, } - def __init__(self, *, task_file_path: str, platform, is_archive_enabled: bool=False, values_file_path: str=None, values=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: - super(FileTaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) + def __init__(self, *, task_file_path: str, platform, is_archive_enabled: bool=False, agent_pool_name: str=None, values_file_path: str=None, values=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: + super(FileTaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, agent_pool_name=agent_pool_name, **kwargs) self.task_file_path = task_file_path self.values_file_path = values_file_path self.values = values @@ -2144,51 +2306,6 @@ def __init__(self, *, name, **kwargs) -> None: self.name = name -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 - - class Registry(Resource): """An object that represents a container registry. @@ -2676,6 +2793,8 @@ class Run(ProxyResource): 'QuickRun', 'AutoBuild', 'AutoRun' :type run_type: str or ~azure.mgmt.containerregistry.v2019_12_01_preview.models.RunType + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param create_time: The time the run was scheduled. :type create_time: datetime :param start_time: The time the run started. @@ -2741,6 +2860,7 @@ class Run(ProxyResource): 'status': {'key': 'properties.status', 'type': 'str'}, 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, 'run_type': {'key': 'properties.runType', 'type': 'str'}, + 'agent_pool_name': {'key': 'properties.agentPoolName', 'type': 'str'}, 'create_time': {'key': 'properties.createTime', 'type': 'iso-8601'}, 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, 'finish_time': {'key': 'properties.finishTime', 'type': 'iso-8601'}, @@ -2759,12 +2879,13 @@ class Run(ProxyResource): 'is_archive_enabled': {'key': 'properties.isArchiveEnabled', 'type': 'bool'}, } - def __init__(self, *, run_id: str=None, status=None, last_updated_time=None, run_type=None, create_time=None, start_time=None, finish_time=None, output_images=None, task: str=None, image_update_trigger=None, source_trigger=None, timer_trigger=None, platform=None, agent_configuration=None, source_registry_auth: str=None, custom_registries=None, update_trigger_token: str=None, provisioning_state=None, is_archive_enabled: bool=False, **kwargs) -> None: + def __init__(self, *, run_id: str=None, status=None, last_updated_time=None, run_type=None, agent_pool_name: str=None, create_time=None, start_time=None, finish_time=None, output_images=None, task: str=None, image_update_trigger=None, source_trigger=None, timer_trigger=None, platform=None, agent_configuration=None, source_registry_auth: str=None, custom_registries=None, update_trigger_token: str=None, provisioning_state=None, is_archive_enabled: bool=False, **kwargs) -> None: super(Run, self).__init__(**kwargs) self.run_id = run_id self.status = status self.last_updated_time = last_updated_time self.run_type = run_type + self.agent_pool_name = agent_pool_name self.create_time = create_time self.start_time = start_time self.finish_time = finish_time @@ -2810,6 +2931,9 @@ class RunFilter(Model): :type is_archive_enabled: bool :param task_name: The name of the task that the run corresponds to. :type task_name: str + :param agent_pool_name: The name of the agent pool that the run + corresponds to. + :type agent_pool_name: str """ _attribute_map = { @@ -2821,9 +2945,10 @@ class RunFilter(Model): 'output_image_manifests': {'key': 'outputImageManifests', 'type': 'str'}, 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, 'task_name': {'key': 'taskName', 'type': 'str'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, } - def __init__(self, *, run_id: str=None, run_type=None, status=None, create_time=None, finish_time=None, output_image_manifests: str=None, is_archive_enabled: bool=None, task_name: str=None, **kwargs) -> None: + def __init__(self, *, run_id: str=None, run_type=None, status=None, create_time=None, finish_time=None, output_image_manifests: str=None, is_archive_enabled: bool=None, task_name: str=None, agent_pool_name: str=None, **kwargs) -> None: super(RunFilter, self).__init__(**kwargs) self.run_id = run_id self.run_type = run_type @@ -2833,6 +2958,7 @@ def __init__(self, *, run_id: str=None, run_type=None, status=None, create_time= self.output_image_manifests = output_image_manifests self.is_archive_enabled = is_archive_enabled self.task_name = task_name + self.agent_pool_name = agent_pool_name class RunGetLogResult(Model): @@ -3458,6 +3584,8 @@ class Task(Resource): :param agent_configuration: The machine configuration of the run agent. :type agent_configuration: ~azure.mgmt.containerregistry.v2019_12_01_preview.models.AgentProperties + :param agent_pool_name: The dedicated agent pool for the task. + :type agent_pool_name: str :param timeout: Run timeout in seconds. Default value: 3600 . :type timeout: int :param step: Required. The properties of a task step. @@ -3496,13 +3624,14 @@ class Task(Resource): 'status': {'key': 'properties.status', 'type': 'str'}, 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'agent_pool_name': {'key': 'properties.agentPoolName', 'type': 'str'}, 'timeout': {'key': 'properties.timeout', 'type': 'int'}, 'step': {'key': 'properties.step', 'type': 'TaskStepProperties'}, 'trigger': {'key': 'properties.trigger', 'type': 'TriggerProperties'}, 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, } - def __init__(self, *, location: str, platform, step, tags=None, identity=None, status=None, agent_configuration=None, timeout: int=3600, trigger=None, credentials=None, **kwargs) -> None: + def __init__(self, *, location: str, platform, step, tags=None, identity=None, status=None, agent_configuration=None, agent_pool_name: str=None, timeout: int=3600, trigger=None, credentials=None, **kwargs) -> None: super(Task, self).__init__(location=location, tags=tags, **kwargs) self.identity = identity self.provisioning_state = None @@ -3510,6 +3639,7 @@ def __init__(self, *, location: str, platform, step, tags=None, identity=None, s self.status = status self.platform = platform self.agent_configuration = agent_configuration + self.agent_pool_name = agent_pool_name self.timeout = timeout self.step = step self.trigger = trigger @@ -3594,6 +3724,8 @@ class TaskRunRequest(RunRequest): :param is_archive_enabled: The value that indicates whether archiving is enabled for the run or not. Default value: False . :type is_archive_enabled: bool + :param agent_pool_name: The dedicated agent pool for the run. + :type agent_pool_name: str :param type: Required. Constant filled by server. :type type: str :param task_id: Required. The resource ID of task against which run has to @@ -3612,13 +3744,14 @@ class TaskRunRequest(RunRequest): _attribute_map = { 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'agent_pool_name': {'key': 'agentPoolName', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'task_id': {'key': 'taskId', 'type': 'str'}, 'override_task_step_properties': {'key': 'overrideTaskStepProperties', 'type': 'OverrideTaskStepProperties'}, } - def __init__(self, *, task_id: str, is_archive_enabled: bool=False, override_task_step_properties=None, **kwargs) -> None: - super(TaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) + def __init__(self, *, task_id: str, is_archive_enabled: bool=False, agent_pool_name: str=None, override_task_step_properties=None, **kwargs) -> None: + super(TaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, agent_pool_name=agent_pool_name, **kwargs) self.task_id = task_id self.override_task_step_properties = override_task_step_properties self.type = 'TaskRunRequest' @@ -3672,6 +3805,8 @@ class TaskUpdateParameters(Model): :param agent_configuration: The machine configuration of the run agent. :type agent_configuration: ~azure.mgmt.containerregistry.v2019_12_01_preview.models.AgentProperties + :param agent_pool_name: The dedicated agent pool for the task. + :type agent_pool_name: str :param timeout: Run timeout in seconds. :type timeout: int :param step: The properties for updating a task step. @@ -3693,6 +3828,7 @@ class TaskUpdateParameters(Model): 'status': {'key': 'properties.status', 'type': 'str'}, 'platform': {'key': 'properties.platform', 'type': 'PlatformUpdateParameters'}, 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'agent_pool_name': {'key': 'properties.agentPoolName', 'type': 'str'}, 'timeout': {'key': 'properties.timeout', 'type': 'int'}, 'step': {'key': 'properties.step', 'type': 'TaskStepUpdateParameters'}, 'trigger': {'key': 'properties.trigger', 'type': 'TriggerUpdateParameters'}, @@ -3700,12 +3836,13 @@ class TaskUpdateParameters(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, identity=None, status=None, platform=None, agent_configuration=None, timeout: int=None, step=None, trigger=None, credentials=None, tags=None, **kwargs) -> None: + def __init__(self, *, identity=None, status=None, platform=None, agent_configuration=None, agent_pool_name: str=None, timeout: int=None, step=None, trigger=None, credentials=None, tags=None, **kwargs) -> None: super(TaskUpdateParameters, self).__init__(**kwargs) self.identity = identity self.status = status self.platform = platform self.agent_configuration = agent_configuration + self.agent_pool_name = agent_pool_name self.timeout = timeout self.step = step self.trigger = trigger diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/models/_paged_models.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/models/_paged_models.py index 080653ac8482..b609eb2d2589 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/models/_paged_models.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/models/_paged_models.py @@ -103,6 +103,19 @@ class EventPaged(Paged): def __init__(self, *args, **kwargs): super(EventPaged, self).__init__(*args, **kwargs) +class AgentPoolPaged(Paged): + """ + A paging container for iterating over a list of :class:`AgentPool ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AgentPool]'} + } + + def __init__(self, *args, **kwargs): + + super(AgentPoolPaged, self).__init__(*args, **kwargs) class RunPaged(Paged): """ A paging container for iterating over a list of :class:`Run ` object diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/operations/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/operations/__init__.py index c94c913b02c5..b76a26cfdcf9 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/operations/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/operations/__init__.py @@ -14,6 +14,7 @@ from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations from ._replications_operations import ReplicationsOperations from ._webhooks_operations import WebhooksOperations +from ._agent_pools_operations import AgentPoolsOperations from ._runs_operations import RunsOperations from ._task_runs_operations import TaskRunsOperations from ._tasks_operations import TasksOperations @@ -26,6 +27,7 @@ 'PrivateEndpointConnectionsOperations', 'ReplicationsOperations', 'WebhooksOperations', + 'AgentPoolsOperations', 'RunsOperations', 'TaskRunsOperations', 'TasksOperations', diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/operations/_agent_pools_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/operations/_agent_pools_operations.py new file mode 100644 index 000000000000..898a7a92df9e --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/operations/_agent_pools_operations.py @@ -0,0 +1,546 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class AgentPoolsOperations(object): + """AgentPoolsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The client API version. Constant value: "2019-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01-preview" + + self.config = config + + def get( + self, resource_group_name, registry_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + """Gets the detailed information for a given agent pool. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AgentPool or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2019_12_01_preview.models.AgentPool or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorSchemaException` + """ + # Construct URL + 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str', max_length=20, min_length=3, pattern=r'^[a-zA-Z0-9-]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorSchemaException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AgentPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}'} + + + def _create_initial( + self, resource_group_name, registry_name, agent_pool_name, agent_pool, custom_headers=None, raw=False, **operation_config): + # Construct URL + 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str', max_length=20, min_length=3, pattern=r'^[a-zA-Z0-9-]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(agent_pool, 'AgentPool') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorSchemaException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AgentPool', response) + if response.status_code == 201: + deserialized = self._deserialize('AgentPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, registry_name, agent_pool_name, agent_pool, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates an agent pool for a container registry with the specified + parameters. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :param agent_pool: The parameters of an agent pool that needs to + scheduled. + :type agent_pool: + ~azure.mgmt.containerregistry.v2019_12_01_preview.models.AgentPool + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AgentPool or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_12_01_preview.models.AgentPool] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_12_01_preview.models.AgentPool]] + :raises: + :class:`ErrorSchemaException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + agent_pool_name=agent_pool_name, + agent_pool=agent_pool, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('AgentPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}'} + + + def _delete_initial( + self, resource_group_name, registry_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str', max_length=20, min_length=3, pattern=r'^[a-zA-Z0-9-]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorSchemaException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, registry_name, agent_pool_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a specified agent pool resource. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorSchemaException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + agent_pool_name=agent_pool_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}'} + + + def _update_initial( + self, resource_group_name, registry_name, agent_pool_name, count=None, tags=None, custom_headers=None, raw=False, **operation_config): + update_parameters = models.AgentPoolUpdateParameters(count=count, tags=tags) + + # Construct URL + 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str', max_length=20, min_length=3, pattern=r'^[a-zA-Z0-9-]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(update_parameters, 'AgentPoolUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorSchemaException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AgentPool', response) + if response.status_code == 201: + deserialized = self._deserialize('AgentPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, registry_name, agent_pool_name, count=None, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates an agent pool with the specified parameters. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :param count: The count of agent machine + :type count: int + :param tags: The ARM resource tags. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AgentPool or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_12_01_preview.models.AgentPool] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_12_01_preview.models.AgentPool]] + :raises: + :class:`ErrorSchemaException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + agent_pool_name=agent_pool_name, + count=count, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('AgentPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}'} + + def list( + self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): + """Lists all the agent pools for a specified container registry. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AgentPool + :rtype: + ~azure.mgmt.containerregistry.v2019_12_01_preview.models.AgentPoolPaged[~azure.mgmt.containerregistry.v2019_12_01_preview.models.AgentPool] + :raises: + :class:`ErrorSchemaException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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', 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) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorSchemaException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AgentPoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools'} + + def get_queue_status( + self, resource_group_name, registry_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + """Gets the count of queued runs for a given agent pool. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AgentPoolQueueStatus or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2019_12_01_preview.models.AgentPoolQueueStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorSchemaException` + """ + # Construct URL + url = self.get_queue_status.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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str', max_length=20, min_length=3, pattern=r'^[a-zA-Z0-9-]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorSchemaException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AgentPoolQueueStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_queue_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}/listQueueStatus'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/operations/_task_runs_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/operations/_task_runs_operations.py index eec0d4cad537..9bae3e999f35 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/operations/_task_runs_operations.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_12_01_preview/operations/_task_runs_operations.py @@ -403,6 +403,72 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}'} + def get_details( + self, resource_group_name, registry_name, task_run_name, custom_headers=None, raw=False, **operation_config): + """Gets the detailed information for a given task run that includes all + secrets. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param task_run_name: The run request name. + :type task_run_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TaskRun or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2019_12_01_preview.models.TaskRun or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorSchemaException` + """ + # Construct URL + url = self.get_details.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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'taskRunName': self._serialize.url("task_run_name", task_run_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorSchemaException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TaskRun', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_details.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}/listDetails'} + def list( self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): """Lists all the task runs for a specified container registry.