From 36a5ce1b2ec4bc4e99a46db7da372bfb805b53ee Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Tue, 1 Sep 2020 02:31:44 +0000 Subject: [PATCH] Generated from 07fcf972e6e2c128fd2a3f9416b08b1dd4869820 update readme.java.med --- .../_hybrid_compute_management_client.py | 24 +- .../mgmt/hybridcompute/models/__init__.py | 71 +- ..._hybrid_compute_management_client_enums.py | 13 +- .../mgmt/hybridcompute/models/_models.py | 681 ++++++++++------- .../mgmt/hybridcompute/models/_models_py3.py | 697 +++++++++++------- .../hybridcompute/models/_paged_models.py | 52 ++ .../mgmt/hybridcompute/operations/__init__.py | 8 + .../_machine_extensions_operations.py | 4 +- .../operations/_machines_operations.py | 4 +- .../hybridcompute/operations/_operations.py | 4 +- ...private_endpoint_connections_operations.py | 377 ++++++++++ .../_private_link_resources_operations.py | 177 +++++ ...rivate_link_scoped_resources_operations.py | 369 ++++++++++ .../_private_link_scopes_operations.py | 460 ++++++++++++ 14 files changed, 2339 insertions(+), 602 deletions(-) create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_resources_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scoped_resources_operations.py create mode 100644 sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scopes_operations.py 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 b85a1ddb5ea2..ac6aa06bfeec 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 @@ -16,11 +16,15 @@ from .operations import MachinesOperations from .operations import MachineExtensionsOperations from .operations import Operations +from .operations import PrivateLinkScopesOperations +from .operations import PrivateLinkResourcesOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkScopedResourcesOperations from . import models class HybridComputeManagementClient(SDKClient): - """The Hybrid Compute Management Client. + """HybridComputeManagementClient :ivar config: Configuration for client. :vartype config: HybridComputeManagementClientConfiguration @@ -31,6 +35,14 @@ class HybridComputeManagementClient(SDKClient): :vartype machine_extensions: azure.mgmt.hybridcompute.operations.MachineExtensionsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.hybridcompute.operations.Operations + :ivar private_link_scopes: PrivateLinkScopes operations + :vartype private_link_scopes: azure.mgmt.hybridcompute.operations.PrivateLinkScopesOperations + :ivar private_link_resources: PrivateLinkResources operations + :vartype private_link_resources: azure.mgmt.hybridcompute.operations.PrivateLinkResourcesOperations + :ivar private_endpoint_connections: PrivateEndpointConnections operations + :vartype private_endpoint_connections: azure.mgmt.hybridcompute.operations.PrivateEndpointConnectionsOperations + :ivar private_link_scoped_resources: PrivateLinkScopedResources operations + :vartype private_link_scoped_resources: azure.mgmt.hybridcompute.operations.PrivateLinkScopedResourcesOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -47,7 +59,7 @@ 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-12-12' + self.api_version = '2020-08-15-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -57,3 +69,11 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) + self.private_link_scopes = PrivateLinkScopesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_link_scoped_resources = PrivateLinkScopedResourcesOperations( + 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 9b6b3fe31865..4c8eb37cf72b 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 @@ -14,6 +14,10 @@ from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import ErrorResponseCommon + from ._models_py3 import ErrorResponseV2, ErrorResponseV2Exception + from ._models_py3 import ErrorResponseV2Error + from ._models_py3 import HybridComputePrivateLinkScope from ._models_py3 import Identity from ._models_py3 import LocationData from ._models_py3 import Machine @@ -27,21 +31,20 @@ 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 PrivateEndpointConnection + from ._models_py3 import PrivateEndpointProperty + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkScopesResource + from ._models_py3 import PrivateLinkServiceConnectionStateProperty 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 ScopedResource + from ._models_py3 import TagsResource from ._models_py3 import TrackedResource from ._models_py3 import UpdateResource except (SyntaxError, ImportError): @@ -49,6 +52,10 @@ from ._models import ErrorAdditionalInfo from ._models import ErrorDetail from ._models import ErrorResponse, ErrorResponseException + from ._models import ErrorResponseCommon + from ._models import ErrorResponseV2, ErrorResponseV2Exception + from ._models import ErrorResponseV2Error + from ._models import HybridComputePrivateLinkScope from ._models import Identity from ._models import LocationData from ._models import Machine @@ -62,31 +69,33 @@ 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 PrivateEndpointConnection + from ._models import PrivateEndpointProperty + from ._models import PrivateLinkResource + from ._models import PrivateLinkScopesResource + from ._models import PrivateLinkServiceConnectionStateProperty 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 ScopedResource + from ._models import TagsResource from ._models import TrackedResource from ._models import UpdateResource +from ._paged_models import HybridComputePrivateLinkScopePaged from ._paged_models import MachineExtensionPaged from ._paged_models import MachinePaged from ._paged_models import OperationValuePaged +from ._paged_models import PrivateEndpointConnectionPaged +from ._paged_models import PrivateLinkResourcePaged +from ._paged_models import ScopedResourcePaged from ._hybrid_compute_management_client_enums import ( StatusTypes, StatusLevelTypes, - SkuTier, - ResourceIdentityType, + PublicNetworkAccessType, InstanceViewTypes, ) @@ -95,6 +104,10 @@ 'ErrorAdditionalInfo', 'ErrorDetail', 'ErrorResponse', 'ErrorResponseException', + 'ErrorResponseCommon', + 'ErrorResponseV2', 'ErrorResponseV2Exception', + 'ErrorResponseV2Error', + 'HybridComputePrivateLinkScope', 'Identity', 'LocationData', 'Machine', @@ -108,29 +121,31 @@ 'MachineIdentity', 'MachineProperties', 'MachinePropertiesOsProfile', - 'MachineReconnect', - 'MachineReconnectProperties', 'MachineUpdate', 'MachineUpdateProperties', 'OperationValue', 'OperationValueDisplayModel', 'OSProfile', - 'Plan', + 'PrivateEndpointConnection', + 'PrivateEndpointProperty', + 'PrivateLinkResource', + 'PrivateLinkScopesResource', + 'PrivateLinkServiceConnectionStateProperty', 'ProxyResource', 'Resource', - 'ResourceModelWithAllowedPropertySet', - 'ResourceModelWithAllowedPropertySetIdentity', - 'ResourceModelWithAllowedPropertySetPlan', - 'ResourceModelWithAllowedPropertySetSku', - 'Sku', + 'ScopedResource', + 'TagsResource', 'TrackedResource', 'UpdateResource', 'MachinePaged', 'MachineExtensionPaged', 'OperationValuePaged', + 'HybridComputePrivateLinkScopePaged', + 'PrivateLinkResourcePaged', + 'PrivateEndpointConnectionPaged', + 'ScopedResourcePaged', 'StatusTypes', 'StatusLevelTypes', - 'SkuTier', - 'ResourceIdentityType', + 'PublicNetworkAccessType', '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 ef4aaa4ef87b..309ef51c86d7 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,17 +26,10 @@ class StatusLevelTypes(str, Enum): error = "Error" -class SkuTier(str, Enum): +class PublicNetworkAccessType(str, Enum): - free = "Free" - basic = "Basic" - standard = "Standard" - premium = "Premium" - - -class ResourceIdentityType(str, Enum): - - system_assigned = "SystemAssigned" + enabled = "Enabled" #: Allows Azure Arc agents to communicate with Azure Arc services over both public (internet) and private endpoints. + disabled = "Disabled" #: Does not allow Azure Arc agents to communicate with Azure Arc services over public (internet) endpoints. The agents must use the private link. class InstanceViewTypes(str, Enum): 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 de392b1ebe36..aadeba3b7b12 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 @@ -159,11 +159,108 @@ def __init__(self, **kwargs): class ErrorResponse(Model): + """Error response. + + Contains details when the response code indicates an error. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. The error details. + :type error: ~azure.mgmt.hybridcompute.models.ErrorDetail + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class ErrorResponseV2(Model): + """The resource management error response. + + :param error: The error object. + :type error: ~azure.mgmt.hybridcompute.models.ErrorResponseV2Error + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseV2Error'}, + } + + def __init__(self, **kwargs): + super(ErrorResponseV2, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseV2Exception(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponseV2'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseV2Exception, self).__init__(deserialize, response, 'ErrorResponseV2', *args) + + +class ErrorResponseCommon(ErrorResponseV2): """The resource management error response. Variables are only populated by the server, and will be ignored when sending a request. + :param error: The error object. + :type error: ~azure.mgmt.hybridcompute.models.ErrorResponseV2Error + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.hybridcompute.models.ErrorResponseCommon] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.hybridcompute.models.ErrorAdditionalInfo] + """ + + _validation = { + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseV2Error'}, + 'details': {'key': 'details', 'type': '[ErrorResponseCommon]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(ErrorResponseCommon, self).__init__(**kwargs) + self.details = None + self.additional_info = None + + +class ErrorResponseV2Error(Model): + """The error object. + + Variables are only populated by the server, and will be ignored when + sending a request. + :ivar code: The error code. :vartype code: str :ivar message: The error message. @@ -171,7 +268,7 @@ class ErrorResponse(Model): :ivar target: The error target. :vartype target: str :ivar details: The error details. - :vartype details: list[~azure.mgmt.hybridcompute.models.ErrorResponse] + :vartype details: list[~azure.mgmt.hybridcompute.models.ErrorResponseV2] :ivar additional_info: The error additional info. :vartype additional_info: list[~azure.mgmt.hybridcompute.models.ErrorAdditionalInfo] @@ -189,12 +286,12 @@ class ErrorResponse(Model): 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'details': {'key': 'details', 'type': '[ErrorResponseV2]'}, 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } def __init__(self, **kwargs): - super(ErrorResponse, self).__init__(**kwargs) + super(ErrorResponseV2Error, self).__init__(**kwargs) self.code = None self.message = None self.target = None @@ -202,30 +299,123 @@ def __init__(self, **kwargs): self.additional_info = None -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. +class PrivateLinkScopesResource(Model): + """An azure resource object. - :param deserialize: A deserializer - :param response: Server response to be deserialized. + 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: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] """ - def __init__(self, deserialize, response, *args): + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkScopesResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class HybridComputePrivateLinkScope(PrivateLinkScopesResource): + """An Azure Arc PrivateLinkScope definition. + + 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: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param public_network_access: Indicates whether machines associated with + the private link scope can also use public Azure Arc service endpoints. + Possible values include: 'Enabled', 'Disabled'. Default value: "Disabled" + . + :type public_network_access: str or + ~azure.mgmt.hybridcompute.models.PublicNetworkAccessType + :ivar provisioning_state: Current state of this PrivateLinkScope: whether + or not is has been provisioned within the resource group it is defined. + Users cannot change this value but are able to read from it. Values will + include Provisioning ,Succeeded, Canceled and Failed. + :vartype provisioning_state: str + :ivar private_endpoint_connections: List of private endpoint connections. + :vartype private_endpoint_connections: + list[~azure.mgmt.hybridcompute.models.PrivateEndpointConnection] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'private_endpoint_connections': {'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}'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__(self, **kwargs): + super(HybridComputePrivateLinkScope, self).__init__(**kwargs) + self.public_network_access = kwargs.get('public_network_access', "Disabled") + self.provisioning_state = None + self.private_endpoint_connections = None class Identity(Model): - """Identity for the resource. + """Managed Identity. Variables are only populated by the server, and will be ignored when sending a request. - :ivar principal_id: The principal ID of resource identity. + :param type: The identity type. + :type type: str + :ivar principal_id: The identity's principal id. :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. + :ivar tenant_id: The identity's tenant id. :vartype tenant_id: str - :param type: The identity type. Possible values include: 'SystemAssigned' - :type type: str or ~azure.mgmt.hybridcompute.models.ResourceIdentityType """ _validation = { @@ -234,16 +424,16 @@ class Identity(Model): } _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, '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.type = kwargs.get('type', None) self.principal_id = None self.tenant_id = None - self.type = kwargs.get('type', None) class LocationData(Model): @@ -378,9 +568,22 @@ class Machine(TrackedResource): :ivar os_version: The version of Operating System running on the hybrid machine. :vartype os_version: str + :ivar vm_uuid: Specifies the Arc Machine's unique SMBIOS ID + :vartype vm_uuid: str :param extensions: Machine Extensions information :type extensions: list[~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView] + :ivar os_sku: Specifies the Operating System product SKU. + :vartype os_sku: str + :ivar domain_name: Specifies the Windows domain name. + :vartype domain_name: str + :ivar ad_fqdn: Specifies the AD fully qualified display name. + :vartype ad_fqdn: str + :ivar dns_fqdn: Specifies the DNS fully qualified display name. + :vartype dns_fqdn: str + :ivar private_link_scoped_resources: List of private link scoped resources + associated with this machine. + :vartype private_link_scoped_resources: list[str] :param identity: :type identity: ~azure.mgmt.hybridcompute.models.MachineIdentity """ @@ -399,6 +602,12 @@ class Machine(TrackedResource): 'machine_fqdn': {'readonly': True}, 'os_name': {'readonly': True}, 'os_version': {'readonly': True}, + 'vm_uuid': {'readonly': True}, + 'os_sku': {'readonly': True}, + 'domain_name': {'readonly': True}, + 'ad_fqdn': {'readonly': True}, + 'dns_fqdn': {'readonly': True}, + 'private_link_scoped_resources': {'readonly': True}, } _attribute_map = { @@ -420,7 +629,13 @@ class Machine(TrackedResource): 'client_public_key': {'key': 'properties.clientPublicKey', 'type': 'str'}, 'os_name': {'key': 'properties.osName', 'type': 'str'}, 'os_version': {'key': 'properties.osVersion', 'type': 'str'}, + 'vm_uuid': {'key': 'properties.vmUuid', 'type': 'str'}, 'extensions': {'key': 'properties.extensions', 'type': '[MachineExtensionInstanceView]'}, + 'os_sku': {'key': 'properties.osSku', 'type': 'str'}, + 'domain_name': {'key': 'properties.domainName', 'type': 'str'}, + 'ad_fqdn': {'key': 'properties.adFqdn', 'type': 'str'}, + 'dns_fqdn': {'key': 'properties.dnsFqdn', 'type': 'str'}, + 'private_link_scoped_resources': {'key': 'properties.privateLinkScopedResources', 'type': '[str]'}, 'identity': {'key': 'identity', 'type': 'MachineIdentity'}, } @@ -439,7 +654,13 @@ def __init__(self, **kwargs): self.client_public_key = kwargs.get('client_public_key', None) self.os_name = None self.os_version = None + self.vm_uuid = None self.extensions = kwargs.get('extensions', None) + self.os_sku = None + self.domain_name = None + self.ad_fqdn = None + self.dns_fqdn = None + self.private_link_scoped_resources = None self.identity = kwargs.get('identity', None) @@ -803,12 +1024,12 @@ class MachineIdentity(Identity): Variables are only populated by the server, and will be ignored when sending a request. - :ivar principal_id: The principal ID of resource identity. + :param type: The identity type. + :type type: str + :ivar principal_id: The identity's principal id. :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. + :ivar tenant_id: The identity's tenant id. :vartype tenant_id: str - :param type: The identity type. Possible values include: 'SystemAssigned' - :type type: str or ~azure.mgmt.hybridcompute.models.ResourceIdentityType """ _validation = { @@ -817,9 +1038,9 @@ class MachineIdentity(Identity): } _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, } def __init__(self, **kwargs): @@ -864,9 +1085,22 @@ class MachineProperties(Model): :ivar os_version: The version of Operating System running on the hybrid machine. :vartype os_version: str + :ivar vm_uuid: Specifies the Arc Machine's unique SMBIOS ID + :vartype vm_uuid: str :param extensions: Machine Extensions information :type extensions: list[~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView] + :ivar os_sku: Specifies the Operating System product SKU. + :vartype os_sku: str + :ivar domain_name: Specifies the Windows domain name. + :vartype domain_name: str + :ivar ad_fqdn: Specifies the AD fully qualified display name. + :vartype ad_fqdn: str + :ivar dns_fqdn: Specifies the DNS fully qualified display name. + :vartype dns_fqdn: str + :ivar private_link_scoped_resources: List of private link scoped resources + associated with this machine. + :vartype private_link_scoped_resources: list[str] """ _validation = { @@ -879,6 +1113,12 @@ class MachineProperties(Model): 'machine_fqdn': {'readonly': True}, 'os_name': {'readonly': True}, 'os_version': {'readonly': True}, + 'vm_uuid': {'readonly': True}, + 'os_sku': {'readonly': True}, + 'domain_name': {'readonly': True}, + 'ad_fqdn': {'readonly': True}, + 'dns_fqdn': {'readonly': True}, + 'private_link_scoped_resources': {'readonly': True}, } _attribute_map = { @@ -895,7 +1135,13 @@ class MachineProperties(Model): 'client_public_key': {'key': 'clientPublicKey', 'type': 'str'}, 'os_name': {'key': 'osName', 'type': 'str'}, 'os_version': {'key': 'osVersion', 'type': 'str'}, + 'vm_uuid': {'key': 'vmUuid', 'type': 'str'}, 'extensions': {'key': 'extensions', 'type': '[MachineExtensionInstanceView]'}, + 'os_sku': {'key': 'osSku', 'type': 'str'}, + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'ad_fqdn': {'key': 'adFqdn', 'type': 'str'}, + 'dns_fqdn': {'key': 'dnsFqdn', 'type': 'str'}, + 'private_link_scoped_resources': {'key': 'privateLinkScopedResources', 'type': '[str]'}, } def __init__(self, **kwargs): @@ -913,7 +1159,13 @@ def __init__(self, **kwargs): self.client_public_key = kwargs.get('client_public_key', None) self.os_name = None self.os_version = None + self.vm_uuid = None self.extensions = kwargs.get('extensions', None) + self.os_sku = None + self.domain_name = None + self.ad_fqdn = None + self.dns_fqdn = None + self.private_link_scoped_resources = None class OSProfile(Model): @@ -961,48 +1213,6 @@ 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. @@ -1011,12 +1221,12 @@ class MachineUpdate(UpdateResource): :param tags: Resource tags :type tags: dict[str, str] - :ivar principal_id: The principal ID of resource identity. + :param type: The identity type. + :type type: str + :ivar principal_id: The identity's principal id. :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. + :ivar tenant_id: The identity's tenant id. :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 """ @@ -1028,17 +1238,17 @@ 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'}, - '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.type = kwargs.get('type', None) self.location_data = kwargs.get('location_data', None) @@ -1144,51 +1354,6 @@ def __init__(self, **kwargs): 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. @@ -1222,10 +1387,8 @@ 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. +class PrivateEndpointConnection(ProxyResource): + """A private endpoint connection. Variables are only populated by the server, and will be ignored when sending a request. @@ -1236,227 +1399,197 @@ class ResourceModelWithAllowedPropertySet(Model): :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.. + 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 + :param private_endpoint: Private endpoint which the connection belongs to. + :type private_endpoint: + ~azure.mgmt.hybridcompute.models.PrivateEndpointProperty + :param private_link_service_connection_state: Connection state of the + private endpoint connection. + :type private_link_service_connection_state: + ~azure.mgmt.hybridcompute.models.PrivateLinkServiceConnectionStateProperty + :ivar provisioning_state: State of the private endpoint connection. + :vartype provisioning_state: str """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, - 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - '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'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpointProperty'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionStateProperty'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } 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) + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = None + + +class PrivateEndpointProperty(Model): + """Private endpoint which the connection belongs to. + + :param id: Resource id of the private endpoint. + :type id: str + """ + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } -class ResourceModelWithAllowedPropertySetIdentity(Identity): - """ResourceModelWithAllowedPropertySetIdentity. + def __init__(self, **kwargs): + super(PrivateEndpointProperty, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class PrivateLinkResource(ProxyResource): + """A private link 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 + :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 group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :ivar required_zone_names: Required DNS zone names of the the private link + resource. + :vartype required_zone_names: list[str] """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + 'required_zone_names': {'readonly': True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, } def __init__(self, **kwargs): - super(ResourceModelWithAllowedPropertySetIdentity, self).__init__(**kwargs) + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = None -class ResourceModelWithAllowedPropertySetPlan(Plan): - """ResourceModelWithAllowedPropertySetPlan. +class PrivateLinkServiceConnectionStateProperty(Model): + """State of the private endpoint connection. + + Variables are only populated by the server, and will be ignored when + sending a request. All required parameters must be populated in order to send to Azure. - :param name: Required. 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 + :param status: Required. The private link service connection status. + :type status: str + :param description: Required. The private link service connection + description. + :type description: str + :ivar actions_required: The actions required for private link service + connection. + :vartype actions_required: str """ _validation = { - 'name': {'required': True}, - 'publisher': {'required': True}, - 'product': {'required': True}, + 'status': {'required': True}, + 'description': {'required': True}, + 'actions_required': {'readonly': 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'}, + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, } def __init__(self, **kwargs): - super(ResourceModelWithAllowedPropertySetPlan, self).__init__(**kwargs) + super(PrivateLinkServiceConnectionStateProperty, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = None -class Sku(Model): - """The resource model definition representing SKU. +class ScopedResource(ProxyResource): + """A private link scoped resource. - 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 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 + :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 linked_resource_id: The resource id of the scoped Azure monitor + resource. + :type linked_resource_id: str + :ivar provisioning_state: State of the private endpoint connection. + :vartype provisioning_state: str """ _validation = { - 'name': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, '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'}, + 'type': {'key': 'type', 'type': 'str'}, + 'linked_resource_id': {'key': 'properties.linkedResourceId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } 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) - + super(ScopedResource, self).__init__(**kwargs) + self.linked_resource_id = kwargs.get('linked_resource_id', None) + self.provisioning_state = None -class ResourceModelWithAllowedPropertySetSku(Sku): - """ResourceModelWithAllowedPropertySetSku. - All required parameters must be populated in order to send to Azure. +class TagsResource(Model): + """A container holding only the Tags for a resource, allowing the user to + update the tags on a PrivateLinkScope instance. - :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 + :param tags: Resource tags + :type tags: dict[str, str] """ - _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, } def __init__(self, **kwargs): - super(ResourceModelWithAllowedPropertySetSku, self).__init__(**kwargs) + super(TagsResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) 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 2c7a439dfe07..64d53ffe7a93 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 @@ -159,11 +159,108 @@ def __init__(self, *, code: str, message: str, target: str=None, details=None, * class ErrorResponse(Model): + """Error response. + + Contains details when the response code indicates an error. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. The error details. + :type error: ~azure.mgmt.hybridcompute.models.ErrorDetail + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__(self, *, error, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class ErrorResponseV2(Model): + """The resource management error response. + + :param error: The error object. + :type error: ~azure.mgmt.hybridcompute.models.ErrorResponseV2Error + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseV2Error'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponseV2, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseV2Exception(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponseV2'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseV2Exception, self).__init__(deserialize, response, 'ErrorResponseV2', *args) + + +class ErrorResponseCommon(ErrorResponseV2): """The resource management error response. Variables are only populated by the server, and will be ignored when sending a request. + :param error: The error object. + :type error: ~azure.mgmt.hybridcompute.models.ErrorResponseV2Error + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.hybridcompute.models.ErrorResponseCommon] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.hybridcompute.models.ErrorAdditionalInfo] + """ + + _validation = { + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseV2Error'}, + 'details': {'key': 'details', 'type': '[ErrorResponseCommon]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponseCommon, self).__init__(error=error, **kwargs) + self.details = None + self.additional_info = None + + +class ErrorResponseV2Error(Model): + """The error object. + + Variables are only populated by the server, and will be ignored when + sending a request. + :ivar code: The error code. :vartype code: str :ivar message: The error message. @@ -171,7 +268,7 @@ class ErrorResponse(Model): :ivar target: The error target. :vartype target: str :ivar details: The error details. - :vartype details: list[~azure.mgmt.hybridcompute.models.ErrorResponse] + :vartype details: list[~azure.mgmt.hybridcompute.models.ErrorResponseV2] :ivar additional_info: The error additional info. :vartype additional_info: list[~azure.mgmt.hybridcompute.models.ErrorAdditionalInfo] @@ -189,12 +286,12 @@ class ErrorResponse(Model): 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'details': {'key': 'details', 'type': '[ErrorResponseV2]'}, 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } def __init__(self, **kwargs) -> None: - super(ErrorResponse, self).__init__(**kwargs) + super(ErrorResponseV2Error, self).__init__(**kwargs) self.code = None self.message = None self.target = None @@ -202,30 +299,123 @@ def __init__(self, **kwargs) -> None: self.additional_info = None -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. +class PrivateLinkScopesResource(Model): + """An azure resource object. - :param deserialize: A deserializer - :param response: Server response to be deserialized. + 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: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] """ - def __init__(self, deserialize, response, *args): + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(PrivateLinkScopesResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class HybridComputePrivateLinkScope(PrivateLinkScopesResource): + """An Azure Arc PrivateLinkScope definition. + + 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: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param public_network_access: Indicates whether machines associated with + the private link scope can also use public Azure Arc service endpoints. + Possible values include: 'Enabled', 'Disabled'. Default value: "Disabled" + . + :type public_network_access: str or + ~azure.mgmt.hybridcompute.models.PublicNetworkAccessType + :ivar provisioning_state: Current state of this PrivateLinkScope: whether + or not is has been provisioned within the resource group it is defined. + Users cannot change this value but are able to read from it. Values will + include Provisioning ,Succeeded, Canceled and Failed. + :vartype provisioning_state: str + :ivar private_endpoint_connections: List of private endpoint connections. + :vartype private_endpoint_connections: + list[~azure.mgmt.hybridcompute.models.PrivateEndpointConnection] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'private_endpoint_connections': {'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}'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__(self, *, location: str, tags=None, public_network_access="Disabled", **kwargs) -> None: + super(HybridComputePrivateLinkScope, self).__init__(location=location, tags=tags, **kwargs) + self.public_network_access = public_network_access + self.provisioning_state = None + self.private_endpoint_connections = None class Identity(Model): - """Identity for the resource. + """Managed Identity. Variables are only populated by the server, and will be ignored when sending a request. - :ivar principal_id: The principal ID of resource identity. + :param type: The identity type. + :type type: str + :ivar principal_id: The identity's principal id. :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. + :ivar tenant_id: The identity's tenant id. :vartype tenant_id: str - :param type: The identity type. Possible values include: 'SystemAssigned' - :type type: str or ~azure.mgmt.hybridcompute.models.ResourceIdentityType """ _validation = { @@ -234,16 +424,16 @@ class Identity(Model): } _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, } - def __init__(self, *, type=None, **kwargs) -> None: + def __init__(self, *, type: str=None, **kwargs) -> None: super(Identity, self).__init__(**kwargs) + self.type = type self.principal_id = None self.tenant_id = None - self.type = type class LocationData(Model): @@ -378,9 +568,22 @@ class Machine(TrackedResource): :ivar os_version: The version of Operating System running on the hybrid machine. :vartype os_version: str + :ivar vm_uuid: Specifies the Arc Machine's unique SMBIOS ID + :vartype vm_uuid: str :param extensions: Machine Extensions information :type extensions: list[~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView] + :ivar os_sku: Specifies the Operating System product SKU. + :vartype os_sku: str + :ivar domain_name: Specifies the Windows domain name. + :vartype domain_name: str + :ivar ad_fqdn: Specifies the AD fully qualified display name. + :vartype ad_fqdn: str + :ivar dns_fqdn: Specifies the DNS fully qualified display name. + :vartype dns_fqdn: str + :ivar private_link_scoped_resources: List of private link scoped resources + associated with this machine. + :vartype private_link_scoped_resources: list[str] :param identity: :type identity: ~azure.mgmt.hybridcompute.models.MachineIdentity """ @@ -399,6 +602,12 @@ class Machine(TrackedResource): 'machine_fqdn': {'readonly': True}, 'os_name': {'readonly': True}, 'os_version': {'readonly': True}, + 'vm_uuid': {'readonly': True}, + 'os_sku': {'readonly': True}, + 'domain_name': {'readonly': True}, + 'ad_fqdn': {'readonly': True}, + 'dns_fqdn': {'readonly': True}, + 'private_link_scoped_resources': {'readonly': True}, } _attribute_map = { @@ -420,7 +629,13 @@ class Machine(TrackedResource): 'client_public_key': {'key': 'properties.clientPublicKey', 'type': 'str'}, 'os_name': {'key': 'properties.osName', 'type': 'str'}, 'os_version': {'key': 'properties.osVersion', 'type': 'str'}, + 'vm_uuid': {'key': 'properties.vmUuid', 'type': 'str'}, 'extensions': {'key': 'properties.extensions', 'type': '[MachineExtensionInstanceView]'}, + 'os_sku': {'key': 'properties.osSku', 'type': 'str'}, + 'domain_name': {'key': 'properties.domainName', 'type': 'str'}, + 'ad_fqdn': {'key': 'properties.adFqdn', 'type': 'str'}, + 'dns_fqdn': {'key': 'properties.dnsFqdn', 'type': 'str'}, + 'private_link_scoped_resources': {'key': 'properties.privateLinkScopedResources', 'type': '[str]'}, 'identity': {'key': 'identity', 'type': 'MachineIdentity'}, } @@ -439,7 +654,13 @@ def __init__(self, *, location: str, tags=None, location_data=None, os_profile=N self.client_public_key = client_public_key self.os_name = None self.os_version = None + self.vm_uuid = None self.extensions = extensions + self.os_sku = None + self.domain_name = None + self.ad_fqdn = None + self.dns_fqdn = None + self.private_link_scoped_resources = None self.identity = identity @@ -803,12 +1024,12 @@ class MachineIdentity(Identity): Variables are only populated by the server, and will be ignored when sending a request. - :ivar principal_id: The principal ID of resource identity. + :param type: The identity type. + :type type: str + :ivar principal_id: The identity's principal id. :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. + :ivar tenant_id: The identity's tenant id. :vartype tenant_id: str - :param type: The identity type. Possible values include: 'SystemAssigned' - :type type: str or ~azure.mgmt.hybridcompute.models.ResourceIdentityType """ _validation = { @@ -817,12 +1038,12 @@ class MachineIdentity(Identity): } _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, } - def __init__(self, *, type=None, **kwargs) -> None: + def __init__(self, *, type: str=None, **kwargs) -> None: super(MachineIdentity, self).__init__(type=type, **kwargs) @@ -864,9 +1085,22 @@ class MachineProperties(Model): :ivar os_version: The version of Operating System running on the hybrid machine. :vartype os_version: str + :ivar vm_uuid: Specifies the Arc Machine's unique SMBIOS ID + :vartype vm_uuid: str :param extensions: Machine Extensions information :type extensions: list[~azure.mgmt.hybridcompute.models.MachineExtensionInstanceView] + :ivar os_sku: Specifies the Operating System product SKU. + :vartype os_sku: str + :ivar domain_name: Specifies the Windows domain name. + :vartype domain_name: str + :ivar ad_fqdn: Specifies the AD fully qualified display name. + :vartype ad_fqdn: str + :ivar dns_fqdn: Specifies the DNS fully qualified display name. + :vartype dns_fqdn: str + :ivar private_link_scoped_resources: List of private link scoped resources + associated with this machine. + :vartype private_link_scoped_resources: list[str] """ _validation = { @@ -879,6 +1113,12 @@ class MachineProperties(Model): 'machine_fqdn': {'readonly': True}, 'os_name': {'readonly': True}, 'os_version': {'readonly': True}, + 'vm_uuid': {'readonly': True}, + 'os_sku': {'readonly': True}, + 'domain_name': {'readonly': True}, + 'ad_fqdn': {'readonly': True}, + 'dns_fqdn': {'readonly': True}, + 'private_link_scoped_resources': {'readonly': True}, } _attribute_map = { @@ -895,7 +1135,13 @@ class MachineProperties(Model): 'client_public_key': {'key': 'clientPublicKey', 'type': 'str'}, 'os_name': {'key': 'osName', 'type': 'str'}, 'os_version': {'key': 'osVersion', 'type': 'str'}, + 'vm_uuid': {'key': 'vmUuid', 'type': 'str'}, 'extensions': {'key': 'extensions', 'type': '[MachineExtensionInstanceView]'}, + 'os_sku': {'key': 'osSku', 'type': 'str'}, + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'ad_fqdn': {'key': 'adFqdn', 'type': 'str'}, + 'dns_fqdn': {'key': 'dnsFqdn', 'type': 'str'}, + 'private_link_scoped_resources': {'key': 'privateLinkScopedResources', 'type': '[str]'}, } def __init__(self, *, location_data=None, os_profile=None, vm_id: str=None, client_public_key: str=None, extensions=None, **kwargs) -> None: @@ -913,7 +1159,13 @@ def __init__(self, *, location_data=None, os_profile=None, vm_id: str=None, clie self.client_public_key = client_public_key self.os_name = None self.os_version = None + self.vm_uuid = None self.extensions = extensions + self.os_sku = None + self.domain_name = None + self.ad_fqdn = None + self.dns_fqdn = None + self.private_link_scoped_resources = None class OSProfile(Model): @@ -961,48 +1213,6 @@ 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. @@ -1011,12 +1221,12 @@ class MachineUpdate(UpdateResource): :param tags: Resource tags :type tags: dict[str, str] - :ivar principal_id: The principal ID of resource identity. + :param type: The identity type. + :type type: str + :ivar principal_id: The identity's principal id. :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. + :ivar tenant_id: The identity's tenant id. :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 """ @@ -1028,17 +1238,17 @@ 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'}, - 'type': {'key': 'identity.type', 'type': 'ResourceIdentityType'}, 'location_data': {'key': 'properties.locationData', 'type': 'LocationData'}, } - def __init__(self, *, tags=None, type=None, location_data=None, **kwargs) -> None: + def __init__(self, *, tags=None, type: str=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.type = type self.location_data = location_data @@ -1144,51 +1354,6 @@ def __init__(self, **kwargs) -> 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. @@ -1222,10 +1387,8 @@ 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. +class PrivateEndpointConnection(ProxyResource): + """A private endpoint connection. Variables are only populated by the server, and will be ignored when sending a request. @@ -1236,227 +1399,197 @@ class ResourceModelWithAllowedPropertySet(Model): :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.. + 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 + :param private_endpoint: Private endpoint which the connection belongs to. + :type private_endpoint: + ~azure.mgmt.hybridcompute.models.PrivateEndpointProperty + :param private_link_service_connection_state: Connection state of the + private endpoint connection. + :type private_link_service_connection_state: + ~azure.mgmt.hybridcompute.models.PrivateLinkServiceConnectionStateProperty + :ivar provisioning_state: State of the private endpoint connection. + :vartype provisioning_state: str """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'kind': {'pattern': r'^[-\w\._,\(\)]+$'}, - 'etag': {'readonly': True}, + 'provisioning_state': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - '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'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpointProperty'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionStateProperty'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - 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 + def __init__(self, *, private_endpoint=None, private_link_service_connection_state=None, **kwargs) -> None: + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = None -class ResourceModelWithAllowedPropertySetIdentity(Identity): - """ResourceModelWithAllowedPropertySetIdentity. +class PrivateEndpointProperty(Model): + """Private endpoint which the connection belongs to. + + :param id: Resource id of the private endpoint. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(PrivateEndpointProperty, self).__init__(**kwargs) + self.id = id + + +class PrivateLinkResource(ProxyResource): + """A private link 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 + :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 group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :ivar required_zone_names: Required DNS zone names of the the private link + resource. + :vartype required_zone_names: list[str] """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + 'required_zone_names': {'readonly': True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, } - def __init__(self, *, type=None, **kwargs) -> None: - super(ResourceModelWithAllowedPropertySetIdentity, self).__init__(type=type, **kwargs) + def __init__(self, **kwargs) -> None: + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = None + +class PrivateLinkServiceConnectionStateProperty(Model): + """State of the private endpoint connection. -class ResourceModelWithAllowedPropertySetPlan(Plan): - """ResourceModelWithAllowedPropertySetPlan. + Variables are only populated by the server, and will be ignored when + sending a request. All required parameters must be populated in order to send to Azure. - :param name: Required. 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 + :param status: Required. The private link service connection status. + :type status: str + :param description: Required. The private link service connection + description. + :type description: str + :ivar actions_required: The actions required for private link service + connection. + :vartype actions_required: str """ _validation = { - 'name': {'required': True}, - 'publisher': {'required': True}, - 'product': {'required': True}, + 'status': {'required': True}, + 'description': {'required': True}, + 'actions_required': {'readonly': 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'}, + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', '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) + def __init__(self, *, status: str, description: str, **kwargs) -> None: + super(PrivateLinkServiceConnectionStateProperty, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = None -class Sku(Model): - """The resource model definition representing SKU. +class ScopedResource(ProxyResource): + """A private link scoped resource. - 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 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 + :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 linked_resource_id: The resource id of the scoped Azure monitor + resource. + :type linked_resource_id: str + :ivar provisioning_state: State of the private endpoint connection. + :vartype provisioning_state: str """ _validation = { - 'name': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, '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'}, + 'type': {'key': 'type', 'type': 'str'}, + 'linked_resource_id': {'key': 'properties.linkedResourceId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - 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 - + def __init__(self, *, linked_resource_id: str=None, **kwargs) -> None: + super(ScopedResource, self).__init__(**kwargs) + self.linked_resource_id = linked_resource_id + self.provisioning_state = None -class ResourceModelWithAllowedPropertySetSku(Sku): - """ResourceModelWithAllowedPropertySetSku. - All required parameters must be populated in order to send to Azure. +class TagsResource(Model): + """A container holding only the Tags for a resource, allowing the user to + update the tags on a PrivateLinkScope instance. - :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 + :param tags: Resource tags + :type tags: dict[str, str] """ - _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, } - 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) + def __init__(self, *, tags=None, **kwargs) -> None: + super(TagsResource, self).__init__(**kwargs) + self.tags = tags 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 a24959c9dfe8..e2799990357d 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 @@ -51,3 +51,55 @@ class OperationValuePaged(Paged): def __init__(self, *args, **kwargs): super(OperationValuePaged, self).__init__(*args, **kwargs) +class HybridComputePrivateLinkScopePaged(Paged): + """ + A paging container for iterating over a list of :class:`HybridComputePrivateLinkScope ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[HybridComputePrivateLinkScope]'} + } + + def __init__(self, *args, **kwargs): + + super(HybridComputePrivateLinkScopePaged, self).__init__(*args, **kwargs) +class PrivateLinkResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`PrivateLinkResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PrivateLinkResource]'} + } + + def __init__(self, *args, **kwargs): + + super(PrivateLinkResourcePaged, self).__init__(*args, **kwargs) +class PrivateEndpointConnectionPaged(Paged): + """ + A paging container for iterating over a list of :class:`PrivateEndpointConnection ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PrivateEndpointConnection]'} + } + + def __init__(self, *args, **kwargs): + + super(PrivateEndpointConnectionPaged, self).__init__(*args, **kwargs) +class ScopedResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`ScopedResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ScopedResource]'} + } + + def __init__(self, *args, **kwargs): + + super(ScopedResourcePaged, self).__init__(*args, **kwargs) 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 f362d1375d66..b5067b8a547c 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 @@ -12,9 +12,17 @@ from ._machines_operations import MachinesOperations from ._machine_extensions_operations import MachineExtensionsOperations from ._operations import Operations +from ._private_link_scopes_operations import PrivateLinkScopesOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_scoped_resources_operations import PrivateLinkScopedResourcesOperations __all__ = [ 'MachinesOperations', 'MachineExtensionsOperations', 'Operations', + 'PrivateLinkScopesOperations', + 'PrivateLinkResourcesOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkScopedResourcesOperations', ] 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 index fe68e00e52fd..c085c96524b5 100644 --- 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 @@ -27,7 +27,7 @@ class MachineExtensionsOperations(object): :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". + :ivar api_version: The API version to use for this operation. Constant value: "2020-08-15-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-12" + self.api_version = "2020-08-15-preview" self.config = config 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 50b4c43746e7..28be8acb02d0 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: The API version to use for this operation. Constant value: "2019-12-12". + :ivar api_version: The API version to use for this operation. Constant value: "2020-08-15-preview". """ 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-12-12" + self.api_version = "2020-08-15-preview" self.config = config 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 2390d2207e1e..afd483c82bf7 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: The API version to use for this operation. Constant value: "2019-12-12". + :ivar api_version: The API version to use for this operation. Constant value: "2020-08-15-preview". """ 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-12-12" + self.api_version = "2020-08-15-preview" self.config = config diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_endpoint_connections_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..9b9da9cc5532 --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,377 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations 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: "2020-08-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-08-15-preview" + + self.config = config + + def get( + self, resource_group_name, scope_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + """Gets a private endpoint connection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope + resource. + :type scope_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection. + :type private_endpoint_connection_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: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.hybridcompute.models.PrivateEndpointConnection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseV2Exception` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + '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'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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', 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]: + raise models.ErrorResponseV2Exception(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', 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/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + + def _create_or_update_initial( + self, resource_group_name, scope_name, private_endpoint_connection_name, private_endpoint=None, private_link_service_connection_state=None, custom_headers=None, raw=False, **operation_config): + parameters = models.PrivateEndpointConnection(private_endpoint=private_endpoint, private_link_service_connection_state=private_link_service_connection_state) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + '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'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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', 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(parameters, 'PrivateEndpointConnection') + + # 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]: + raise models.ErrorResponseV2Exception(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, scope_name, private_endpoint_connection_name, private_endpoint=None, private_link_service_connection_state=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope + resource. + :type scope_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection. + :type private_endpoint_connection_name: str + :param private_endpoint: Private endpoint which the connection belongs + to. + :type private_endpoint: + ~azure.mgmt.hybridcompute.models.PrivateEndpointProperty + :param private_link_service_connection_state: Connection state of the + private endpoint connection. + :type private_link_service_connection_state: + ~azure.mgmt.hybridcompute.models.PrivateLinkServiceConnectionStateProperty + :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 + PrivateEndpointConnection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.hybridcompute.models.PrivateEndpointConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.hybridcompute.models.PrivateEndpointConnection]] + :raises: + :class:`ErrorResponseV2Exception` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + scope_name=scope_name, + private_endpoint_connection_name=private_endpoint_connection_name, + private_endpoint=private_endpoint, + private_link_service_connection_state=private_link_service_connection_state, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PrivateEndpointConnection', 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/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + + def _delete_initial( + self, resource_group_name, scope_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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', 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]: + raise models.ErrorResponseV2Exception(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, scope_name, private_endpoint_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope + resource. + :type scope_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection. + :type private_endpoint_connection_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:`ErrorResponseV2Exception` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + scope_name=scope_name, + private_endpoint_connection_name=private_endpoint_connection_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/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + def list_by_private_link_scope( + self, resource_group_name, scope_name, custom_headers=None, raw=False, **operation_config): + """Gets all private endpoint connections on a private link scope. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope + resource. + :type scope_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PrivateEndpointConnection + :rtype: + ~azure.mgmt.hybridcompute.models.PrivateEndpointConnectionPaged[~azure.mgmt.hybridcompute.models.PrivateEndpointConnection] + :raises: + :class:`ErrorResponseV2Exception` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_private_link_scope.metadata['url'] + path_format_arguments = { + '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'), + 'scopeName': self._serialize.url("scope_name", scope_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', 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]: + raise models.ErrorResponseV2Exception(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateEndpointConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_private_link_scope.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections'} diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_resources_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..0ae6ac81115b --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_resources_operations.py @@ -0,0 +1,177 @@ +# 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 .. import models + + +class PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations 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: "2020-08-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-08-15-preview" + + self.config = config + + def list_by_private_link_scope( + self, resource_group_name, scope_name, custom_headers=None, raw=False, **operation_config): + """Gets the private link resources that need to be created for a Azure + Monitor PrivateLinkScope. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope + resource. + :type scope_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PrivateLinkResource + :rtype: + ~azure.mgmt.hybridcompute.models.PrivateLinkResourcePaged[~azure.mgmt.hybridcompute.models.PrivateLinkResource] + :raises: + :class:`ErrorResponseV2Exception` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_private_link_scope.metadata['url'] + path_format_arguments = { + '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'), + 'scopeName': self._serialize.url("scope_name", scope_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', 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]: + raise models.ErrorResponseV2Exception(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateLinkResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_private_link_scope.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateLinkResources'} + + def get( + self, resource_group_name, scope_name, group_name, custom_headers=None, raw=False, **operation_config): + """Gets the private link resources that need to be created for a Azure + Monitor PrivateLinkScope. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope + resource. + :type scope_name: str + :param group_name: The name of the private link resource. + :type group_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: PrivateLinkResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.hybridcompute.models.PrivateLinkResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseV2Exception` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + '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'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'groupName': self._serialize.url("group_name", 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', 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]: + raise models.ErrorResponseV2Exception(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkResource', 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/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}'} diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scoped_resources_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scoped_resources_operations.py new file mode 100644 index 000000000000..eb555bc03a0c --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scoped_resources_operations.py @@ -0,0 +1,369 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class PrivateLinkScopedResourcesOperations(object): + """PrivateLinkScopedResourcesOperations 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: "2020-08-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-08-15-preview" + + self.config = config + + def get( + self, resource_group_name, scope_name, name, custom_headers=None, raw=False, **operation_config): + """Gets a scoped resource in a private link scope. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope + resource. + :type scope_name: str + :param name: The name of the scoped resource object. + :type 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: ScopedResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.hybridcompute.models.ScopedResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseV2Exception` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + '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'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'name': self._serialize.url("name", 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', 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]: + raise models.ErrorResponseV2Exception(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ScopedResource', 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/privateLinkScopes/{scopeName}/scopedResources/{name}'} + + + def _create_or_update_initial( + self, resource_group_name, scope_name, name, linked_resource_id=None, custom_headers=None, raw=False, **operation_config): + parameters = models.ScopedResource(linked_resource_id=linked_resource_id) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + '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'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'name': self._serialize.url("name", 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', 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(parameters, 'ScopedResource') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + raise models.ErrorResponseV2Exception(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ScopedResource', response) + if response.status_code == 201: + deserialized = self._deserialize('ScopedResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, scope_name, name, linked_resource_id=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope + resource. + :type scope_name: str + :param name: The name of the scoped resource object. + :type name: str + :param linked_resource_id: The resource id of the scoped Azure monitor + resource. + :type linked_resource_id: 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 ScopedResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.hybridcompute.models.ScopedResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.hybridcompute.models.ScopedResource]] + :raises: + :class:`ErrorResponseV2Exception` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + scope_name=scope_name, + name=name, + linked_resource_id=linked_resource_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ScopedResource', 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/privateLinkScopes/{scopeName}/scopedResources/{name}'} + + + def _delete_initial( + self, resource_group_name, scope_name, name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), + 'name': self._serialize.url("name", 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', 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]: + raise models.ErrorResponseV2Exception(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, scope_name, name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope + resource. + :type scope_name: str + :param name: The name of the scoped resource object. + :type 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:`ErrorResponseV2Exception` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + scope_name=scope_name, + name=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/privateLinkScopes/{scopeName}/scopedResources/{name}'} + + def list_by_private_link_scope( + self, resource_group_name, scope_name, custom_headers=None, raw=False, **operation_config): + """Gets all private endpoint connections on a private link scope. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope + resource. + :type scope_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ScopedResource + :rtype: + ~azure.mgmt.hybridcompute.models.ScopedResourcePaged[~azure.mgmt.hybridcompute.models.ScopedResource] + :raises: + :class:`ErrorResponseV2Exception` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_private_link_scope.metadata['url'] + path_format_arguments = { + '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'), + 'scopeName': self._serialize.url("scope_name", scope_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', 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]: + raise models.ErrorResponseV2Exception(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ScopedResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_private_link_scope.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/scopedResources'} diff --git a/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scopes_operations.py b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scopes_operations.py new file mode 100644 index 000000000000..6c548ce80e8f --- /dev/null +++ b/sdk/hybridcompute/azure-mgmt-hybridcompute/azure/mgmt/hybridcompute/operations/_private_link_scopes_operations.py @@ -0,0 +1,460 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class PrivateLinkScopesOperations(object): + """PrivateLinkScopesOperations 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: "2020-08-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-08-15-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + + :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 HybridComputePrivateLinkScope + :rtype: + ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScopePaged[~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope] + :raises: + :class:`ErrorResponseV2Exception` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', 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) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseV2Exception(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.HybridComputePrivateLinkScopePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/privateLinkScopes'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of Azure Arc PrivateLinkScopes within a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of HybridComputePrivateLinkScope + :rtype: + ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScopePaged[~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope] + :raises: + :class:`ErrorResponseV2Exception` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_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) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseV2Exception(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.HybridComputePrivateLinkScopePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes'} + + + def _delete_initial( + self, resource_group_name, scope_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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_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', 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]: + raise models.ErrorResponseV2Exception(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, scope_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a Azure Arc PrivateLinkScope. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope + resource. + :type scope_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:`ErrorResponseV2Exception` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + scope_name=scope_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/privateLinkScopes/{scopeName}'} + + def get( + self, resource_group_name, scope_name, custom_headers=None, raw=False, **operation_config): + """Returns a Azure Arc PrivateLinkScope. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope + resource. + :type scope_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: HybridComputePrivateLinkScope or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseV2Exception` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_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', 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]: + raise models.ErrorResponseV2Exception(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('HybridComputePrivateLinkScope', 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/privateLinkScopes/{scopeName}'} + + def create_or_update( + self, resource_group_name, scope_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot + specify a different value for InstrumentationKey nor AppId in the Put + operation. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope + resource. + :type scope_name: str + :param parameters: Properties that need to be specified to create or + update a Azure Arc for Servers and Clusters PrivateLinkScope. + :type parameters: + ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope + :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: HybridComputePrivateLinkScope or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseV2Exception` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_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', 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(parameters, 'HybridComputePrivateLinkScope') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseV2Exception(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('HybridComputePrivateLinkScope', response) + if response.status_code == 201: + deserialized = self._deserialize('HybridComputePrivateLinkScope', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}'} + + def update_tags( + self, resource_group_name, scope_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates an existing PrivateLinkScope's tags. To update other fields use + the CreateOrUpdate method. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope + resource. + :type scope_name: str + :param tags: Resource tags + :type tags: dict[str, 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: HybridComputePrivateLinkScope or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.hybridcompute.models.HybridComputePrivateLinkScope + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseV2Exception` + """ + private_link_scope_tags = models.TagsResource(tags=tags) + + # Construct URL + url = self.update_tags.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'scopeName': self._serialize.url("scope_name", scope_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', 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(private_link_scope_tags, 'TagsResource') + + # 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]: + raise models.ErrorResponseV2Exception(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('HybridComputePrivateLinkScope', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}'}