diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/CHANGELOG.md b/sdk/hybridcompute/azure-mgmt-hybridcompute/CHANGELOG.md index 37db44da1bfd..f58073f4c4cb 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/CHANGELOG.md +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/CHANGELOG.md @@ -1,5 +1,31 @@ # Release History +## 1.0.0 (2020-08-19) + +**Features** + + - Model Machine has a new parameter principal_id + - Model Machine has a new parameter physical_location + - Model Machine has a new parameter type1 + - Model Machine has a new parameter tenant_id + - Model Resource has a new parameter principal_id + - Model Resource has a new parameter tenant_id + - Model Resource has a new parameter type1 + - Model Resource has a new parameter tags + - Model MachineExtension has a new parameter principal_id + - Model MachineExtension has a new parameter type1 + - Model MachineExtension has a new parameter tenant_id + - Model MachineUpdate has a new parameter physical_location + +**Breaking changes** + + - Model Machine no longer has parameter identity + - Model Machine no longer has parameter location_data + - Model Resource has a new required parameter location + - Model MachineUpdate no longer has parameter location_data + - Model ErrorResponse has a new signature + - Removed operation group MachineExtensionsOperations + ## 0.1.1 (2019-10-30) - Update project description and title diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_configuration.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_configuration.py index 869afbc539a9..9824848cd33b 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_configuration.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_configuration.py @@ -21,9 +21,7 @@ class HybridComputeManagementClientConfiguration(AzureConfiguration): :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_hybrid_compute_management_client.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_hybrid_compute_management_client.py index 7147e25951fc..b85a1ddb5ea2 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_hybrid_compute_management_client.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/_hybrid_compute_management_client.py @@ -14,6 +14,7 @@ from ._configuration import HybridComputeManagementClientConfiguration from .operations import MachinesOperations +from .operations import MachineExtensionsOperations from .operations import Operations from . import models @@ -26,15 +27,15 @@ class HybridComputeManagementClient(SDKClient): :ivar machines: Machines operations :vartype machines: azure.mgmt.hybridcompute.operations.MachinesOperations + :ivar machine_extensions: MachineExtensions operations + :vartype machine_extensions: azure.mgmt.hybridcompute.operations.MachineExtensionsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.hybridcompute.operations.Operations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -46,11 +47,13 @@ def __init__( super(HybridComputeManagementClient, 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-08-02-preview' + self.api_version = '2019-12-12' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.machines = MachinesOperations( self._client, self.config, self._serialize, self._deserialize) + self.machine_extensions = MachineExtensionsOperations( + self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/__init__.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/__init__.py index ae3c3c690315..9b6b3fe31865 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/__init__.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/__init__.py @@ -10,61 +10,127 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import AzureEntityResource + from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import Identity + from ._models_py3 import LocationData from ._models_py3 import Machine from ._models_py3 import MachineExtension from ._models_py3 import MachineExtensionInstanceView from ._models_py3 import MachineExtensionInstanceViewStatus - from ._models_py3 import MachineExtensionsListResult + from ._models_py3 import MachineExtensionPropertiesInstanceView + from ._models_py3 import MachineExtensionPropertiesModel from ._models_py3 import MachineExtensionUpdate + from ._models_py3 import MachineExtensionUpdatePropertiesModel + from ._models_py3 import MachineIdentity + from ._models_py3 import MachineProperties + from ._models_py3 import MachinePropertiesOsProfile from ._models_py3 import MachineReconnect + from ._models_py3 import MachineReconnectProperties from ._models_py3 import MachineUpdate + from ._models_py3 import MachineUpdateProperties from ._models_py3 import OperationValue + from ._models_py3 import OperationValueDisplayModel from ._models_py3 import OSProfile + from ._models_py3 import Plan + from ._models_py3 import ProxyResource from ._models_py3 import Resource + from ._models_py3 import ResourceModelWithAllowedPropertySet + from ._models_py3 import ResourceModelWithAllowedPropertySetIdentity + from ._models_py3 import ResourceModelWithAllowedPropertySetPlan + from ._models_py3 import ResourceModelWithAllowedPropertySetSku + from ._models_py3 import Sku + from ._models_py3 import TrackedResource from ._models_py3 import UpdateResource except (SyntaxError, ImportError): + from ._models import AzureEntityResource + from ._models import ErrorAdditionalInfo from ._models import ErrorDetail from ._models import ErrorResponse, ErrorResponseException + from ._models import Identity + from ._models import LocationData from ._models import Machine from ._models import MachineExtension from ._models import MachineExtensionInstanceView from ._models import MachineExtensionInstanceViewStatus - from ._models import MachineExtensionsListResult + from ._models import MachineExtensionPropertiesInstanceView + from ._models import MachineExtensionPropertiesModel from ._models import MachineExtensionUpdate + from ._models import MachineExtensionUpdatePropertiesModel + from ._models import MachineIdentity + from ._models import MachineProperties + from ._models import MachinePropertiesOsProfile from ._models import MachineReconnect + from ._models import MachineReconnectProperties from ._models import MachineUpdate + from ._models import MachineUpdateProperties from ._models import OperationValue + from ._models import OperationValueDisplayModel from ._models import OSProfile + from ._models import Plan + from ._models import ProxyResource from ._models import Resource + from ._models import ResourceModelWithAllowedPropertySet + from ._models import ResourceModelWithAllowedPropertySetIdentity + from ._models import ResourceModelWithAllowedPropertySetPlan + from ._models import ResourceModelWithAllowedPropertySetSku + from ._models import Sku + from ._models import TrackedResource from ._models import UpdateResource +from ._paged_models import MachineExtensionPaged from ._paged_models import MachinePaged from ._paged_models import OperationValuePaged from ._hybrid_compute_management_client_enums import ( StatusTypes, StatusLevelTypes, + SkuTier, + ResourceIdentityType, InstanceViewTypes, ) __all__ = [ + 'AzureEntityResource', + 'ErrorAdditionalInfo', 'ErrorDetail', 'ErrorResponse', 'ErrorResponseException', + 'Identity', + 'LocationData', 'Machine', 'MachineExtension', 'MachineExtensionInstanceView', 'MachineExtensionInstanceViewStatus', - 'MachineExtensionsListResult', + 'MachineExtensionPropertiesInstanceView', + 'MachineExtensionPropertiesModel', 'MachineExtensionUpdate', + 'MachineExtensionUpdatePropertiesModel', + 'MachineIdentity', + 'MachineProperties', + 'MachinePropertiesOsProfile', 'MachineReconnect', + 'MachineReconnectProperties', 'MachineUpdate', + 'MachineUpdateProperties', 'OperationValue', + 'OperationValueDisplayModel', 'OSProfile', + 'Plan', + 'ProxyResource', 'Resource', + 'ResourceModelWithAllowedPropertySet', + 'ResourceModelWithAllowedPropertySetIdentity', + 'ResourceModelWithAllowedPropertySetPlan', + 'ResourceModelWithAllowedPropertySetSku', + 'Sku', + 'TrackedResource', 'UpdateResource', 'MachinePaged', + 'MachineExtensionPaged', 'OperationValuePaged', 'StatusTypes', 'StatusLevelTypes', + 'SkuTier', + 'ResourceIdentityType', 'InstanceViewTypes', ] diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_hybrid_compute_management_client_enums.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_hybrid_compute_management_client_enums.py index 3abdca4c61f1..ef4aaa4ef87b 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_hybrid_compute_management_client_enums.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_hybrid_compute_management_client_enums.py @@ -26,6 +26,19 @@ class StatusLevelTypes(str, Enum): error = "Error" +class SkuTier(str, Enum): + + free = "Free" + basic = "Basic" + standard = "Standard" + premium = "Premium" + + +class ResourceIdentityType(str, Enum): + + system_assigned = "SystemAssigned" + + class InstanceViewTypes(str, Enum): instance_view = "instanceView" diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models.py index 29b83876105d..de392b1ebe36 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models.py @@ -13,6 +13,79 @@ from msrest.exceptions import HttpOperationError +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + class CloudError(Model): """CloudError. """ @@ -21,6 +94,34 @@ class CloudError(Model): } +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + class ErrorDetail(Model): """Error details. @@ -58,27 +159,47 @@ def __init__(self, **kwargs): class ErrorResponse(Model): - """Error response. + """The resource management error response. - Contains details when the response code indicates an error. - - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when + sending a request. - :param error: Required. The error details. - :type error: ~azure.mgmt.hybridcompute.models.ErrorDetail + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.hybridcompute.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.hybridcompute.models.ErrorAdditionalInfo] """ _validation = { - 'error': {'required': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } def __init__(self, **kwargs): super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None class ErrorResponseException(HttpOperationError): @@ -93,30 +214,95 @@ def __init__(self, deserialize, response, *args): super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) -class Resource(Model): - """The Resource model definition. +class Identity(Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. Possible values include: 'SystemAssigned' + :type type: str or ~azure.mgmt.hybridcompute.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + + +class LocationData(Model): + """Metadata pertaining to the geographic location of the resource. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. A canonical name for the geographic or physical + location. + :type name: str + :param city: The city or locality where the resource is located. + :type city: str + :param district: The district, state, or province where the resource is + located. + :type district: str + :param country_or_region: The country or region where the resource is + located + :type country_or_region: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 256}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'district': {'key': 'district', 'type': 'str'}, + 'country_or_region': {'key': 'countryOrRegion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LocationData, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.city = kwargs.get('city', None) + self.district = kwargs.get('district', None) + self.country_or_region = kwargs.get('country_or_region', None) + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level 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: Resource Id + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str - :ivar name: Resource name + :ivar name: The name of the resource :vartype name: str - :ivar type: Resource type + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str - :param location: Required. Resource location - :type location: str - :param tags: Resource tags + :param tags: Resource tags. :type tags: dict[str, str] - :param type1: The identity type. - :type type1: str - :ivar principal_id: The identity's principal id. - :vartype principal_id: str - :ivar tenant_id: The identity's tenant id. - :vartype tenant_id: str + :param location: Required. The geo-location where the resource lives + :type location: str """ _validation = { @@ -124,34 +310,23 @@ class Resource(Model): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'principal_id': {'readonly': True}, - 'tenant_id': {'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}'}, - 'type1': {'key': 'identity.type', 'type': 'str'}, - 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, - 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'location': {'key': 'location', '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) + super(TrackedResource, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) - self.type1 = kwargs.get('type1', None) - self.principal_id = None - self.tenant_id = None + self.location = kwargs.get('location', None) -class Machine(Resource): +class Machine(TrackedResource): """Describes a hybrid machine. Variables are only populated by the server, and will be ignored when @@ -159,25 +334,24 @@ class Machine(Resource): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str - :ivar name: Resource name + :ivar name: The name of the resource :vartype name: str - :ivar type: Resource type + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str - :param location: Required. Resource location - :type location: str - :param tags: Resource tags + :param tags: Resource tags. :type tags: dict[str, str] - :param type1: The identity type. - :type type1: str - :ivar principal_id: The identity's principal id. - :vartype principal_id: str - :ivar tenant_id: The identity's tenant id. - :vartype tenant_id: str + :param location: Required. The geo-location where the resource lives + :type location: str + :param location_data: + :type location_data: ~azure.mgmt.hybridcompute.models.LocationData :param os_profile: Specifies the operating system settings for the hybrid machine. - :type os_profile: ~azure.mgmt.hybridcompute.models.OSProfile + :type os_profile: + ~azure.mgmt.hybridcompute.models.MachinePropertiesOsProfile :ivar provisioning_state: The provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -190,14 +364,12 @@ class Machine(Resource): :vartype error_details: list[~azure.mgmt.hybridcompute.models.ErrorDetail] :ivar agent_version: The hybrid machine agent full version. :vartype agent_version: str - :ivar vm_id: Specifies the hybrid machine unique ID. - :vartype vm_id: str + :param vm_id: Specifies the hybrid machine unique ID. + :type vm_id: str :ivar display_name: Specifies the hybrid machine display name. :vartype display_name: str :ivar machine_fqdn: Specifies the hybrid machine FQDN. :vartype machine_fqdn: str - :param physical_location: Resource's Physical Location - :type physical_location: str :param client_public_key: Public Key that the client provides to be used during initial resource onboarding :type client_public_key: str @@ -209,6 +381,8 @@ class Machine(Resource): :param extensions: Machine Extensions information :type extensions: list[~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView] + :param identity: + :type identity: ~azure.mgmt.hybridcompute.models.MachineIdentity """ _validation = { @@ -216,14 +390,11 @@ class Machine(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'status': {'readonly': True}, 'last_status_change': {'readonly': True}, 'error_details': {'readonly': True}, 'agent_version': {'readonly': True}, - 'vm_id': {'readonly': True}, 'display_name': {'readonly': True}, 'machine_fqdn': {'readonly': True}, 'os_name': {'readonly': True}, @@ -234,46 +405,45 @@ class Machine(Resource): '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}'}, - 'type1': {'key': 'identity.type', 'type': 'str'}, - 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, - 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, - 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, + 'location': {'key': 'location', 'type': 'str'}, + 'location_data': {'key': 'properties.locationData', 'type': 'LocationData'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'MachinePropertiesOsProfile'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'StatusTypes'}, + 'status': {'key': 'properties.status', 'type': 'str'}, 'last_status_change': {'key': 'properties.lastStatusChange', 'type': 'iso-8601'}, 'error_details': {'key': 'properties.errorDetails', 'type': '[ErrorDetail]'}, 'agent_version': {'key': 'properties.agentVersion', 'type': 'str'}, 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'machine_fqdn': {'key': 'properties.machineFqdn', 'type': 'str'}, - 'physical_location': {'key': 'properties.physicalLocation', 'type': 'str'}, 'client_public_key': {'key': 'properties.clientPublicKey', 'type': 'str'}, 'os_name': {'key': 'properties.osName', 'type': 'str'}, 'os_version': {'key': 'properties.osVersion', 'type': 'str'}, 'extensions': {'key': 'properties.extensions', 'type': '[MachineExtensionInstanceView]'}, + 'identity': {'key': 'identity', 'type': 'MachineIdentity'}, } def __init__(self, **kwargs): super(Machine, self).__init__(**kwargs) + self.location_data = kwargs.get('location_data', None) self.os_profile = kwargs.get('os_profile', None) self.provisioning_state = None self.status = None self.last_status_change = None self.error_details = None self.agent_version = None - self.vm_id = None + self.vm_id = kwargs.get('vm_id', None) self.display_name = None self.machine_fqdn = None - self.physical_location = kwargs.get('physical_location', None) self.client_public_key = kwargs.get('client_public_key', None) self.os_name = None self.os_version = None self.extensions = kwargs.get('extensions', None) + self.identity = kwargs.get('identity', None) -class MachineExtension(Resource): +class MachineExtension(TrackedResource): """Describes a Machine Extension. Variables are only populated by the server, and will be ignored when @@ -281,22 +451,18 @@ class MachineExtension(Resource): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str - :ivar name: Resource name + :ivar name: The name of the resource :vartype name: str - :ivar type: Resource type + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str - :param location: Required. Resource location - :type location: str - :param tags: Resource tags + :param tags: Resource tags. :type tags: dict[str, str] - :param type1: The identity type. - :type type1: str - :ivar principal_id: The identity's principal id. - :vartype principal_id: str - :ivar tenant_id: The identity's tenant id. - :vartype tenant_id: str + :param location: Required. The geo-location where the resource lives + :type location: str :param force_update_tag: How the extension handler should be forced to update even if the extension configuration has not changed. :type force_update_tag: str @@ -323,7 +489,7 @@ class MachineExtension(Resource): :vartype provisioning_state: str :param instance_view: The machine extension instance view. :type instance_view: - ~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView + ~azure.mgmt.hybridcompute.models.MachineExtensionPropertiesInstanceView """ _validation = { @@ -331,8 +497,6 @@ class MachineExtension(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -340,11 +504,8 @@ class MachineExtension(Resource): '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}'}, - 'type1': {'key': 'identity.type', 'type': 'str'}, - 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, - 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, 'publisher': {'key': 'properties.publisher', 'type': 'str'}, 'machine_extension_type': {'key': 'properties.type', 'type': 'str'}, @@ -353,7 +514,7 @@ class MachineExtension(Resource): 'settings': {'key': 'properties.settings', 'type': 'object'}, 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'instance_view': {'key': 'properties.instanceView', 'type': 'MachineExtensionInstanceView'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'MachineExtensionPropertiesInstanceView'}, } def __init__(self, **kwargs): @@ -418,7 +579,7 @@ class MachineExtensionInstanceViewStatus(Model): _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'StatusLevelTypes'}, + 'level': {'key': 'level', 'type': 'str'}, 'display_status': {'key': 'displayStatus', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, 'time': {'key': 'time', 'type': 'iso-8601'}, @@ -433,25 +594,94 @@ def __init__(self, **kwargs): self.time = kwargs.get('time', None) -class MachineExtensionsListResult(Model): - """Describes the Machine Extensions List Result. +class MachineExtensionPropertiesInstanceView(MachineExtensionInstanceView): + """The machine extension instance view. + + :param name: The machine extension name. + :type name: str + :param type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param status: Instance view status. + :type status: + ~azure.mgmt.hybridcompute.models.MachineExtensionInstanceViewStatus + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'MachineExtensionInstanceViewStatus'}, + } + + def __init__(self, **kwargs): + super(MachineExtensionPropertiesInstanceView, self).__init__(**kwargs) + + +class MachineExtensionPropertiesModel(Model): + """Describes the properties of a Machine Extension. + + Variables are only populated by the server, and will be ignored when + sending a request. - :param value: The list of extensions - :type value: list[~azure.mgmt.hybridcompute.models.MachineExtension] - :param next_link: The uri to fetch the next page of machine extensions. - Call ListNext() with this to fetch the next page of extensions. - :type next_link: str + :param force_update_tag: How the extension handler should be forced to + update even if the extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: Indicates whether the extension should + use a newer minor version if one is available at deployment time. Once + deployed, however, the extension will not upgrade minor versions unless + redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either + protectedSettings or protectedSettingsFromKeyVault or no protected + settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :param instance_view: The machine extension instance view. + :type instance_view: + ~azure.mgmt.hybridcompute.models.MachineExtensionPropertiesInstanceView """ + _validation = { + 'provisioning_state': {'readonly': True}, + } + _attribute_map = { - 'value': {'key': 'value', 'type': '[MachineExtension]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'settings', 'type': 'object'}, + 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'instanceView', 'type': 'MachineExtensionPropertiesInstanceView'}, } def __init__(self, **kwargs): - super(MachineExtensionsListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) + super(MachineExtensionPropertiesModel, self).__init__(**kwargs) + self.force_update_tag = kwargs.get('force_update_tag', None) + self.publisher = kwargs.get('publisher', None) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) + self.provisioning_state = None + self.instance_view = kwargs.get('instance_view', None) class UpdateResource(Model): @@ -520,43 +750,275 @@ def __init__(self, **kwargs): self.protected_settings = kwargs.get('protected_settings', None) -class MachineReconnect(Model): - """Describes a hybrid machine reconnect. - - :param vm_id: Specifies the hybrid machine unique ID. - :type vm_id: str - :param client_public_key: Public Key that the client provides to be used - during initial resource onboarding. - :type client_public_key: str - """ - - _attribute_map = { - 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, - 'client_public_key': {'key': 'properties.clientPublicKey', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MachineReconnect, self).__init__(**kwargs) - self.vm_id = kwargs.get('vm_id', None) - self.client_public_key = kwargs.get('client_public_key', None) - - -class MachineUpdate(UpdateResource): - """Describes a hybrid machine Update. - - Variables are only populated by the server, and will be ignored when - sending a request. +class MachineExtensionUpdatePropertiesModel(Model): + """Describes the properties of a Machine Extension. + + :param force_update_tag: How the extension handler should be forced to + update even if the extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: Indicates whether the extension should + use a newer minor version if one is available at deployment time. Once + deployed, however, the extension will not upgrade minor versions unless + redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either + protectedSettings or protectedSettingsFromKeyVault or no protected + settings at all. + :type protected_settings: object + """ + + _attribute_map = { + 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'settings', 'type': 'object'}, + 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(MachineExtensionUpdatePropertiesModel, self).__init__(**kwargs) + self.force_update_tag = kwargs.get('force_update_tag', None) + self.publisher = kwargs.get('publisher', None) + self.type = kwargs.get('type', None) + self.type_handler_version = kwargs.get('type_handler_version', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.settings = kwargs.get('settings', None) + self.protected_settings = kwargs.get('protected_settings', None) + + +class MachineIdentity(Identity): + """MachineIdentity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. Possible values include: 'SystemAssigned' + :type type: str or ~azure.mgmt.hybridcompute.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, **kwargs): + super(MachineIdentity, self).__init__(**kwargs) + + +class MachineProperties(Model): + """Describes the properties of a hybrid machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param location_data: + :type location_data: ~azure.mgmt.hybridcompute.models.LocationData + :param os_profile: Specifies the operating system settings for the hybrid + machine. + :type os_profile: + ~azure.mgmt.hybridcompute.models.MachinePropertiesOsProfile + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :ivar status: The status of the hybrid machine agent. Possible values + include: 'Connected', 'Disconnected', 'Error' + :vartype status: str or ~azure.mgmt.hybridcompute.models.StatusTypes + :ivar last_status_change: The time of the last status change. + :vartype last_status_change: datetime + :ivar error_details: Details about the error state. + :vartype error_details: list[~azure.mgmt.hybridcompute.models.ErrorDetail] + :ivar agent_version: The hybrid machine agent full version. + :vartype agent_version: str + :param vm_id: Specifies the hybrid machine unique ID. + :type vm_id: str + :ivar display_name: Specifies the hybrid machine display name. + :vartype display_name: str + :ivar machine_fqdn: Specifies the hybrid machine FQDN. + :vartype machine_fqdn: str + :param client_public_key: Public Key that the client provides to be used + during initial resource onboarding + :type client_public_key: str + :ivar os_name: The Operating System running on the hybrid machine. + :vartype os_name: str + :ivar os_version: The version of Operating System running on the hybrid + machine. + :vartype os_version: str + :param extensions: Machine Extensions information + :type extensions: + list[~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'last_status_change': {'readonly': True}, + 'error_details': {'readonly': True}, + 'agent_version': {'readonly': True}, + 'display_name': {'readonly': True}, + 'machine_fqdn': {'readonly': True}, + 'os_name': {'readonly': True}, + 'os_version': {'readonly': True}, + } + + _attribute_map = { + 'location_data': {'key': 'locationData', 'type': 'LocationData'}, + 'os_profile': {'key': 'osProfile', 'type': 'MachinePropertiesOsProfile'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'last_status_change': {'key': 'lastStatusChange', 'type': 'iso-8601'}, + 'error_details': {'key': 'errorDetails', 'type': '[ErrorDetail]'}, + 'agent_version': {'key': 'agentVersion', 'type': 'str'}, + 'vm_id': {'key': 'vmId', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'machine_fqdn': {'key': 'machineFqdn', 'type': 'str'}, + 'client_public_key': {'key': 'clientPublicKey', 'type': 'str'}, + 'os_name': {'key': 'osName', 'type': 'str'}, + 'os_version': {'key': 'osVersion', 'type': 'str'}, + 'extensions': {'key': 'extensions', 'type': '[MachineExtensionInstanceView]'}, + } + + def __init__(self, **kwargs): + super(MachineProperties, self).__init__(**kwargs) + self.location_data = kwargs.get('location_data', None) + self.os_profile = kwargs.get('os_profile', None) + self.provisioning_state = None + self.status = None + self.last_status_change = None + self.error_details = None + self.agent_version = None + self.vm_id = kwargs.get('vm_id', None) + self.display_name = None + self.machine_fqdn = None + self.client_public_key = kwargs.get('client_public_key', None) + self.os_name = None + self.os_version = None + self.extensions = kwargs.get('extensions', None) + + +class OSProfile(Model): + """Specifies the operating system settings for the hybrid machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar computer_name: Specifies the host OS name of the hybrid machine. + :vartype computer_name: str + """ + + _validation = { + 'computer_name': {'readonly': True}, + } + + _attribute_map = { + 'computer_name': {'key': 'computerName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OSProfile, self).__init__(**kwargs) + self.computer_name = None + + +class MachinePropertiesOsProfile(OSProfile): + """Specifies the operating system settings for the hybrid machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar computer_name: Specifies the host OS name of the hybrid machine. + :vartype computer_name: str + """ + + _validation = { + 'computer_name': {'readonly': True}, + } + + _attribute_map = { + 'computer_name': {'key': 'computerName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MachinePropertiesOsProfile, self).__init__(**kwargs) + + +class MachineReconnect(Model): + """Describes a hybrid machine reconnect. + + :param vm_id: Specifies the hybrid machine unique ID. + :type vm_id: str + :param client_public_key: Public Key that the client provides to be used + during initial resource onboarding. + :type client_public_key: str + """ + + _attribute_map = { + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'client_public_key': {'key': 'properties.clientPublicKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MachineReconnect, self).__init__(**kwargs) + self.vm_id = kwargs.get('vm_id', None) + self.client_public_key = kwargs.get('client_public_key', None) + + +class MachineReconnectProperties(Model): + """Describes the properties required to reconnect a hybrid machine. + + :param vm_id: Specifies the hybrid machine unique ID. + :type vm_id: str + :param client_public_key: Public Key that the client provides to be used + during initial resource onboarding. + :type client_public_key: str + """ + + _attribute_map = { + 'vm_id': {'key': 'vmId', 'type': 'str'}, + 'client_public_key': {'key': 'clientPublicKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MachineReconnectProperties, self).__init__(**kwargs) + self.vm_id = kwargs.get('vm_id', None) + self.client_public_key = kwargs.get('client_public_key', None) + + +class MachineUpdate(UpdateResource): + """Describes a hybrid machine Update. + + Variables are only populated by the server, and will be ignored when + sending a request. :param tags: Resource tags :type tags: dict[str, str] - :param type: The identity type. - :type type: str - :ivar principal_id: The identity's principal id. + :ivar principal_id: The principal ID of resource identity. :vartype principal_id: str - :ivar tenant_id: The identity's tenant id. + :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :param physical_location: Resource's Physical Location - :type physical_location: str + :param type: The identity type. Possible values include: 'SystemAssigned' + :type type: str or ~azure.mgmt.hybridcompute.models.ResourceIdentityType + :param location_data: + :type location_data: ~azure.mgmt.hybridcompute.models.LocationData """ _validation = { @@ -566,18 +1028,34 @@ class MachineUpdate(UpdateResource): _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, - 'type': {'key': 'identity.type', 'type': 'str'}, 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, - 'physical_location': {'key': 'properties.physicalLocation', 'type': 'str'}, + 'type': {'key': 'identity.type', 'type': 'ResourceIdentityType'}, + 'location_data': {'key': 'properties.locationData', 'type': 'LocationData'}, } def __init__(self, **kwargs): super(MachineUpdate, self).__init__(**kwargs) - self.type = kwargs.get('type', None) self.principal_id = None self.tenant_id = None - self.physical_location = kwargs.get('physical_location', None) + self.type = kwargs.get('type', None) + self.location_data = kwargs.get('location_data', None) + + +class MachineUpdateProperties(Model): + """Describes the ARM updatable properties of a hybrid machine. + + :param location_data: + :type location_data: ~azure.mgmt.hybridcompute.models.LocationData + """ + + _attribute_map = { + 'location_data': {'key': 'locationData', 'type': 'LocationData'}, + } + + def __init__(self, **kwargs): + super(MachineUpdateProperties, self).__init__(**kwargs) + self.location_data = kwargs.get('location_data', None) class OperationValue(Model): @@ -628,24 +1106,357 @@ def __init__(self, **kwargs): self.provider = None -class OSProfile(Model): - """Specifies the operating system settings for the hybrid machine. +class OperationValueDisplayModel(Model): + """Describes the properties of a Hybrid Compute Operation Value Display. Variables are only populated by the server, and will be ignored when sending a request. - :ivar computer_name: Specifies the host OS name of the hybrid machine. - :vartype computer_name: str + :ivar operation: The display name of the compute operation. + :vartype operation: str + :ivar resource: The display name of the resource the operation applies to. + :vartype resource: str + :ivar description: The description of the operation. + :vartype description: str + :ivar provider: The resource provider for the operation. + :vartype provider: str """ _validation = { - 'computer_name': {'readonly': True}, + 'operation': {'readonly': True}, + 'resource': {'readonly': True}, + 'description': {'readonly': True}, + 'provider': {'readonly': True}, } _attribute_map = { - 'computer_name': {'key': 'computerName', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, } def __init__(self, **kwargs): - super(OSProfile, self).__init__(**kwargs) - self.computer_name = None + super(OperationValueDisplayModel, self).__init__(**kwargs) + self.operation = None + self.resource = None + self.description = None + self.provider = None + + +class Plan(Model): + """Plan for the resource. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. A user defined name of the 3rd Party Artifact that + is being procured. + :type name: str + :param publisher: Required. The publisher of the 3rd Party Artifact that + is being bought. E.g. NewRelic + :type publisher: str + :param product: Required. The 3rd Party artifact that is being procured. + E.g. NewRelic. Product maps to the OfferID specified for the artifact at + the time of Data Market onboarding. + :type product: str + :param promotion_code: A publisher provided promotion code as provisioned + in Data Market for the said product/artifact. + :type promotion_code: str + :param version: The version of the desired product/artifact. + :type version: str + """ + + _validation = { + 'name': {'required': True}, + 'publisher': {'required': True}, + 'product': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Plan, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) + self.promotion_code = kwargs.get('promotion_code', None) + self.version = kwargs.get('version', None) + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) + + +class ResourceModelWithAllowedPropertySet(Model): + """The resource model definition containing the full set of allowed properties + for a resource. Except properties bag, there cannot be a top level property + outside of this set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.. + :vartype type: str + :param location: The geo-location where the resource lives + :type location: str + :param managed_by: The fully qualified resource ID of the resource that + manages this resource. Indicates if this resource is managed by another + azure resource. If this is present, complete mode deployment will not + delete the resource if it is removed from the template since it is managed + by another resource. + :type managed_by: str + :param kind: Metadata used by portal/tooling/etc to render different UX + experiences for resources of the same type; e.g. ApiApps are a kind of + Microsoft.Web/sites type. If supported, the resource provider must + validate and persist this value. + :type kind: str + :ivar etag: The etag field is *not* required. If it is provided in the + response body, it must also be provided as a header per the normal etag + convention. Entity tags are used for comparing two or more entities from + the same requested resource. HTTP/1.1 uses entity tags in the etag + (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), + and If-Range (section 14.27) header fields. + :vartype etag: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param identity: + :type identity: + ~azure.mgmt.hybridcompute.models.ResourceModelWithAllowedPropertySetIdentity + :param sku: + :type sku: + ~azure.mgmt.hybridcompute.models.ResourceModelWithAllowedPropertySetSku + :param plan: + :type plan: + ~azure.mgmt.hybridcompute.models.ResourceModelWithAllowedPropertySetPlan + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ResourceModelWithAllowedPropertySetIdentity'}, + 'sku': {'key': 'sku', 'type': 'ResourceModelWithAllowedPropertySetSku'}, + 'plan': {'key': 'plan', 'type': 'ResourceModelWithAllowedPropertySetPlan'}, + } + + def __init__(self, **kwargs): + super(ResourceModelWithAllowedPropertySet, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.managed_by = kwargs.get('managed_by', None) + self.kind = kwargs.get('kind', None) + self.etag = None + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.sku = kwargs.get('sku', None) + self.plan = kwargs.get('plan', None) + + +class ResourceModelWithAllowedPropertySetIdentity(Identity): + """ResourceModelWithAllowedPropertySetIdentity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. Possible values include: 'SystemAssigned' + :type type: str or ~azure.mgmt.hybridcompute.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, **kwargs): + super(ResourceModelWithAllowedPropertySetIdentity, self).__init__(**kwargs) + + +class ResourceModelWithAllowedPropertySetPlan(Plan): + """ResourceModelWithAllowedPropertySetPlan. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. A user defined name of the 3rd Party Artifact that + is being procured. + :type name: str + :param publisher: Required. The publisher of the 3rd Party Artifact that + is being bought. E.g. NewRelic + :type publisher: str + :param product: Required. The 3rd Party artifact that is being procured. + E.g. NewRelic. Product maps to the OfferID specified for the artifact at + the time of Data Market onboarding. + :type product: str + :param promotion_code: A publisher provided promotion code as provisioned + in Data Market for the said product/artifact. + :type promotion_code: str + :param version: The version of the desired product/artifact. + :type version: str + """ + + _validation = { + 'name': {'required': True}, + 'publisher': {'required': True}, + 'product': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceModelWithAllowedPropertySetPlan, self).__init__(**kwargs) + + +class Sku(Model): + """The resource model definition representing SKU. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the SKU. Ex - P3. It is typically a + letter+number code + :type name: str + :param tier: This field is required to be implemented by the Resource + Provider if the service has more than one tier, but is not required on a + PUT. Possible values include: 'Free', 'Basic', 'Standard', 'Premium' + :type tier: str or ~azure.mgmt.hybridcompute.models.SkuTier + :param size: The SKU size. When the name field is the combination of tier + and some other value, this would be the standalone code. + :type size: str + :param family: If the service has different generations of hardware, for + the same SKU, then that can be captured here. + :type family: str + :param capacity: If the SKU supports scale out/in then the capacity + integer should be included. If scale out/in is not possible for the + resource this may be omitted. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.size = kwargs.get('size', None) + self.family = kwargs.get('family', None) + self.capacity = kwargs.get('capacity', None) + + +class ResourceModelWithAllowedPropertySetSku(Sku): + """ResourceModelWithAllowedPropertySetSku. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the SKU. Ex - P3. It is typically a + letter+number code + :type name: str + :param tier: This field is required to be implemented by the Resource + Provider if the service has more than one tier, but is not required on a + PUT. Possible values include: 'Free', 'Basic', 'Standard', 'Premium' + :type tier: str or ~azure.mgmt.hybridcompute.models.SkuTier + :param size: The SKU size. When the name field is the combination of tier + and some other value, this would be the standalone code. + :type size: str + :param family: If the service has different generations of hardware, for + the same SKU, then that can be captured here. + :type family: str + :param capacity: If the SKU supports scale out/in then the capacity + integer should be included. If scale out/in is not possible for the + resource this may be omitted. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ResourceModelWithAllowedPropertySetSku, self).__init__(**kwargs) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models_py3.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models_py3.py index aac62ee0d304..2c7a439dfe07 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models_py3.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_models_py3.py @@ -13,6 +13,79 @@ from msrest.exceptions import HttpOperationError +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + class CloudError(Model): """CloudError. """ @@ -21,6 +94,34 @@ class CloudError(Model): } +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + class ErrorDetail(Model): """Error details. @@ -58,27 +159,47 @@ def __init__(self, *, code: str, message: str, target: str=None, details=None, * class ErrorResponse(Model): - """Error response. + """The resource management error response. - Contains details when the response code indicates an error. - - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when + sending a request. - :param error: Required. The error details. - :type error: ~azure.mgmt.hybridcompute.models.ErrorDetail + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.hybridcompute.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.hybridcompute.models.ErrorAdditionalInfo] """ _validation = { - 'error': {'required': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, } _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } - def __init__(self, *, error, **kwargs) -> None: + def __init__(self, **kwargs) -> None: super(ErrorResponse, self).__init__(**kwargs) - self.error = error + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None class ErrorResponseException(HttpOperationError): @@ -93,30 +214,95 @@ def __init__(self, deserialize, response, *args): super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) -class Resource(Model): - """The Resource model definition. +class Identity(Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. Possible values include: 'SystemAssigned' + :type type: str or ~azure.mgmt.hybridcompute.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + +class LocationData(Model): + """Metadata pertaining to the geographic location of the resource. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. A canonical name for the geographic or physical + location. + :type name: str + :param city: The city or locality where the resource is located. + :type city: str + :param district: The district, state, or province where the resource is + located. + :type district: str + :param country_or_region: The country or region where the resource is + located + :type country_or_region: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 256}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'district': {'key': 'district', 'type': 'str'}, + 'country_or_region': {'key': 'countryOrRegion', 'type': 'str'}, + } + + def __init__(self, *, name: str, city: str=None, district: str=None, country_or_region: str=None, **kwargs) -> None: + super(LocationData, self).__init__(**kwargs) + self.name = name + self.city = city + self.district = district + self.country_or_region = country_or_region + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level 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: Resource Id + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str - :ivar name: Resource name + :ivar name: The name of the resource :vartype name: str - :ivar type: Resource type + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str - :param location: Required. Resource location - :type location: str - :param tags: Resource tags + :param tags: Resource tags. :type tags: dict[str, str] - :param type1: The identity type. - :type type1: str - :ivar principal_id: The identity's principal id. - :vartype principal_id: str - :ivar tenant_id: The identity's tenant id. - :vartype tenant_id: str + :param location: Required. The geo-location where the resource lives + :type location: str """ _validation = { @@ -124,34 +310,23 @@ class Resource(Model): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'principal_id': {'readonly': True}, - 'tenant_id': {'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}'}, - 'type1': {'key': 'identity.type', 'type': 'str'}, - 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, - 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, } - def __init__(self, *, location: str, tags=None, type1: str=None, **kwargs) -> None: - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = location + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) self.tags = tags - self.type1 = type1 - self.principal_id = None - self.tenant_id = None + self.location = location -class Machine(Resource): +class Machine(TrackedResource): """Describes a hybrid machine. Variables are only populated by the server, and will be ignored when @@ -159,25 +334,24 @@ class Machine(Resource): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str - :ivar name: Resource name + :ivar name: The name of the resource :vartype name: str - :ivar type: Resource type + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str - :param location: Required. Resource location - :type location: str - :param tags: Resource tags + :param tags: Resource tags. :type tags: dict[str, str] - :param type1: The identity type. - :type type1: str - :ivar principal_id: The identity's principal id. - :vartype principal_id: str - :ivar tenant_id: The identity's tenant id. - :vartype tenant_id: str + :param location: Required. The geo-location where the resource lives + :type location: str + :param location_data: + :type location_data: ~azure.mgmt.hybridcompute.models.LocationData :param os_profile: Specifies the operating system settings for the hybrid machine. - :type os_profile: ~azure.mgmt.hybridcompute.models.OSProfile + :type os_profile: + ~azure.mgmt.hybridcompute.models.MachinePropertiesOsProfile :ivar provisioning_state: The provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -190,14 +364,12 @@ class Machine(Resource): :vartype error_details: list[~azure.mgmt.hybridcompute.models.ErrorDetail] :ivar agent_version: The hybrid machine agent full version. :vartype agent_version: str - :ivar vm_id: Specifies the hybrid machine unique ID. - :vartype vm_id: str + :param vm_id: Specifies the hybrid machine unique ID. + :type vm_id: str :ivar display_name: Specifies the hybrid machine display name. :vartype display_name: str :ivar machine_fqdn: Specifies the hybrid machine FQDN. :vartype machine_fqdn: str - :param physical_location: Resource's Physical Location - :type physical_location: str :param client_public_key: Public Key that the client provides to be used during initial resource onboarding :type client_public_key: str @@ -209,6 +381,8 @@ class Machine(Resource): :param extensions: Machine Extensions information :type extensions: list[~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView] + :param identity: + :type identity: ~azure.mgmt.hybridcompute.models.MachineIdentity """ _validation = { @@ -216,14 +390,11 @@ class Machine(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'status': {'readonly': True}, 'last_status_change': {'readonly': True}, 'error_details': {'readonly': True}, 'agent_version': {'readonly': True}, - 'vm_id': {'readonly': True}, 'display_name': {'readonly': True}, 'machine_fqdn': {'readonly': True}, 'os_name': {'readonly': True}, @@ -234,46 +405,45 @@ class Machine(Resource): '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}'}, - 'type1': {'key': 'identity.type', 'type': 'str'}, - 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, - 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, - 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, + 'location': {'key': 'location', 'type': 'str'}, + 'location_data': {'key': 'properties.locationData', 'type': 'LocationData'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'MachinePropertiesOsProfile'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'StatusTypes'}, + 'status': {'key': 'properties.status', 'type': 'str'}, 'last_status_change': {'key': 'properties.lastStatusChange', 'type': 'iso-8601'}, 'error_details': {'key': 'properties.errorDetails', 'type': '[ErrorDetail]'}, 'agent_version': {'key': 'properties.agentVersion', 'type': 'str'}, 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'machine_fqdn': {'key': 'properties.machineFqdn', 'type': 'str'}, - 'physical_location': {'key': 'properties.physicalLocation', 'type': 'str'}, 'client_public_key': {'key': 'properties.clientPublicKey', 'type': 'str'}, 'os_name': {'key': 'properties.osName', 'type': 'str'}, 'os_version': {'key': 'properties.osVersion', 'type': 'str'}, 'extensions': {'key': 'properties.extensions', 'type': '[MachineExtensionInstanceView]'}, + 'identity': {'key': 'identity', 'type': 'MachineIdentity'}, } - def __init__(self, *, location: str, tags=None, type1: str=None, os_profile=None, physical_location: str=None, client_public_key: str=None, extensions=None, **kwargs) -> None: - super(Machine, self).__init__(location=location, tags=tags, type1=type1, **kwargs) + def __init__(self, *, location: str, tags=None, location_data=None, os_profile=None, vm_id: str=None, client_public_key: str=None, extensions=None, identity=None, **kwargs) -> None: + super(Machine, self).__init__(tags=tags, location=location, **kwargs) + self.location_data = location_data self.os_profile = os_profile self.provisioning_state = None self.status = None self.last_status_change = None self.error_details = None self.agent_version = None - self.vm_id = None + self.vm_id = vm_id self.display_name = None self.machine_fqdn = None - self.physical_location = physical_location self.client_public_key = client_public_key self.os_name = None self.os_version = None self.extensions = extensions + self.identity = identity -class MachineExtension(Resource): +class MachineExtension(TrackedResource): """Describes a Machine Extension. Variables are only populated by the server, and will be ignored when @@ -281,22 +451,18 @@ class MachineExtension(Resource): All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str - :ivar name: Resource name + :ivar name: The name of the resource :vartype name: str - :ivar type: Resource type + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. :vartype type: str - :param location: Required. Resource location - :type location: str - :param tags: Resource tags + :param tags: Resource tags. :type tags: dict[str, str] - :param type1: The identity type. - :type type1: str - :ivar principal_id: The identity's principal id. - :vartype principal_id: str - :ivar tenant_id: The identity's tenant id. - :vartype tenant_id: str + :param location: Required. The geo-location where the resource lives + :type location: str :param force_update_tag: How the extension handler should be forced to update even if the extension configuration has not changed. :type force_update_tag: str @@ -323,7 +489,7 @@ class MachineExtension(Resource): :vartype provisioning_state: str :param instance_view: The machine extension instance view. :type instance_view: - ~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView + ~azure.mgmt.hybridcompute.models.MachineExtensionPropertiesInstanceView """ _validation = { @@ -331,8 +497,6 @@ class MachineExtension(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -340,11 +504,8 @@ class MachineExtension(Resource): '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}'}, - 'type1': {'key': 'identity.type', 'type': 'str'}, - 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, - 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, 'publisher': {'key': 'properties.publisher', 'type': 'str'}, 'machine_extension_type': {'key': 'properties.type', 'type': 'str'}, @@ -353,11 +514,11 @@ class MachineExtension(Resource): 'settings': {'key': 'properties.settings', 'type': 'object'}, 'protected_settings': {'key': 'properties.protectedSettings', 'type': 'object'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'instance_view': {'key': 'properties.instanceView', 'type': 'MachineExtensionInstanceView'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'MachineExtensionPropertiesInstanceView'}, } - def __init__(self, *, location: str, tags=None, type1: str=None, force_update_tag: str=None, publisher: str=None, machine_extension_type: str=None, type_handler_version: str=None, auto_upgrade_minor_version: bool=None, settings=None, protected_settings=None, instance_view=None, **kwargs) -> None: - super(MachineExtension, self).__init__(location=location, tags=tags, type1=type1, **kwargs) + def __init__(self, *, location: str, tags=None, force_update_tag: str=None, publisher: str=None, machine_extension_type: str=None, type_handler_version: str=None, auto_upgrade_minor_version: bool=None, settings=None, protected_settings=None, instance_view=None, **kwargs) -> None: + super(MachineExtension, self).__init__(tags=tags, location=location, **kwargs) self.force_update_tag = force_update_tag self.publisher = publisher self.machine_extension_type = machine_extension_type @@ -418,7 +579,7 @@ class MachineExtensionInstanceViewStatus(Model): _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'StatusLevelTypes'}, + 'level': {'key': 'level', 'type': 'str'}, 'display_status': {'key': 'displayStatus', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, 'time': {'key': 'time', 'type': 'iso-8601'}, @@ -433,25 +594,94 @@ def __init__(self, *, code: str=None, level=None, display_status: str=None, mess self.time = time -class MachineExtensionsListResult(Model): - """Describes the Machine Extensions List Result. +class MachineExtensionPropertiesInstanceView(MachineExtensionInstanceView): + """The machine extension instance view. + + :param name: The machine extension name. + :type name: str + :param type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param status: Instance view status. + :type status: + ~azure.mgmt.hybridcompute.models.MachineExtensionInstanceViewStatus + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'MachineExtensionInstanceViewStatus'}, + } + + def __init__(self, *, name: str=None, type: str=None, type_handler_version: str=None, status=None, **kwargs) -> None: + super(MachineExtensionPropertiesInstanceView, self).__init__(name=name, type=type, type_handler_version=type_handler_version, status=status, **kwargs) + - :param value: The list of extensions - :type value: list[~azure.mgmt.hybridcompute.models.MachineExtension] - :param next_link: The uri to fetch the next page of machine extensions. - Call ListNext() with this to fetch the next page of extensions. - :type next_link: str +class MachineExtensionPropertiesModel(Model): + """Describes the properties of a Machine Extension. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param force_update_tag: How the extension handler should be forced to + update even if the extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is + "CustomScriptExtension". + :type type: str + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: Indicates whether the extension should + use a newer minor version if one is available at deployment time. Once + deployed, however, the extension will not upgrade minor versions unless + redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either + protectedSettings or protectedSettingsFromKeyVault or no protected + settings at all. + :type protected_settings: object + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :param instance_view: The machine extension instance view. + :type instance_view: + ~azure.mgmt.hybridcompute.models.MachineExtensionPropertiesInstanceView """ + _validation = { + 'provisioning_state': {'readonly': True}, + } + _attribute_map = { - 'value': {'key': 'value', 'type': '[MachineExtension]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'settings', 'type': 'object'}, + 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'instanceView', 'type': 'MachineExtensionPropertiesInstanceView'}, } - def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: - super(MachineExtensionsListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link + def __init__(self, *, force_update_tag: str=None, publisher: str=None, type: str=None, type_handler_version: str=None, auto_upgrade_minor_version: bool=None, settings=None, protected_settings=None, instance_view=None, **kwargs) -> None: + super(MachineExtensionPropertiesModel, self).__init__(**kwargs) + self.force_update_tag = force_update_tag + self.publisher = publisher + self.type = type + self.type_handler_version = type_handler_version + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.settings = settings + self.protected_settings = protected_settings + self.provisioning_state = None + self.instance_view = instance_view class UpdateResource(Model): @@ -520,43 +750,275 @@ def __init__(self, *, tags=None, force_update_tag: str=None, publisher: str=None self.protected_settings = protected_settings -class MachineReconnect(Model): - """Describes a hybrid machine reconnect. - - :param vm_id: Specifies the hybrid machine unique ID. - :type vm_id: str - :param client_public_key: Public Key that the client provides to be used - during initial resource onboarding. - :type client_public_key: str - """ - - _attribute_map = { - 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, - 'client_public_key': {'key': 'properties.clientPublicKey', 'type': 'str'}, - } - - def __init__(self, *, vm_id: str=None, client_public_key: str=None, **kwargs) -> None: - super(MachineReconnect, self).__init__(**kwargs) - self.vm_id = vm_id - self.client_public_key = client_public_key - - -class MachineUpdate(UpdateResource): - """Describes a hybrid machine Update. - - Variables are only populated by the server, and will be ignored when - sending a request. +class MachineExtensionUpdatePropertiesModel(Model): + """Describes the properties of a Machine Extension. - :param tags: Resource tags - :type tags: dict[str, str] - :param type: The identity type. + :param force_update_tag: How the extension handler should be forced to + update even if the extension configuration has not changed. + :type force_update_tag: str + :param publisher: The name of the extension handler publisher. + :type publisher: str + :param type: Specifies the type of the extension; an example is + "CustomScriptExtension". :type type: str - :ivar principal_id: The identity's principal id. + :param type_handler_version: Specifies the version of the script handler. + :type type_handler_version: str + :param auto_upgrade_minor_version: Indicates whether the extension should + use a newer minor version if one is available at deployment time. Once + deployed, however, the extension will not upgrade minor versions unless + redeployed, even with this property set to true. + :type auto_upgrade_minor_version: bool + :param settings: Json formatted public settings for the extension. + :type settings: object + :param protected_settings: The extension can contain either + protectedSettings or protectedSettingsFromKeyVault or no protected + settings at all. + :type protected_settings: object + """ + + _attribute_map = { + 'force_update_tag': {'key': 'forceUpdateTag', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'type_handler_version': {'key': 'typeHandlerVersion', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'autoUpgradeMinorVersion', 'type': 'bool'}, + 'settings': {'key': 'settings', 'type': 'object'}, + 'protected_settings': {'key': 'protectedSettings', 'type': 'object'}, + } + + def __init__(self, *, force_update_tag: str=None, publisher: str=None, type: str=None, type_handler_version: str=None, auto_upgrade_minor_version: bool=None, settings=None, protected_settings=None, **kwargs) -> None: + super(MachineExtensionUpdatePropertiesModel, self).__init__(**kwargs) + self.force_update_tag = force_update_tag + self.publisher = publisher + self.type = type + self.type_handler_version = type_handler_version + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.settings = settings + self.protected_settings = protected_settings + + +class MachineIdentity(Identity): + """MachineIdentity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal ID of resource identity. :vartype principal_id: str - :ivar tenant_id: The identity's tenant id. + :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :param physical_location: Resource's Physical Location - :type physical_location: str + :param type: The identity type. Possible values include: 'SystemAssigned' + :type type: str or ~azure.mgmt.hybridcompute.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(MachineIdentity, self).__init__(type=type, **kwargs) + + +class MachineProperties(Model): + """Describes the properties of a hybrid machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param location_data: + :type location_data: ~azure.mgmt.hybridcompute.models.LocationData + :param os_profile: Specifies the operating system settings for the hybrid + machine. + :type os_profile: + ~azure.mgmt.hybridcompute.models.MachinePropertiesOsProfile + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :ivar status: The status of the hybrid machine agent. Possible values + include: 'Connected', 'Disconnected', 'Error' + :vartype status: str or ~azure.mgmt.hybridcompute.models.StatusTypes + :ivar last_status_change: The time of the last status change. + :vartype last_status_change: datetime + :ivar error_details: Details about the error state. + :vartype error_details: list[~azure.mgmt.hybridcompute.models.ErrorDetail] + :ivar agent_version: The hybrid machine agent full version. + :vartype agent_version: str + :param vm_id: Specifies the hybrid machine unique ID. + :type vm_id: str + :ivar display_name: Specifies the hybrid machine display name. + :vartype display_name: str + :ivar machine_fqdn: Specifies the hybrid machine FQDN. + :vartype machine_fqdn: str + :param client_public_key: Public Key that the client provides to be used + during initial resource onboarding + :type client_public_key: str + :ivar os_name: The Operating System running on the hybrid machine. + :vartype os_name: str + :ivar os_version: The version of Operating System running on the hybrid + machine. + :vartype os_version: str + :param extensions: Machine Extensions information + :type extensions: + list[~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'last_status_change': {'readonly': True}, + 'error_details': {'readonly': True}, + 'agent_version': {'readonly': True}, + 'display_name': {'readonly': True}, + 'machine_fqdn': {'readonly': True}, + 'os_name': {'readonly': True}, + 'os_version': {'readonly': True}, + } + + _attribute_map = { + 'location_data': {'key': 'locationData', 'type': 'LocationData'}, + 'os_profile': {'key': 'osProfile', 'type': 'MachinePropertiesOsProfile'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'last_status_change': {'key': 'lastStatusChange', 'type': 'iso-8601'}, + 'error_details': {'key': 'errorDetails', 'type': '[ErrorDetail]'}, + 'agent_version': {'key': 'agentVersion', 'type': 'str'}, + 'vm_id': {'key': 'vmId', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'machine_fqdn': {'key': 'machineFqdn', 'type': 'str'}, + 'client_public_key': {'key': 'clientPublicKey', 'type': 'str'}, + 'os_name': {'key': 'osName', 'type': 'str'}, + 'os_version': {'key': 'osVersion', 'type': 'str'}, + 'extensions': {'key': 'extensions', 'type': '[MachineExtensionInstanceView]'}, + } + + def __init__(self, *, location_data=None, os_profile=None, vm_id: str=None, client_public_key: str=None, extensions=None, **kwargs) -> None: + super(MachineProperties, self).__init__(**kwargs) + self.location_data = location_data + self.os_profile = os_profile + self.provisioning_state = None + self.status = None + self.last_status_change = None + self.error_details = None + self.agent_version = None + self.vm_id = vm_id + self.display_name = None + self.machine_fqdn = None + self.client_public_key = client_public_key + self.os_name = None + self.os_version = None + self.extensions = extensions + + +class OSProfile(Model): + """Specifies the operating system settings for the hybrid machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar computer_name: Specifies the host OS name of the hybrid machine. + :vartype computer_name: str + """ + + _validation = { + 'computer_name': {'readonly': True}, + } + + _attribute_map = { + 'computer_name': {'key': 'computerName', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OSProfile, self).__init__(**kwargs) + self.computer_name = None + + +class MachinePropertiesOsProfile(OSProfile): + """Specifies the operating system settings for the hybrid machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar computer_name: Specifies the host OS name of the hybrid machine. + :vartype computer_name: str + """ + + _validation = { + 'computer_name': {'readonly': True}, + } + + _attribute_map = { + 'computer_name': {'key': 'computerName', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(MachinePropertiesOsProfile, self).__init__(**kwargs) + + +class MachineReconnect(Model): + """Describes a hybrid machine reconnect. + + :param vm_id: Specifies the hybrid machine unique ID. + :type vm_id: str + :param client_public_key: Public Key that the client provides to be used + during initial resource onboarding. + :type client_public_key: str + """ + + _attribute_map = { + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'client_public_key': {'key': 'properties.clientPublicKey', 'type': 'str'}, + } + + def __init__(self, *, vm_id: str=None, client_public_key: str=None, **kwargs) -> None: + super(MachineReconnect, self).__init__(**kwargs) + self.vm_id = vm_id + self.client_public_key = client_public_key + + +class MachineReconnectProperties(Model): + """Describes the properties required to reconnect a hybrid machine. + + :param vm_id: Specifies the hybrid machine unique ID. + :type vm_id: str + :param client_public_key: Public Key that the client provides to be used + during initial resource onboarding. + :type client_public_key: str + """ + + _attribute_map = { + 'vm_id': {'key': 'vmId', 'type': 'str'}, + 'client_public_key': {'key': 'clientPublicKey', 'type': 'str'}, + } + + def __init__(self, *, vm_id: str=None, client_public_key: str=None, **kwargs) -> None: + super(MachineReconnectProperties, self).__init__(**kwargs) + self.vm_id = vm_id + self.client_public_key = client_public_key + + +class MachineUpdate(UpdateResource): + """Describes a hybrid machine Update. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param tags: Resource tags + :type tags: dict[str, str] + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. Possible values include: 'SystemAssigned' + :type type: str or ~azure.mgmt.hybridcompute.models.ResourceIdentityType + :param location_data: + :type location_data: ~azure.mgmt.hybridcompute.models.LocationData """ _validation = { @@ -566,18 +1028,34 @@ class MachineUpdate(UpdateResource): _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, - 'type': {'key': 'identity.type', 'type': 'str'}, 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, - 'physical_location': {'key': 'properties.physicalLocation', 'type': 'str'}, + 'type': {'key': 'identity.type', 'type': 'ResourceIdentityType'}, + 'location_data': {'key': 'properties.locationData', 'type': 'LocationData'}, } - def __init__(self, *, tags=None, type: str=None, physical_location: str=None, **kwargs) -> None: + def __init__(self, *, tags=None, type=None, location_data=None, **kwargs) -> None: super(MachineUpdate, self).__init__(tags=tags, **kwargs) - self.type = type self.principal_id = None self.tenant_id = None - self.physical_location = physical_location + self.type = type + self.location_data = location_data + + +class MachineUpdateProperties(Model): + """Describes the ARM updatable properties of a hybrid machine. + + :param location_data: + :type location_data: ~azure.mgmt.hybridcompute.models.LocationData + """ + + _attribute_map = { + 'location_data': {'key': 'locationData', 'type': 'LocationData'}, + } + + def __init__(self, *, location_data=None, **kwargs) -> None: + super(MachineUpdateProperties, self).__init__(**kwargs) + self.location_data = location_data class OperationValue(Model): @@ -628,24 +1106,357 @@ def __init__(self, **kwargs) -> None: self.provider = None -class OSProfile(Model): - """Specifies the operating system settings for the hybrid machine. +class OperationValueDisplayModel(Model): + """Describes the properties of a Hybrid Compute Operation Value Display. Variables are only populated by the server, and will be ignored when sending a request. - :ivar computer_name: Specifies the host OS name of the hybrid machine. - :vartype computer_name: str + :ivar operation: The display name of the compute operation. + :vartype operation: str + :ivar resource: The display name of the resource the operation applies to. + :vartype resource: str + :ivar description: The description of the operation. + :vartype description: str + :ivar provider: The resource provider for the operation. + :vartype provider: str """ _validation = { - 'computer_name': {'readonly': True}, + 'operation': {'readonly': True}, + 'resource': {'readonly': True}, + 'description': {'readonly': True}, + 'provider': {'readonly': True}, } _attribute_map = { - 'computer_name': {'key': 'computerName', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, } def __init__(self, **kwargs) -> None: - super(OSProfile, self).__init__(**kwargs) - self.computer_name = None + super(OperationValueDisplayModel, self).__init__(**kwargs) + self.operation = None + self.resource = None + self.description = None + self.provider = None + + +class Plan(Model): + """Plan for the resource. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. A user defined name of the 3rd Party Artifact that + is being procured. + :type name: str + :param publisher: Required. The publisher of the 3rd Party Artifact that + is being bought. E.g. NewRelic + :type publisher: str + :param product: Required. The 3rd Party artifact that is being procured. + E.g. NewRelic. Product maps to the OfferID specified for the artifact at + the time of Data Market onboarding. + :type product: str + :param promotion_code: A publisher provided promotion code as provisioned + in Data Market for the said product/artifact. + :type promotion_code: str + :param version: The version of the desired product/artifact. + :type version: str + """ + + _validation = { + 'name': {'required': True}, + 'publisher': {'required': True}, + 'product': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, name: str, publisher: str, product: str, promotion_code: str=None, version: str=None, **kwargs) -> None: + super(Plan, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + self.promotion_code = promotion_code + self.version = version + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) + + +class ResourceModelWithAllowedPropertySet(Model): + """The resource model definition containing the full set of allowed properties + for a resource. Except properties bag, there cannot be a top level property + outside of this set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.. + :vartype type: str + :param location: The geo-location where the resource lives + :type location: str + :param managed_by: The fully qualified resource ID of the resource that + manages this resource. Indicates if this resource is managed by another + azure resource. If this is present, complete mode deployment will not + delete the resource if it is removed from the template since it is managed + by another resource. + :type managed_by: str + :param kind: Metadata used by portal/tooling/etc to render different UX + experiences for resources of the same type; e.g. ApiApps are a kind of + Microsoft.Web/sites type. If supported, the resource provider must + validate and persist this value. + :type kind: str + :ivar etag: The etag field is *not* required. If it is provided in the + response body, it must also be provided as a header per the normal etag + convention. Entity tags are used for comparing two or more entities from + the same requested resource. HTTP/1.1 uses entity tags in the etag + (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), + and If-Range (section 14.27) header fields. + :vartype etag: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param identity: + :type identity: + ~azure.mgmt.hybridcompute.models.ResourceModelWithAllowedPropertySetIdentity + :param sku: + :type sku: + ~azure.mgmt.hybridcompute.models.ResourceModelWithAllowedPropertySetSku + :param plan: + :type plan: + ~azure.mgmt.hybridcompute.models.ResourceModelWithAllowedPropertySetPlan + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ResourceModelWithAllowedPropertySetIdentity'}, + 'sku': {'key': 'sku', 'type': 'ResourceModelWithAllowedPropertySetSku'}, + 'plan': {'key': 'plan', 'type': 'ResourceModelWithAllowedPropertySetPlan'}, + } + + def __init__(self, *, location: str=None, managed_by: str=None, kind: str=None, tags=None, identity=None, sku=None, plan=None, **kwargs) -> None: + super(ResourceModelWithAllowedPropertySet, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.managed_by = managed_by + self.kind = kind + self.etag = None + self.tags = tags + self.identity = identity + self.sku = sku + self.plan = plan + + +class ResourceModelWithAllowedPropertySetIdentity(Identity): + """ResourceModelWithAllowedPropertySetIdentity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. Possible values include: 'SystemAssigned' + :type type: str or ~azure.mgmt.hybridcompute.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(ResourceModelWithAllowedPropertySetIdentity, self).__init__(type=type, **kwargs) + + +class ResourceModelWithAllowedPropertySetPlan(Plan): + """ResourceModelWithAllowedPropertySetPlan. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. A user defined name of the 3rd Party Artifact that + is being procured. + :type name: str + :param publisher: Required. The publisher of the 3rd Party Artifact that + is being bought. E.g. NewRelic + :type publisher: str + :param product: Required. The 3rd Party artifact that is being procured. + E.g. NewRelic. Product maps to the OfferID specified for the artifact at + the time of Data Market onboarding. + :type product: str + :param promotion_code: A publisher provided promotion code as provisioned + in Data Market for the said product/artifact. + :type promotion_code: str + :param version: The version of the desired product/artifact. + :type version: str + """ + + _validation = { + 'name': {'required': True}, + 'publisher': {'required': True}, + 'product': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, name: str, publisher: str, product: str, promotion_code: str=None, version: str=None, **kwargs) -> None: + super(ResourceModelWithAllowedPropertySetPlan, self).__init__(name=name, publisher=publisher, product=product, promotion_code=promotion_code, version=version, **kwargs) + + +class Sku(Model): + """The resource model definition representing SKU. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the SKU. Ex - P3. It is typically a + letter+number code + :type name: str + :param tier: This field is required to be implemented by the Resource + Provider if the service has more than one tier, but is not required on a + PUT. Possible values include: 'Free', 'Basic', 'Standard', 'Premium' + :type tier: str or ~azure.mgmt.hybridcompute.models.SkuTier + :param size: The SKU size. When the name field is the combination of tier + and some other value, this would be the standalone code. + :type size: str + :param family: If the service has different generations of hardware, for + the same SKU, then that can be captured here. + :type family: str + :param capacity: If the SKU supports scale out/in then the capacity + integer should be included. If scale out/in is not possible for the + resource this may be omitted. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name: str, tier=None, size: str=None, family: str=None, capacity: int=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.size = size + self.family = family + self.capacity = capacity + + +class ResourceModelWithAllowedPropertySetSku(Sku): + """ResourceModelWithAllowedPropertySetSku. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the SKU. Ex - P3. It is typically a + letter+number code + :type name: str + :param tier: This field is required to be implemented by the Resource + Provider if the service has more than one tier, but is not required on a + PUT. Possible values include: 'Free', 'Basic', 'Standard', 'Premium' + :type tier: str or ~azure.mgmt.hybridcompute.models.SkuTier + :param size: The SKU size. When the name field is the combination of tier + and some other value, this would be the standalone code. + :type size: str + :param family: If the service has different generations of hardware, for + the same SKU, then that can be captured here. + :type family: str + :param capacity: If the SKU supports scale out/in then the capacity + integer should be included. If scale out/in is not possible for the + resource this may be omitted. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name: str, tier=None, size: str=None, family: str=None, capacity: int=None, **kwargs) -> None: + super(ResourceModelWithAllowedPropertySetSku, self).__init__(name=name, tier=tier, size=size, family=family, capacity=capacity, **kwargs) diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_paged_models.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_paged_models.py index 8e8b15b0e2db..a24959c9dfe8 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_paged_models.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/models/_paged_models.py @@ -25,6 +25,19 @@ class MachinePaged(Paged): def __init__(self, *args, **kwargs): super(MachinePaged, self).__init__(*args, **kwargs) +class MachineExtensionPaged(Paged): + """ + A paging container for iterating over a list of :class:`MachineExtension ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[MachineExtension]'} + } + + def __init__(self, *args, **kwargs): + + super(MachineExtensionPaged, self).__init__(*args, **kwargs) class OperationValuePaged(Paged): """ A paging container for iterating over a list of :class:`OperationValue ` object diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/__init__.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/__init__.py index 1c97029146bd..f362d1375d66 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/__init__.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/__init__.py @@ -10,9 +10,11 @@ # -------------------------------------------------------------------------- from ._machines_operations import MachinesOperations +from ._machine_extensions_operations import MachineExtensionsOperations from ._operations import Operations __all__ = [ 'MachinesOperations', + 'MachineExtensionsOperations', 'Operations', ] diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_extensions_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_extensions_operations.py new file mode 100644 index 000000000000..fe68e00e52fd --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machine_extensions_operations.py @@ -0,0 +1,480 @@ +# 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 msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class MachineExtensionsOperations(object): + """MachineExtensionsOperations 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 API version to use for this operation. Constant value: "2019-12-12". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-12-12" + + self.config = config + + + def _create_or_update_initial( + self, resource_group_name, name, extension_name, extension_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # 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(extension_parameters, 'MachineExtension') + + # 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, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('MachineExtension', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, name, extension_name, extension_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """The operation to create or update the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param name: The name of the machine where the extension should be + created or updated. + :type name: str + :param extension_name: The name of the machine extension. + :type extension_name: str + :param extension_parameters: Parameters supplied to the Create Machine + Extension operation. + :type extension_parameters: + ~azure.mgmt.hybridcompute.models.MachineExtension + :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 MachineExtension or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.hybridcompute.models.MachineExtension] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.hybridcompute.models.MachineExtension]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + extension_name=extension_name, + extension_parameters=extension_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('MachineExtension', 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_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} + + + def _update_initial( + self, resource_group_name, name, extension_name, extension_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # 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(extension_parameters, 'MachineExtensionUpdate') + + # 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, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('MachineExtension', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, name, extension_name, extension_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """The operation to create or update the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param name: The name of the machine where the extension should be + created or updated. + :type name: str + :param extension_name: The name of the machine extension. + :type extension_name: str + :param extension_parameters: Parameters supplied to the Create Machine + Extension operation. + :type extension_parameters: + ~azure.mgmt.hybridcompute.models.MachineExtensionUpdate + :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 MachineExtension or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.hybridcompute.models.MachineExtension] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.hybridcompute.models.MachineExtension]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + name=name, + extension_name=extension_name, + extension_parameters=extension_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('MachineExtension', 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.HybridCompute/machines/{name}/extensions/{extensionName}'} + + + def _delete_initial( + self, resource_group_name, name, extension_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, name, extension_name, custom_headers=None, raw=False, polling=True, **operation_config): + """The operation to delete the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param name: The name of the machine where the extension should be + deleted. + :type name: str + :param extension_name: The name of the machine extension. + :type extension_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:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + name=name, + extension_name=extension_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.HybridCompute/machines/{name}/extensions/{extensionName}'} + + def get( + self, resource_group_name, name, extension_name, custom_headers=None, raw=False, **operation_config): + """The operation to get the extension. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param name: The name of the machine containing the extension. + :type name: str + :param extension_name: The name of the machine extension. + :type extension_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: MachineExtension or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.hybridcompute.models.MachineExtension or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MachineExtension', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions/{extensionName}'} + + def list( + self, resource_group_name, name, expand=None, custom_headers=None, raw=False, **operation_config): + """The operation to get all extensions of a non-Azure machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param name: The name of the machine containing the extension. + :type name: str + :param expand: The expand expression to apply on the operation. + :type expand: 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 MachineExtension + :rtype: + ~azure.mgmt.hybridcompute.models.MachineExtensionPaged[~azure.mgmt.hybridcompute.models.MachineExtension] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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.MachineExtensionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/extensions'} diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machines_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machines_operations.py index 237b9418d415..50b4c43746e7 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machines_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_machines_operations.py @@ -24,7 +24,7 @@ class MachinesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-08-02-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2019-12-12". """ 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-08-02-preview" + self.api_version = "2019-12-12" self.config = config @@ -59,7 +59,7 @@ def delete( # Construct URL url = self.delete.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str') } @@ -67,7 +67,7 @@ def delete( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -117,7 +117,7 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'name': self._serialize.url("name", name, 'str') } @@ -125,9 +125,9 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'InstanceViewTypes') + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') # Construct headers header_parameters = {} @@ -181,14 +181,14 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_resource_group.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -249,13 +249,13 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } 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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_operations.py index 89f5bc9d9deb..2390d2207e1e 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_operations.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/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: Client Api Version. Constant value: "2019-08-02-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2019-12-12". """ 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-08-02-preview" + self.api_version = "2019-12-12" self.config = config @@ -60,7 +60,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/version.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/version.py index d6acfb896eb4..9ed7b1240a1c 100644 --- a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/version.py +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/version.py @@ -9,4 +9,4 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.1" +VERSION = "1.0.0"