diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/_azure_machine_learning_workspaces.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/_azure_machine_learning_workspaces.py index e0a0e2c4d834..d4a7b8497261 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/_azure_machine_learning_workspaces.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/_azure_machine_learning_workspaces.py @@ -17,6 +17,7 @@ from .operations import WorkspacesOperations from .operations import UsagesOperations from .operations import VirtualMachineSizesOperations +from .operations import QuotasOperations from .operations import MachineLearningComputeOperations from . import models @@ -35,6 +36,8 @@ class AzureMachineLearningWorkspaces(SDKClient): :vartype usages: azure.mgmt.machinelearningservices.operations.UsagesOperations :ivar virtual_machine_sizes: VirtualMachineSizes operations :vartype virtual_machine_sizes: azure.mgmt.machinelearningservices.operations.VirtualMachineSizesOperations + :ivar quotas: Quotas operations + :vartype quotas: azure.mgmt.machinelearningservices.operations.QuotasOperations :ivar machine_learning_compute: MachineLearningCompute operations :vartype machine_learning_compute: azure.mgmt.machinelearningservices.operations.MachineLearningComputeOperations @@ -53,7 +56,7 @@ def __init__( super(AzureMachineLearningWorkspaces, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2019-05-01' + self.api_version = '2019-11-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -65,5 +68,7 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.virtual_machine_sizes = VirtualMachineSizesOperations( self._client, self.config, self._serialize, self._deserialize) + self.quotas = QuotasOperations( + self._client, self.config, self._serialize, self._deserialize) self.machine_learning_compute = MachineLearningComputeOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/__init__.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/__init__.py index 2a709812fa94..3cc62d23ffee 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/__init__.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/__init__.py @@ -20,6 +20,12 @@ from ._models_py3 import AmlComputeProperties from ._models_py3 import ClusterUpdateParameters from ._models_py3 import Compute + from ._models_py3 import ComputeInstance + from ._models_py3 import ComputeInstanceApplication + from ._models_py3 import ComputeInstanceConnectivityEndpoints + from ._models_py3 import ComputeInstanceCreatedBy + from ._models_py3 import ComputeInstanceProperties + from ._models_py3 import ComputeInstanceSshSettings from ._models_py3 import ComputeNodesInformation from ._models_py3 import ComputeResource from ._models_py3 import ComputeSecrets @@ -40,13 +46,19 @@ from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import Password + from ._models_py3 import QuotaBaseProperties + from ._models_py3 import QuotaUpdateParameters from ._models_py3 import RegistryListCredentialsResult from ._models_py3 import Resource from ._models_py3 import ResourceId + from ._models_py3 import ResourceName + from ._models_py3 import ResourceQuota from ._models_py3 import ScaleSettings from ._models_py3 import ServicePrincipalCredentials from ._models_py3 import SslConfiguration from ._models_py3 import SystemService + from ._models_py3 import UpdateWorkspaceQuotas + from ._models_py3 import UpdateWorkspaceQuotasResult from ._models_py3 import Usage from ._models_py3 import UsageName from ._models_py3 import UserAccountCredentials @@ -69,6 +81,12 @@ from ._models import AmlComputeProperties from ._models import ClusterUpdateParameters from ._models import Compute + from ._models import ComputeInstance + from ._models import ComputeInstanceApplication + from ._models import ComputeInstanceConnectivityEndpoints + from ._models import ComputeInstanceCreatedBy + from ._models import ComputeInstanceProperties + from ._models import ComputeInstanceSshSettings from ._models import ComputeNodesInformation from ._models import ComputeResource from ._models import ComputeSecrets @@ -89,13 +107,19 @@ from ._models import Operation from ._models import OperationDisplay from ._models import Password + from ._models import QuotaBaseProperties + from ._models import QuotaUpdateParameters from ._models import RegistryListCredentialsResult from ._models import Resource from ._models import ResourceId + from ._models import ResourceName + from ._models import ResourceQuota from ._models import ScaleSettings from ._models import ServicePrincipalCredentials from ._models import SslConfiguration from ._models import SystemService + from ._models import UpdateWorkspaceQuotas + from ._models import UpdateWorkspaceQuotasResult from ._models import Usage from ._models import UsageName from ._models import UserAccountCredentials @@ -109,14 +133,23 @@ from ._models import WorkspaceUpdateParameters from ._paged_models import ComputeResourcePaged from ._paged_models import OperationPaged +from ._paged_models import ResourceQuotaPaged from ._paged_models import UsagePaged from ._paged_models import WorkspacePaged from ._azure_machine_learning_workspaces_enums import ( ProvisioningState, UsageUnit, + QuotaUnit, + Status, ResourceIdentityType, VmPriority, + OsType, + RemoteLoginPortPublicAccess, AllocationState, + ApplicationSharingPolicy, + SshPublicAccess, + ComputeInstanceState, + NodeState, ComputeType, UnderlyingResourceAction, ) @@ -132,6 +165,12 @@ 'AmlComputeProperties', 'ClusterUpdateParameters', 'Compute', + 'ComputeInstance', + 'ComputeInstanceApplication', + 'ComputeInstanceConnectivityEndpoints', + 'ComputeInstanceCreatedBy', + 'ComputeInstanceProperties', + 'ComputeInstanceSshSettings', 'ComputeNodesInformation', 'ComputeResource', 'ComputeSecrets', @@ -152,13 +191,19 @@ 'Operation', 'OperationDisplay', 'Password', + 'QuotaBaseProperties', + 'QuotaUpdateParameters', 'RegistryListCredentialsResult', 'Resource', 'ResourceId', + 'ResourceName', + 'ResourceQuota', 'ScaleSettings', 'ServicePrincipalCredentials', 'SslConfiguration', 'SystemService', + 'UpdateWorkspaceQuotas', + 'UpdateWorkspaceQuotasResult', 'Usage', 'UsageName', 'UserAccountCredentials', @@ -173,12 +218,21 @@ 'OperationPaged', 'WorkspacePaged', 'UsagePaged', + 'ResourceQuotaPaged', 'ComputeResourcePaged', 'ProvisioningState', 'UsageUnit', + 'QuotaUnit', + 'Status', 'ResourceIdentityType', 'VmPriority', + 'OsType', + 'RemoteLoginPortPublicAccess', 'AllocationState', + 'ApplicationSharingPolicy', + 'SshPublicAccess', + 'ComputeInstanceState', + 'NodeState', 'ComputeType', 'UnderlyingResourceAction', ] diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_azure_machine_learning_workspaces_enums.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_azure_machine_learning_workspaces_enums.py index 0e95e8e3d7ff..ab26a204b802 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_azure_machine_learning_workspaces_enums.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_azure_machine_learning_workspaces_enums.py @@ -28,6 +28,21 @@ class UsageUnit(str, Enum): count = "Count" +class QuotaUnit(str, Enum): + + count = "Count" + + +class Status(str, Enum): + + undefined = "Undefined" + success = "Success" + failure = "Failure" + invalid_quota_below_cluster_minimum = "InvalidQuotaBelowClusterMinimum" + invalid_quota_exceeds_subscription_limit = "InvalidQuotaExceedsSubscriptionLimit" + invalid_vm_family_name = "InvalidVMFamilyName" + + class ResourceIdentityType(str, Enum): system_assigned = "SystemAssigned" @@ -39,16 +54,72 @@ class VmPriority(str, Enum): low_priority = "LowPriority" +class OsType(str, Enum): + + linux = "Linux" + windows = "Windows" + + +class RemoteLoginPortPublicAccess(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + not_specified = "NotSpecified" + + class AllocationState(str, Enum): steady = "Steady" resizing = "Resizing" +class ApplicationSharingPolicy(str, Enum): + + personal = "Personal" + shared = "Shared" + + +class SshPublicAccess(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class ComputeInstanceState(str, Enum): + + creating = "Creating" + create_failed = "CreateFailed" + deleting = "Deleting" + ready = "Ready" + restarting = "Restarting" + restart_failed = "RestartFailed" + running = "Running" + setting_up = "SettingUp" + starting = "Starting" + start_failed = "StartFailed" + stop_failed = "StopFailed" + stopped = "Stopped" + stopping = "Stopping" + user_setting_up = "UserSettingUp" + unknown = "Unknown" + unusable = "Unusable" + + +class NodeState(str, Enum): + + idle = "idle" + running = "running" + preparing = "preparing" + unusable = "unusable" + leaving = "leaving" + preempted = "preempted" + + class ComputeType(str, Enum): aks = "AKS" aml_compute = "AmlCompute" + compute_instance = "ComputeInstance" data_factory = "DataFactory" virtual_machine = "VirtualMachine" hd_insight = "HDInsight" diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models.py index 8ded2b35dd56..2cb06ddf16db 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models.py @@ -17,8 +17,8 @@ class Compute(Model): """Machine Learning compute object. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AKS, AmlCompute, VirtualMachine, HDInsight, DataFactory, - Databricks, DataLakeAnalytics + sub-classes are: AKS, AmlCompute, ComputeInstance, VirtualMachine, + HDInsight, DataFactory, Databricks, DataLakeAnalytics Variables are only populated by the server, and will be ignored when sending a request. @@ -74,7 +74,7 @@ class Compute(Model): } _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'VirtualMachine': 'VirtualMachine', 'HDInsight': 'HDInsight', 'DataFactory': 'DataFactory', 'Databricks': 'Databricks', 'DataLakeAnalytics': 'DataLakeAnalytics'} + 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'VirtualMachine': 'VirtualMachine', 'HDInsight': 'HDInsight', 'DataFactory': 'DataFactory', 'Databricks': 'Databricks', 'DataLakeAnalytics': 'DataLakeAnalytics'} } def __init__(self, **kwargs): @@ -383,29 +383,50 @@ class AmlComputeNodeInformation(Model): :ivar node_id: Node ID. ID of the compute node. :vartype node_id: str - :ivar ip_address: IP address. Public IP address of the compute node. - :vartype ip_address: str + :ivar private_ip_address: Private IP address. Private IP address of the + compute node. + :vartype private_ip_address: str + :ivar public_ip_address: Public IP address. Public IP address of the + compute node. + :vartype public_ip_address: str :ivar port: Port. SSH port number of the node. :vartype port: float + :ivar node_state: State of the compute node. Values are idle, running, + preparing, unusable, leaving and preempted. Possible values include: + 'idle', 'running', 'preparing', 'unusable', 'leaving', 'preempted' + :vartype node_state: str or + ~azure.mgmt.machinelearningservices.models.NodeState + :ivar run_id: Run ID. ID of the Experiment running on the node, if any + else null. + :vartype run_id: str """ _validation = { 'node_id': {'readonly': True}, - 'ip_address': {'readonly': True}, + 'private_ip_address': {'readonly': True}, + 'public_ip_address': {'readonly': True}, 'port': {'readonly': True}, + 'node_state': {'readonly': True}, + 'run_id': {'readonly': True}, } _attribute_map = { 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, 'port': {'key': 'port', 'type': 'float'}, + 'node_state': {'key': 'nodeState', 'type': 'str'}, + 'run_id': {'key': 'runId', 'type': 'str'}, } def __init__(self, **kwargs): super(AmlComputeNodeInformation, self).__init__(**kwargs) self.node_id = None - self.ip_address = None + self.private_ip_address = None + self.public_ip_address = None self.port = None + self.node_state = None + self.run_id = None class ComputeNodesInformation(Model): @@ -493,6 +514,16 @@ class AmlComputeProperties(Model): 'Dedicated', 'LowPriority' :type vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority + :param os_type: OS Type. Possible values include: 'Linux', 'Windows'. + Default value: "Linux" . + :type os_type: str or ~azure.mgmt.machinelearningservices.models.OsType + :param virtual_machine_image: Custom VM image. The ARM resource identifier + of the virtual machine image for the compute nodes. This is of the form + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{gallery + name}/images/{image definition name}/versions/{version id}. The virtual + machine image must be in the same region and subscription as the cluster. + :type virtual_machine_image: + ~azure.mgmt.machinelearningservices.models.ResourceId :param scale_settings: Scale settings for AML Compute :type scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings @@ -503,6 +534,17 @@ class AmlComputeProperties(Model): :param subnet: Subnet. Virtual network subnet resource ID the compute nodes belong to. :type subnet: ~azure.mgmt.machinelearningservices.models.ResourceId + :param remote_login_port_public_access: Close remote Login Access Port. + State of the public SSH port. Possible values are: Disabled - Indicates + that the public ssh port is closed on all nodes of the cluster. Enabled - + Indicates that the public ssh port is open on all nodes of the cluster. + NotSpecified - Indicates that the public ssh port is closed on all nodes + of the cluster if VNet is defined, else is open all public nodes. It can + be default only during cluster creation time, after creation it will be + either enabled or disabled. Possible values include: 'Enabled', + 'Disabled', 'NotSpecified'. Default value: "NotSpecified" . + :type remote_login_port_public_access: str or + ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess :ivar allocation_state: Allocation state. Allocation state of the compute. Possible values are: steady - Indicates that the compute is not resizing. There are no changes to the number of compute nodes in the compute in @@ -547,9 +589,12 @@ class AmlComputeProperties(Model): _attribute_map = { 'vm_size': {'key': 'vmSize', 'type': 'str'}, 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'ResourceId'}, 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, + 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, 'allocation_state': {'key': 'allocationState', 'type': 'str'}, 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, 'errors': {'key': 'errors', 'type': '[MachineLearningServiceError]'}, @@ -562,9 +607,12 @@ def __init__(self, **kwargs): super(AmlComputeProperties, self).__init__(**kwargs) self.vm_size = kwargs.get('vm_size', None) self.vm_priority = kwargs.get('vm_priority', None) + self.os_type = kwargs.get('os_type', "Linux") + self.virtual_machine_image = kwargs.get('virtual_machine_image', None) self.scale_settings = kwargs.get('scale_settings', None) self.user_account_credentials = kwargs.get('user_account_credentials', None) self.subnet = kwargs.get('subnet', None) + self.remote_login_port_public_access = kwargs.get('remote_login_port_public_access', "NotSpecified") self.allocation_state = None self.allocation_state_transition_time = None self.errors = None @@ -599,6 +647,278 @@ def __init__(self, **kwargs): self.scale_settings = kwargs.get('scale_settings', None) +class ComputeInstance(Compute): + """An Azure Machine Learning compute instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param compute_location: Location for the underlying compute + :type compute_location: str + :ivar provisioning_state: The provision state of the cluster. Valid values + are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible + values include: 'Unknown', 'Updating', 'Creating', 'Deleting', + 'Succeeded', 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.machinelearningservices.models.ProvisioningState + :param description: The description of the Machine Learning compute. + :type description: str + :ivar created_on: The date and time when the compute was created. + :vartype created_on: datetime + :ivar modified_on: The date and time when the compute was last modified. + :vartype modified_on: datetime + :param resource_id: ARM resource id of the underlying compute + :type resource_id: str + :ivar provisioning_errors: Errors during provisioning + :vartype provisioning_errors: + list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :ivar is_attached_compute: Indicating whether the compute was provisioned + by user and brought from outside if true, or machine learning service + provisioned it if false. + :vartype is_attached_compute: bool + :param compute_type: Required. Constant filled by server. + :type compute_type: str + :param properties: Compute Instance properties + :type properties: + ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'created_on': {'readonly': True}, + 'modified_on': {'readonly': True}, + 'provisioning_errors': {'readonly': True}, + 'is_attached_compute': {'readonly': True}, + 'compute_type': {'required': True}, + } + + _attribute_map = { + 'compute_location': {'key': 'computeLocation', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, + 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[MachineLearningServiceError]'}, + 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, + 'compute_type': {'key': 'computeType', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, + } + + def __init__(self, **kwargs): + super(ComputeInstance, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.compute_type = 'ComputeInstance' + + +class ComputeInstanceApplication(Model): + """Defines an Aml Instance application and its connectivity endpoint URI. + + :param display_name: Name of the ComputeInstance application. + :type display_name: str + :param endpoint_uri: Application' endpoint URI. + :type endpoint_uri: str + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ComputeInstanceApplication, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.endpoint_uri = kwargs.get('endpoint_uri', None) + + +class ComputeInstanceConnectivityEndpoints(Model): + """Defines all connectivity endpoints and properties for an ComputeInstance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar public_ip_address: Public IP Address of this ComputeInstance. + :vartype public_ip_address: str + :ivar private_ip_address: Private IP Address of this ComputeInstance + (local to the VNET in which the compute instance is deployed). + :vartype private_ip_address: str + """ + + _validation = { + 'public_ip_address': {'readonly': True}, + 'private_ip_address': {'readonly': True}, + } + + _attribute_map = { + 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) + self.public_ip_address = None + self.private_ip_address = None + + +class ComputeInstanceCreatedBy(Model): + """Describes information on user who created this ComputeInstance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar user_name: Name of the user. + :vartype user_name: str + :ivar user_org_id: Uniquely identifies user' Azure Active Directory + organization. + :vartype user_org_id: str + :ivar user_id: Uniquely identifies the user within his/her organization. + :vartype user_id: str + """ + + _validation = { + 'user_name': {'readonly': True}, + 'user_org_id': {'readonly': True}, + 'user_id': {'readonly': True}, + } + + _attribute_map = { + 'user_name': {'key': 'userName', 'type': 'str'}, + 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, + 'user_id': {'key': 'userId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ComputeInstanceCreatedBy, self).__init__(**kwargs) + self.user_name = None + self.user_org_id = None + self.user_id = None + + +class ComputeInstanceProperties(Model): + """Compute Instance properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param vm_size: Virtual Machine Size + :type vm_size: str + :param subnet: Subnet. Virtual network subnet resource ID the compute + nodes belong to. + :type subnet: ~azure.mgmt.machinelearningservices.models.ResourceId + :param application_sharing_policy: Sharing policy for applications on this + compute instance. Policy for sharing applications on this compute instance + among users of parent workspace. If Personal, only the creator can access + applications on this compute instance. When Shared, any workspace user can + access applications on this instance depending on his/her assigned role. + Possible values include: 'Personal', 'Shared'. Default value: "Shared" . + :type application_sharing_policy: str or + ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy + :param ssh_settings: Specifies policy and settings for SSH access. + :type ssh_settings: + ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings + :ivar connectivity_endpoints: Describes all connectivity endpoints + available for this ComputeInstance. + :vartype connectivity_endpoints: + ~azure.mgmt.machinelearningservices.models.ComputeInstanceConnectivityEndpoints + :ivar applications: Describes available applications and their endpoints + on this ComputeInstance. + :vartype applications: + list[~azure.mgmt.machinelearningservices.models.ComputeInstanceApplication] + :ivar created_by: Describes information on user who created this + ComputeInstance. + :vartype created_by: + ~azure.mgmt.machinelearningservices.models.ComputeInstanceCreatedBy + :ivar errors: Errors. Collection of errors encountered on this + ComputeInstance. + :vartype errors: + list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :ivar state: The current state of this ComputeInstance. Possible values + include: 'Creating', 'CreateFailed', 'Deleting', 'Ready', 'Restarting', + 'RestartFailed', 'Running', 'SettingUp', 'Starting', 'StartFailed', + 'StopFailed', 'Stopped', 'Stopping', 'UserSettingUp', 'Unknown', + 'Unusable' + :vartype state: str or + ~azure.mgmt.machinelearningservices.models.ComputeInstanceState + """ + + _validation = { + 'connectivity_endpoints': {'readonly': True}, + 'applications': {'readonly': True}, + 'created_by': {'readonly': True}, + 'errors': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, + 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, + 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, + 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, + 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, + 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, + 'errors': {'key': 'errors', 'type': '[MachineLearningServiceError]'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ComputeInstanceProperties, self).__init__(**kwargs) + self.vm_size = kwargs.get('vm_size', None) + self.subnet = kwargs.get('subnet', None) + self.application_sharing_policy = kwargs.get('application_sharing_policy', "Shared") + self.ssh_settings = kwargs.get('ssh_settings', None) + self.connectivity_endpoints = None + self.applications = None + self.created_by = None + self.errors = None + self.state = None + + +class ComputeInstanceSshSettings(Model): + """Specifies policy and settings for SSH access. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param ssh_public_access: Access policy for SSH. State of the public SSH + port. Possible values are: Disabled - Indicates that the public ssh port + is closed on this instance. Enabled - Indicates that the public ssh port + is open and accessible according to the VNet/subnet policy if applicable. + Possible values include: 'Enabled', 'Disabled'. Default value: "Disabled" + . + :type ssh_public_access: str or + ~azure.mgmt.machinelearningservices.models.SshPublicAccess + :ivar admin_user_name: Describes the admin user name. + :vartype admin_user_name: str + :ivar ssh_port: Describes the port for connecting through SSH. + :vartype ssh_port: int + :param admin_public_key: Specifies the SSH rsa public key file as a + string. Use "ssh-keygen -t rsa -b 2048" to generate your SSH key pairs. + :type admin_public_key: str + """ + + _validation = { + 'admin_user_name': {'readonly': True}, + 'ssh_port': {'readonly': True}, + } + + _attribute_map = { + 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, + 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, + 'ssh_port': {'key': 'sshPort', 'type': 'int'}, + 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ComputeInstanceSshSettings, self).__init__(**kwargs) + self.ssh_public_access = kwargs.get('ssh_public_access', "Disabled") + self.admin_user_name = None + self.ssh_port = None + self.admin_public_key = kwargs.get('admin_public_key', None) + + class Resource(Model): """Azure Resource Manager resource envelope. @@ -1332,6 +1652,52 @@ def __init__(self, **kwargs): self.value = None +class QuotaBaseProperties(Model): + """The properties for Quota update or retrieval. + + :param id: Specifies the resource ID. + :type id: str + :param type: Specifies the resource type. + :type type: str + :param limit: Limit. The maximum permitted quota of the resource. + :type limit: long + :param unit: An enum describing the unit of quota measurement. Possible + values include: 'Count' + :type unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QuotaBaseProperties, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.type = kwargs.get('type', None) + self.limit = kwargs.get('limit', None) + self.unit = kwargs.get('unit', None) + + +class QuotaUpdateParameters(Model): + """Quota update parameters. + + :param value: The list for update quota. + :type value: + list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, + } + + def __init__(self, **kwargs): + super(QuotaUpdateParameters, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + class RegistryListCredentialsResult(Model): """RegistryListCredentialsResult. @@ -1387,6 +1753,78 @@ def __init__(self, **kwargs): self.id = kwargs.get('id', None) +class ResourceName(Model): + """The Resource Name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The name of the resource. + :vartype value: str + :ivar localized_value: The localized name of the resource. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class ResourceQuota(Model): + """The quota assigned to a resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Specifies the resource ID. + :vartype id: str + :ivar type: Specifies the resource type. + :vartype type: str + :ivar name: Name of the resource. + :vartype name: ~azure.mgmt.machinelearningservices.models.ResourceName + :ivar limit: Limit. The maximum permitted quota of the resource. + :vartype limit: long + :ivar unit: An enum describing the unit of quota measurement. Possible + values include: 'Count' + :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'limit': {'readonly': True}, + 'unit': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'ResourceName'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceQuota, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.limit = None + self.unit = None + + class ScaleSettings(Model): """scale settings for AML Compute. @@ -1507,6 +1945,82 @@ def __init__(self, **kwargs): self.version = None +class UpdateWorkspaceQuotas(Model): + """The properties for update Quota response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Specifies the resource ID. + :vartype id: str + :ivar type: Specifies the resource type. + :vartype type: str + :param limit: Limit. The maximum permitted quota of the resource. + :type limit: long + :ivar unit: An enum describing the unit of quota measurement. Possible + values include: 'Count' + :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit + :param status: Update Workspace Quota Status. Status of update workspace + quota. Possible values include: 'Undefined', 'Success', 'Failure', + 'InvalidQuotaBelowClusterMinimum', 'InvalidQuotaExceedsSubscriptionLimit', + 'InvalidVMFamilyName' + :type status: str or ~azure.mgmt.machinelearningservices.models.Status + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'unit': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UpdateWorkspaceQuotas, self).__init__(**kwargs) + self.id = None + self.type = None + self.limit = kwargs.get('limit', None) + self.unit = None + self.status = kwargs.get('status', None) + + +class UpdateWorkspaceQuotasResult(Model): + """The result of update workspace quota. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of workspace quota update result. + :vartype value: + list[~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotas] + :ivar next_link: The URI to fetch the next page of workspace quota update + result. Call ListNext() with this to fetch the next page of Workspace + Quota update result. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + class Usage(Model): """Describes AML Resource Usage. @@ -1594,7 +2108,8 @@ class UserAccountCredentials(Model): user account which can be used to SSH to nodes. :type admin_user_name: str :param admin_user_ssh_public_key: SSH public key. SSH public key of the - administrator user account. + administrator user account. This property is only supported on Linux based + clusters. :type admin_user_ssh_public_key: str :param admin_user_password: Password. Password of the administrator user account. @@ -1755,6 +2270,9 @@ class VirtualMachineSize(Model): :ivar v_cp_us: Number of vPUs. The number of vCPUs supported by the virtual machine size. :vartype v_cp_us: int + :ivar gpus: Number of gPUs. The number of gPUs supported by the virtual + machine size. + :vartype gpus: int :ivar os_vhd_size_mb: OS VHD Disk size. The OS VHD disk size, in MB, allowed by the virtual machine size. :vartype os_vhd_size_mb: int @@ -1776,6 +2294,7 @@ class VirtualMachineSize(Model): 'name': {'readonly': True}, 'family': {'readonly': True}, 'v_cp_us': {'readonly': True}, + 'gpus': {'readonly': True}, 'os_vhd_size_mb': {'readonly': True}, 'max_resource_volume_mb': {'readonly': True}, 'memory_gb': {'readonly': True}, @@ -1787,6 +2306,7 @@ class VirtualMachineSize(Model): 'name': {'key': 'name', 'type': 'str'}, 'family': {'key': 'family', 'type': 'str'}, 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, + 'gpus': {'key': 'gpus', 'type': 'int'}, 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, @@ -1799,6 +2319,7 @@ def __init__(self, **kwargs): self.name = None self.family = None self.v_cp_us = None + self.gpus = None self.os_vhd_size_mb = None self.max_resource_volume_mb = None self.memory_gb = None diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models_py3.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models_py3.py index f173a48382ad..d497c94b747e 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models_py3.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_models_py3.py @@ -17,8 +17,8 @@ class Compute(Model): """Machine Learning compute object. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AKS, AmlCompute, VirtualMachine, HDInsight, DataFactory, - Databricks, DataLakeAnalytics + sub-classes are: AKS, AmlCompute, ComputeInstance, VirtualMachine, + HDInsight, DataFactory, Databricks, DataLakeAnalytics Variables are only populated by the server, and will be ignored when sending a request. @@ -74,7 +74,7 @@ class Compute(Model): } _subtype_map = { - 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'VirtualMachine': 'VirtualMachine', 'HDInsight': 'HDInsight', 'DataFactory': 'DataFactory', 'Databricks': 'Databricks', 'DataLakeAnalytics': 'DataLakeAnalytics'} + 'compute_type': {'AKS': 'AKS', 'AmlCompute': 'AmlCompute', 'ComputeInstance': 'ComputeInstance', 'VirtualMachine': 'VirtualMachine', 'HDInsight': 'HDInsight', 'DataFactory': 'DataFactory', 'Databricks': 'Databricks', 'DataLakeAnalytics': 'DataLakeAnalytics'} } def __init__(self, *, compute_location: str=None, description: str=None, resource_id: str=None, **kwargs) -> None: @@ -383,29 +383,50 @@ class AmlComputeNodeInformation(Model): :ivar node_id: Node ID. ID of the compute node. :vartype node_id: str - :ivar ip_address: IP address. Public IP address of the compute node. - :vartype ip_address: str + :ivar private_ip_address: Private IP address. Private IP address of the + compute node. + :vartype private_ip_address: str + :ivar public_ip_address: Public IP address. Public IP address of the + compute node. + :vartype public_ip_address: str :ivar port: Port. SSH port number of the node. :vartype port: float + :ivar node_state: State of the compute node. Values are idle, running, + preparing, unusable, leaving and preempted. Possible values include: + 'idle', 'running', 'preparing', 'unusable', 'leaving', 'preempted' + :vartype node_state: str or + ~azure.mgmt.machinelearningservices.models.NodeState + :ivar run_id: Run ID. ID of the Experiment running on the node, if any + else null. + :vartype run_id: str """ _validation = { 'node_id': {'readonly': True}, - 'ip_address': {'readonly': True}, + 'private_ip_address': {'readonly': True}, + 'public_ip_address': {'readonly': True}, 'port': {'readonly': True}, + 'node_state': {'readonly': True}, + 'run_id': {'readonly': True}, } _attribute_map = { 'node_id': {'key': 'nodeId', 'type': 'str'}, - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, 'port': {'key': 'port', 'type': 'float'}, + 'node_state': {'key': 'nodeState', 'type': 'str'}, + 'run_id': {'key': 'runId', 'type': 'str'}, } def __init__(self, **kwargs) -> None: super(AmlComputeNodeInformation, self).__init__(**kwargs) self.node_id = None - self.ip_address = None + self.private_ip_address = None + self.public_ip_address = None self.port = None + self.node_state = None + self.run_id = None class ComputeNodesInformation(Model): @@ -493,6 +514,16 @@ class AmlComputeProperties(Model): 'Dedicated', 'LowPriority' :type vm_priority: str or ~azure.mgmt.machinelearningservices.models.VmPriority + :param os_type: OS Type. Possible values include: 'Linux', 'Windows'. + Default value: "Linux" . + :type os_type: str or ~azure.mgmt.machinelearningservices.models.OsType + :param virtual_machine_image: Custom VM image. The ARM resource identifier + of the virtual machine image for the compute nodes. This is of the form + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{gallery + name}/images/{image definition name}/versions/{version id}. The virtual + machine image must be in the same region and subscription as the cluster. + :type virtual_machine_image: + ~azure.mgmt.machinelearningservices.models.ResourceId :param scale_settings: Scale settings for AML Compute :type scale_settings: ~azure.mgmt.machinelearningservices.models.ScaleSettings @@ -503,6 +534,17 @@ class AmlComputeProperties(Model): :param subnet: Subnet. Virtual network subnet resource ID the compute nodes belong to. :type subnet: ~azure.mgmt.machinelearningservices.models.ResourceId + :param remote_login_port_public_access: Close remote Login Access Port. + State of the public SSH port. Possible values are: Disabled - Indicates + that the public ssh port is closed on all nodes of the cluster. Enabled - + Indicates that the public ssh port is open on all nodes of the cluster. + NotSpecified - Indicates that the public ssh port is closed on all nodes + of the cluster if VNet is defined, else is open all public nodes. It can + be default only during cluster creation time, after creation it will be + either enabled or disabled. Possible values include: 'Enabled', + 'Disabled', 'NotSpecified'. Default value: "NotSpecified" . + :type remote_login_port_public_access: str or + ~azure.mgmt.machinelearningservices.models.RemoteLoginPortPublicAccess :ivar allocation_state: Allocation state. Allocation state of the compute. Possible values are: steady - Indicates that the compute is not resizing. There are no changes to the number of compute nodes in the compute in @@ -547,9 +589,12 @@ class AmlComputeProperties(Model): _attribute_map = { 'vm_size': {'key': 'vmSize', 'type': 'str'}, 'vm_priority': {'key': 'vmPriority', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'virtual_machine_image': {'key': 'virtualMachineImage', 'type': 'ResourceId'}, 'scale_settings': {'key': 'scaleSettings', 'type': 'ScaleSettings'}, 'user_account_credentials': {'key': 'userAccountCredentials', 'type': 'UserAccountCredentials'}, 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, + 'remote_login_port_public_access': {'key': 'remoteLoginPortPublicAccess', 'type': 'str'}, 'allocation_state': {'key': 'allocationState', 'type': 'str'}, 'allocation_state_transition_time': {'key': 'allocationStateTransitionTime', 'type': 'iso-8601'}, 'errors': {'key': 'errors', 'type': '[MachineLearningServiceError]'}, @@ -558,13 +603,16 @@ class AmlComputeProperties(Model): 'node_state_counts': {'key': 'nodeStateCounts', 'type': 'NodeStateCounts'}, } - def __init__(self, *, vm_size: str=None, vm_priority=None, scale_settings=None, user_account_credentials=None, subnet=None, **kwargs) -> None: + def __init__(self, *, vm_size: str=None, vm_priority=None, os_type="Linux", virtual_machine_image=None, scale_settings=None, user_account_credentials=None, subnet=None, remote_login_port_public_access="NotSpecified", **kwargs) -> None: super(AmlComputeProperties, self).__init__(**kwargs) self.vm_size = vm_size self.vm_priority = vm_priority + self.os_type = os_type + self.virtual_machine_image = virtual_machine_image self.scale_settings = scale_settings self.user_account_credentials = user_account_credentials self.subnet = subnet + self.remote_login_port_public_access = remote_login_port_public_access self.allocation_state = None self.allocation_state_transition_time = None self.errors = None @@ -599,6 +647,278 @@ def __init__(self, *, scale_settings=None, **kwargs) -> None: self.scale_settings = scale_settings +class ComputeInstance(Compute): + """An Azure Machine Learning compute instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param compute_location: Location for the underlying compute + :type compute_location: str + :ivar provisioning_state: The provision state of the cluster. Valid values + are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible + values include: 'Unknown', 'Updating', 'Creating', 'Deleting', + 'Succeeded', 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.machinelearningservices.models.ProvisioningState + :param description: The description of the Machine Learning compute. + :type description: str + :ivar created_on: The date and time when the compute was created. + :vartype created_on: datetime + :ivar modified_on: The date and time when the compute was last modified. + :vartype modified_on: datetime + :param resource_id: ARM resource id of the underlying compute + :type resource_id: str + :ivar provisioning_errors: Errors during provisioning + :vartype provisioning_errors: + list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :ivar is_attached_compute: Indicating whether the compute was provisioned + by user and brought from outside if true, or machine learning service + provisioned it if false. + :vartype is_attached_compute: bool + :param compute_type: Required. Constant filled by server. + :type compute_type: str + :param properties: Compute Instance properties + :type properties: + ~azure.mgmt.machinelearningservices.models.ComputeInstanceProperties + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'created_on': {'readonly': True}, + 'modified_on': {'readonly': True}, + 'provisioning_errors': {'readonly': True}, + 'is_attached_compute': {'readonly': True}, + 'compute_type': {'required': True}, + } + + _attribute_map = { + 'compute_location': {'key': 'computeLocation', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, + 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'provisioning_errors': {'key': 'provisioningErrors', 'type': '[MachineLearningServiceError]'}, + 'is_attached_compute': {'key': 'isAttachedCompute', 'type': 'bool'}, + 'compute_type': {'key': 'computeType', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ComputeInstanceProperties'}, + } + + def __init__(self, *, compute_location: str=None, description: str=None, resource_id: str=None, properties=None, **kwargs) -> None: + super(ComputeInstance, self).__init__(compute_location=compute_location, description=description, resource_id=resource_id, **kwargs) + self.properties = properties + self.compute_type = 'ComputeInstance' + + +class ComputeInstanceApplication(Model): + """Defines an Aml Instance application and its connectivity endpoint URI. + + :param display_name: Name of the ComputeInstance application. + :type display_name: str + :param endpoint_uri: Application' endpoint URI. + :type endpoint_uri: str + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'endpoint_uri': {'key': 'endpointUri', 'type': 'str'}, + } + + def __init__(self, *, display_name: str=None, endpoint_uri: str=None, **kwargs) -> None: + super(ComputeInstanceApplication, self).__init__(**kwargs) + self.display_name = display_name + self.endpoint_uri = endpoint_uri + + +class ComputeInstanceConnectivityEndpoints(Model): + """Defines all connectivity endpoints and properties for an ComputeInstance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar public_ip_address: Public IP Address of this ComputeInstance. + :vartype public_ip_address: str + :ivar private_ip_address: Private IP Address of this ComputeInstance + (local to the VNET in which the compute instance is deployed). + :vartype private_ip_address: str + """ + + _validation = { + 'public_ip_address': {'readonly': True}, + 'private_ip_address': {'readonly': True}, + } + + _attribute_map = { + 'public_ip_address': {'key': 'publicIpAddress', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ComputeInstanceConnectivityEndpoints, self).__init__(**kwargs) + self.public_ip_address = None + self.private_ip_address = None + + +class ComputeInstanceCreatedBy(Model): + """Describes information on user who created this ComputeInstance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar user_name: Name of the user. + :vartype user_name: str + :ivar user_org_id: Uniquely identifies user' Azure Active Directory + organization. + :vartype user_org_id: str + :ivar user_id: Uniquely identifies the user within his/her organization. + :vartype user_id: str + """ + + _validation = { + 'user_name': {'readonly': True}, + 'user_org_id': {'readonly': True}, + 'user_id': {'readonly': True}, + } + + _attribute_map = { + 'user_name': {'key': 'userName', 'type': 'str'}, + 'user_org_id': {'key': 'userOrgId', 'type': 'str'}, + 'user_id': {'key': 'userId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ComputeInstanceCreatedBy, self).__init__(**kwargs) + self.user_name = None + self.user_org_id = None + self.user_id = None + + +class ComputeInstanceProperties(Model): + """Compute Instance properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param vm_size: Virtual Machine Size + :type vm_size: str + :param subnet: Subnet. Virtual network subnet resource ID the compute + nodes belong to. + :type subnet: ~azure.mgmt.machinelearningservices.models.ResourceId + :param application_sharing_policy: Sharing policy for applications on this + compute instance. Policy for sharing applications on this compute instance + among users of parent workspace. If Personal, only the creator can access + applications on this compute instance. When Shared, any workspace user can + access applications on this instance depending on his/her assigned role. + Possible values include: 'Personal', 'Shared'. Default value: "Shared" . + :type application_sharing_policy: str or + ~azure.mgmt.machinelearningservices.models.ApplicationSharingPolicy + :param ssh_settings: Specifies policy and settings for SSH access. + :type ssh_settings: + ~azure.mgmt.machinelearningservices.models.ComputeInstanceSshSettings + :ivar connectivity_endpoints: Describes all connectivity endpoints + available for this ComputeInstance. + :vartype connectivity_endpoints: + ~azure.mgmt.machinelearningservices.models.ComputeInstanceConnectivityEndpoints + :ivar applications: Describes available applications and their endpoints + on this ComputeInstance. + :vartype applications: + list[~azure.mgmt.machinelearningservices.models.ComputeInstanceApplication] + :ivar created_by: Describes information on user who created this + ComputeInstance. + :vartype created_by: + ~azure.mgmt.machinelearningservices.models.ComputeInstanceCreatedBy + :ivar errors: Errors. Collection of errors encountered on this + ComputeInstance. + :vartype errors: + list[~azure.mgmt.machinelearningservices.models.MachineLearningServiceError] + :ivar state: The current state of this ComputeInstance. Possible values + include: 'Creating', 'CreateFailed', 'Deleting', 'Ready', 'Restarting', + 'RestartFailed', 'Running', 'SettingUp', 'Starting', 'StartFailed', + 'StopFailed', 'Stopped', 'Stopping', 'UserSettingUp', 'Unknown', + 'Unusable' + :vartype state: str or + ~azure.mgmt.machinelearningservices.models.ComputeInstanceState + """ + + _validation = { + 'connectivity_endpoints': {'readonly': True}, + 'applications': {'readonly': True}, + 'created_by': {'readonly': True}, + 'errors': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'ResourceId'}, + 'application_sharing_policy': {'key': 'applicationSharingPolicy', 'type': 'str'}, + 'ssh_settings': {'key': 'sshSettings', 'type': 'ComputeInstanceSshSettings'}, + 'connectivity_endpoints': {'key': 'connectivityEndpoints', 'type': 'ComputeInstanceConnectivityEndpoints'}, + 'applications': {'key': 'applications', 'type': '[ComputeInstanceApplication]'}, + 'created_by': {'key': 'createdBy', 'type': 'ComputeInstanceCreatedBy'}, + 'errors': {'key': 'errors', 'type': '[MachineLearningServiceError]'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, *, vm_size: str=None, subnet=None, application_sharing_policy="Shared", ssh_settings=None, **kwargs) -> None: + super(ComputeInstanceProperties, self).__init__(**kwargs) + self.vm_size = vm_size + self.subnet = subnet + self.application_sharing_policy = application_sharing_policy + self.ssh_settings = ssh_settings + self.connectivity_endpoints = None + self.applications = None + self.created_by = None + self.errors = None + self.state = None + + +class ComputeInstanceSshSettings(Model): + """Specifies policy and settings for SSH access. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param ssh_public_access: Access policy for SSH. State of the public SSH + port. Possible values are: Disabled - Indicates that the public ssh port + is closed on this instance. Enabled - Indicates that the public ssh port + is open and accessible according to the VNet/subnet policy if applicable. + Possible values include: 'Enabled', 'Disabled'. Default value: "Disabled" + . + :type ssh_public_access: str or + ~azure.mgmt.machinelearningservices.models.SshPublicAccess + :ivar admin_user_name: Describes the admin user name. + :vartype admin_user_name: str + :ivar ssh_port: Describes the port for connecting through SSH. + :vartype ssh_port: int + :param admin_public_key: Specifies the SSH rsa public key file as a + string. Use "ssh-keygen -t rsa -b 2048" to generate your SSH key pairs. + :type admin_public_key: str + """ + + _validation = { + 'admin_user_name': {'readonly': True}, + 'ssh_port': {'readonly': True}, + } + + _attribute_map = { + 'ssh_public_access': {'key': 'sshPublicAccess', 'type': 'str'}, + 'admin_user_name': {'key': 'adminUserName', 'type': 'str'}, + 'ssh_port': {'key': 'sshPort', 'type': 'int'}, + 'admin_public_key': {'key': 'adminPublicKey', 'type': 'str'}, + } + + def __init__(self, *, ssh_public_access="Disabled", admin_public_key: str=None, **kwargs) -> None: + super(ComputeInstanceSshSettings, self).__init__(**kwargs) + self.ssh_public_access = ssh_public_access + self.admin_user_name = None + self.ssh_port = None + self.admin_public_key = admin_public_key + + class Resource(Model): """Azure Resource Manager resource envelope. @@ -1332,6 +1652,52 @@ def __init__(self, **kwargs) -> None: self.value = None +class QuotaBaseProperties(Model): + """The properties for Quota update or retrieval. + + :param id: Specifies the resource ID. + :type id: str + :param type: Specifies the resource type. + :type type: str + :param limit: Limit. The maximum permitted quota of the resource. + :type limit: long + :param unit: An enum describing the unit of quota measurement. Possible + values include: 'Count' + :type unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, type: str=None, limit: int=None, unit=None, **kwargs) -> None: + super(QuotaBaseProperties, self).__init__(**kwargs) + self.id = id + self.type = type + self.limit = limit + self.unit = unit + + +class QuotaUpdateParameters(Model): + """Quota update parameters. + + :param value: The list for update quota. + :type value: + list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[QuotaBaseProperties]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(QuotaUpdateParameters, self).__init__(**kwargs) + self.value = value + + class RegistryListCredentialsResult(Model): """RegistryListCredentialsResult. @@ -1387,6 +1753,78 @@ def __init__(self, *, id: str, **kwargs) -> None: self.id = id +class ResourceName(Model): + """The Resource Name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The name of the resource. + :vartype value: str + :ivar localized_value: The localized name of the resource. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class ResourceQuota(Model): + """The quota assigned to a resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Specifies the resource ID. + :vartype id: str + :ivar type: Specifies the resource type. + :vartype type: str + :ivar name: Name of the resource. + :vartype name: ~azure.mgmt.machinelearningservices.models.ResourceName + :ivar limit: Limit. The maximum permitted quota of the resource. + :vartype limit: long + :ivar unit: An enum describing the unit of quota measurement. Possible + values include: 'Count' + :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'limit': {'readonly': True}, + 'unit': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'ResourceName'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceQuota, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.limit = None + self.unit = None + + class ScaleSettings(Model): """scale settings for AML Compute. @@ -1507,6 +1945,82 @@ def __init__(self, **kwargs) -> None: self.version = None +class UpdateWorkspaceQuotas(Model): + """The properties for update Quota response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Specifies the resource ID. + :vartype id: str + :ivar type: Specifies the resource type. + :vartype type: str + :param limit: Limit. The maximum permitted quota of the resource. + :type limit: long + :ivar unit: An enum describing the unit of quota measurement. Possible + values include: 'Count' + :vartype unit: str or ~azure.mgmt.machinelearningservices.models.QuotaUnit + :param status: Update Workspace Quota Status. Status of update workspace + quota. Possible values include: 'Undefined', 'Success', 'Failure', + 'InvalidQuotaBelowClusterMinimum', 'InvalidQuotaExceedsSubscriptionLimit', + 'InvalidVMFamilyName' + :type status: str or ~azure.mgmt.machinelearningservices.models.Status + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'unit': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, limit: int=None, status=None, **kwargs) -> None: + super(UpdateWorkspaceQuotas, self).__init__(**kwargs) + self.id = None + self.type = None + self.limit = limit + self.unit = None + self.status = status + + +class UpdateWorkspaceQuotasResult(Model): + """The result of update workspace quota. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of workspace quota update result. + :vartype value: + list[~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotas] + :ivar next_link: The URI to fetch the next page of workspace quota update + result. Call ListNext() with this to fetch the next page of Workspace + Quota update result. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[UpdateWorkspaceQuotas]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UpdateWorkspaceQuotasResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + class Usage(Model): """Describes AML Resource Usage. @@ -1594,7 +2108,8 @@ class UserAccountCredentials(Model): user account which can be used to SSH to nodes. :type admin_user_name: str :param admin_user_ssh_public_key: SSH public key. SSH public key of the - administrator user account. + administrator user account. This property is only supported on Linux based + clusters. :type admin_user_ssh_public_key: str :param admin_user_password: Password. Password of the administrator user account. @@ -1755,6 +2270,9 @@ class VirtualMachineSize(Model): :ivar v_cp_us: Number of vPUs. The number of vCPUs supported by the virtual machine size. :vartype v_cp_us: int + :ivar gpus: Number of gPUs. The number of gPUs supported by the virtual + machine size. + :vartype gpus: int :ivar os_vhd_size_mb: OS VHD Disk size. The OS VHD disk size, in MB, allowed by the virtual machine size. :vartype os_vhd_size_mb: int @@ -1776,6 +2294,7 @@ class VirtualMachineSize(Model): 'name': {'readonly': True}, 'family': {'readonly': True}, 'v_cp_us': {'readonly': True}, + 'gpus': {'readonly': True}, 'os_vhd_size_mb': {'readonly': True}, 'max_resource_volume_mb': {'readonly': True}, 'memory_gb': {'readonly': True}, @@ -1787,6 +2306,7 @@ class VirtualMachineSize(Model): 'name': {'key': 'name', 'type': 'str'}, 'family': {'key': 'family', 'type': 'str'}, 'v_cp_us': {'key': 'vCPUs', 'type': 'int'}, + 'gpus': {'key': 'gpus', 'type': 'int'}, 'os_vhd_size_mb': {'key': 'osVhdSizeMB', 'type': 'int'}, 'max_resource_volume_mb': {'key': 'maxResourceVolumeMB', 'type': 'int'}, 'memory_gb': {'key': 'memoryGB', 'type': 'float'}, @@ -1799,6 +2319,7 @@ def __init__(self, **kwargs) -> None: self.name = None self.family = None self.v_cp_us = None + self.gpus = None self.os_vhd_size_mb = None self.max_resource_volume_mb = None self.memory_gb = None diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_paged_models.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_paged_models.py index 9bc3567bbf90..74e8ea061e06 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_paged_models.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_paged_models.py @@ -51,6 +51,19 @@ class UsagePaged(Paged): def __init__(self, *args, **kwargs): super(UsagePaged, self).__init__(*args, **kwargs) +class ResourceQuotaPaged(Paged): + """ + A paging container for iterating over a list of :class:`ResourceQuota ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ResourceQuota]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourceQuotaPaged, self).__init__(*args, **kwargs) class ComputeResourcePaged(Paged): """ A paging container for iterating over a list of :class:`ComputeResource ` object diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/__init__.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/__init__.py index 4daae17a67dd..7627c147659c 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/__init__.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/__init__.py @@ -13,6 +13,7 @@ from ._workspaces_operations import WorkspacesOperations from ._usages_operations import UsagesOperations from ._virtual_machine_sizes_operations import VirtualMachineSizesOperations +from ._quotas_operations import QuotasOperations from ._machine_learning_compute_operations import MachineLearningComputeOperations __all__ = [ @@ -20,5 +21,6 @@ 'WorkspacesOperations', 'UsagesOperations', 'VirtualMachineSizesOperations', + 'QuotasOperations', 'MachineLearningComputeOperations', ] diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_machine_learning_compute_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_machine_learning_compute_operations.py index 203b86e19b28..6756a8bc068d 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_machine_learning_compute_operations.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_machine_learning_compute_operations.py @@ -26,7 +26,7 @@ class MachineLearningComputeOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2019-05-01". + :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2019-11-01". """ models = models @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01" + self.api_version = "2019-11-01" self.config = config @@ -641,3 +641,195 @@ def list_keys( return deserialized list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys'} + + def start( + self, resource_group_name, workspace_name, compute_name, custom_headers=None, raw=False, **operation_config): + """Posts a start action to a compute instance. + + :param resource_group_name: Name of the resource group in which + workspace is located. + :type resource_group_name: str + :param workspace_name: Name of Azure Machine Learning workspace. + :type workspace_name: str + :param compute_name: Name of the Azure Machine Learning compute. + :type compute_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: ComputeResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`MachineLearningServiceErrorException` + """ + # Construct URL + url = self.start.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'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_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.MachineLearningServiceErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ComputeResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start'} + + def stop( + self, resource_group_name, workspace_name, compute_name, custom_headers=None, raw=False, **operation_config): + """Posts a stop action to a compute instance. + + :param resource_group_name: Name of the resource group in which + workspace is located. + :type resource_group_name: str + :param workspace_name: Name of Azure Machine Learning workspace. + :type workspace_name: str + :param compute_name: Name of the Azure Machine Learning compute. + :type compute_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: ComputeResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`MachineLearningServiceErrorException` + """ + # Construct URL + url = self.stop.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'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_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.MachineLearningServiceErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ComputeResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop'} + + def restart( + self, resource_group_name, workspace_name, compute_name, custom_headers=None, raw=False, **operation_config): + """Posts a restart action to a compute instance. + + :param resource_group_name: Name of the resource group in which + workspace is located. + :type resource_group_name: str + :param workspace_name: Name of Azure Machine Learning workspace. + :type workspace_name: str + :param compute_name: Name of the Azure Machine Learning compute. + :type compute_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: ComputeResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.machinelearningservices.models.ComputeResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`MachineLearningServiceErrorException` + """ + # Construct URL + url = self.restart.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'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'computeName': self._serialize.url("compute_name", compute_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.MachineLearningServiceErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ComputeResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart'} diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_operations.py index 7b558ec9d645..444e6ddec582 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_operations.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_operations.py @@ -24,7 +24,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2019-05-01". + :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2019-11-01". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01" + self.api_version = "2019-11-01" self.config = config diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_quotas_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_quotas_operations.py new file mode 100644 index 000000000000..f3998dff7a77 --- /dev/null +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_quotas_operations.py @@ -0,0 +1,176 @@ +# 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 msrestazure.azure_exceptions import CloudError + +from .. import models + + +class QuotasOperations(object): + """QuotasOperations 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: Version of Azure Machine Learning resource provider API. Constant value: "2019-11-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-11-01" + + self.config = config + + def update( + self, location, value=None, custom_headers=None, raw=False, **operation_config): + """Update quota for each VM family in workspace. + + :param location: The location for update quota is queried. + :type location: str + :param value: The list for update quota. + :type value: + list[~azure.mgmt.machinelearningservices.models.QuotaBaseProperties] + :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: UpdateWorkspaceQuotasResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.machinelearningservices.models.UpdateWorkspaceQuotasResult + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`MachineLearningServiceErrorException` + """ + parameters = models.QuotaUpdateParameters(value=value) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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' + 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(parameters, 'QuotaUpdateParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.MachineLearningServiceErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('UpdateWorkspaceQuotasResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas'} + + def list( + self, location, custom_headers=None, raw=False, **operation_config): + """Gets the currently assigned Workspace Quotas based on VMFamily. + + :param location: The location for which resource usage is queried. + :type location: 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 ResourceQuota + :rtype: + ~azure.mgmt.machinelearningservices.models.ResourceQuotaPaged[~azure.mgmt.machinelearningservices.models.ResourceQuota] + :raises: :class:`CloudError` + """ + 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'), + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$') + } + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ResourceQuotaPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/Quotas'} diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_usages_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_usages_operations.py index 212fbc700f27..9ee4dd6d72d9 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_usages_operations.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_usages_operations.py @@ -25,7 +25,7 @@ class UsagesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2019-05-01". + :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2019-11-01". """ models = models @@ -35,17 +35,20 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01" + self.api_version = "2019-11-01" self.config = config def list( - self, location, custom_headers=None, raw=False, **operation_config): + self, location, expand_children=None, custom_headers=None, raw=False, **operation_config): """Gets the current usage information as well as limits for AML resources for given subscription and location. :param location: The location for which resource usage is queried. :type location: str + :param expand_children: Specifies if detailed usages of child + resources are required. + :type expand_children: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -69,6 +72,8 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand_children is not None: + query_parameters['expandChildren'] = self._serialize.query("expand_children", expand_children, 'str') else: url = next_link diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_virtual_machine_sizes_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_virtual_machine_sizes_operations.py index afbf3b4fc0b4..a7a39b62254e 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_virtual_machine_sizes_operations.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_virtual_machine_sizes_operations.py @@ -25,7 +25,7 @@ class VirtualMachineSizesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2019-05-01". + :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2019-11-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01" + self.api_version = "2019-11-01" self.config = config diff --git a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_workspaces_operations.py b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_workspaces_operations.py index 27bff19114d8..30b9e42a3ca9 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_workspaces_operations.py +++ b/sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/operations/_workspaces_operations.py @@ -24,7 +24,7 @@ class WorkspacesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2019-05-01". + :ivar api_version: Version of Azure Machine Learning resource provider API. Constant value: "2019-11-01". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01" + self.api_version = "2019-11-01" self.config = config