diff --git a/sdk/attestation/azure-mgmt-attestation/MANIFEST.in b/sdk/attestation/azure-mgmt-attestation/MANIFEST.in index a3cb07df87658..3a9b6517412bc 100644 --- a/sdk/attestation/azure-mgmt-attestation/MANIFEST.in +++ b/sdk/attestation/azure-mgmt-attestation/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/attestation/azure-mgmt-attestation/_meta.json b/sdk/attestation/azure-mgmt-attestation/_meta.json new file mode 100644 index 0000000000000..13fb9251542a3 --- /dev/null +++ b/sdk/attestation/azure-mgmt-attestation/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "V2", + "use": "@microsoft.azure/autorest.python@~4.0.71", + "commit": "a6d3e8138ac7ba734a6142a31933af59b2944da8", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/attestation/resource-manager/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2", + "readme": "specification/attestation/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/__init__.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/__init__.py index eb3df28849149..462781b0471d2 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/__init__.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/__init__.py @@ -21,7 +21,9 @@ from ._models_py3 import OperationList from ._models_py3 import OperationsDefinition from ._models_py3 import OperationsDisplayDefinition + from ._models_py3 import PrivateEndpoint from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateLinkServiceConnectionState from ._models_py3 import ProxyResource from ._models_py3 import Resource from ._models_py3 import SystemData @@ -38,7 +40,9 @@ from ._models import OperationList from ._models import OperationsDefinition from ._models import OperationsDisplayDefinition + from ._models import PrivateEndpoint from ._models import PrivateEndpointConnection + from ._models import PrivateLinkServiceConnectionState from ._models import ProxyResource from ._models import Resource from ._models import SystemData @@ -47,6 +51,7 @@ from ._attestation_management_client_enums import ( CreatedByType, AttestationServiceStatus, + PrivateEndpointServiceConnectionStatus, PrivateEndpointConnectionProvisioningState, ) @@ -62,7 +67,9 @@ 'OperationList', 'OperationsDefinition', 'OperationsDisplayDefinition', + 'PrivateEndpoint', 'PrivateEndpointConnection', + 'PrivateLinkServiceConnectionState', 'ProxyResource', 'Resource', 'SystemData', @@ -70,5 +77,6 @@ 'PrivateEndpointConnectionPaged', 'CreatedByType', 'AttestationServiceStatus', + 'PrivateEndpointServiceConnectionStatus', 'PrivateEndpointConnectionProvisioningState', ] diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_attestation_management_client_enums.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_attestation_management_client_enums.py index 7e2b71ca7e57c..ff62d97b501b5 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_attestation_management_client_enums.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_attestation_management_client_enums.py @@ -27,6 +27,13 @@ class AttestationServiceStatus(str, Enum): error = "Error" +class PrivateEndpointServiceConnectionStatus(str, Enum): + + pending = "Pending" + approved = "Approved" + rejected = "Rejected" + + class PrivateEndpointConnectionProvisioningState(str, Enum): succeeded = "Succeeded" diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models.py index 3abd6f8522fd0..cafd2c0a1a4a5 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models.py @@ -560,12 +560,37 @@ def __init__(self, **kwargs): self.description = kwargs.get('description', None) +class PrivateEndpoint(Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ARM identifier for Private Endpoint + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + class PrivateEndpointConnection(Resource): """The Private Endpoint Connection resource. Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str @@ -574,9 +599,16 @@ class PrivateEndpointConnection(Resource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str - :param provisioning_state: Provisioning state of the private endpoint - connection. Possible values include: 'Succeeded', 'Creating', 'Deleting', - 'Failed' + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.attestation.models.PrivateEndpoint + :param private_link_service_connection_state: Required. A collection of + information about the state of the connection between service consumer and + provider. + :type private_link_service_connection_state: + ~azure.mgmt.attestation.models.PrivateLinkServiceConnectionState + :param provisioning_state: The provisioning state of the private endpoint + connection resource. Possible values include: 'Succeeded', 'Creating', + 'Deleting', 'Failed' :type provisioning_state: str or ~azure.mgmt.attestation.models.PrivateEndpointConnectionProvisioningState """ @@ -585,20 +617,54 @@ class PrivateEndpointConnection(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'private_link_service_connection_state': {'required': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } def __init__(self, **kwargs): 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 = kwargs.get('provisioning_state', None) +class PrivateLinkServiceConnectionState(Model): + """A collection of information about the state of the connection between + service consumer and provider. + + :param status: Indicates whether the connection has been + Approved/Rejected/Removed by the owner of the service. Possible values + include: 'Pending', 'Approved', 'Rejected' + :type status: str or + ~azure.mgmt.attestation.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service + provider require any updates on the consumer. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = kwargs.get('actions_required', None) + + class ProxyResource(Resource): """Proxy Resource. @@ -651,8 +717,7 @@ class SystemData(Model): 'ManagedIdentity', 'Key' :type last_modified_by_type: str or ~azure.mgmt.attestation.models.CreatedByType - :param last_modified_at: The type of identity that last modified the - resource. + :param last_modified_at: The timestamp of resource last modification (UTC) :type last_modified_at: datetime """ diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models_py3.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models_py3.py index 2ed412b14b174..139db8c0e67ae 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models_py3.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/models/_models_py3.py @@ -560,12 +560,37 @@ def __init__(self, *, provider: str=None, resource: str=None, operation: str=Non self.description = description +class PrivateEndpoint(Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ARM identifier for Private Endpoint + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + class PrivateEndpointConnection(Resource): """The Private Endpoint Connection resource. Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str @@ -574,9 +599,16 @@ class PrivateEndpointConnection(Resource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str - :param provisioning_state: Provisioning state of the private endpoint - connection. Possible values include: 'Succeeded', 'Creating', 'Deleting', - 'Failed' + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.attestation.models.PrivateEndpoint + :param private_link_service_connection_state: Required. A collection of + information about the state of the connection between service consumer and + provider. + :type private_link_service_connection_state: + ~azure.mgmt.attestation.models.PrivateLinkServiceConnectionState + :param provisioning_state: The provisioning state of the private endpoint + connection resource. Possible values include: 'Succeeded', 'Creating', + 'Deleting', 'Failed' :type provisioning_state: str or ~azure.mgmt.attestation.models.PrivateEndpointConnectionProvisioningState """ @@ -585,20 +617,54 @@ class PrivateEndpointConnection(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'private_link_service_connection_state': {'required': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, *, provisioning_state=None, **kwargs) -> None: + def __init__(self, *, private_link_service_connection_state, private_endpoint=None, provisioning_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 = provisioning_state +class PrivateLinkServiceConnectionState(Model): + """A collection of information about the state of the connection between + service consumer and provider. + + :param status: Indicates whether the connection has been + Approved/Rejected/Removed by the owner of the service. Possible values + include: 'Pending', 'Approved', 'Rejected' + :type status: str or + ~azure.mgmt.attestation.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service + provider require any updates on the consumer. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, *, status=None, description: str=None, actions_required: str=None, **kwargs) -> None: + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + class ProxyResource(Resource): """Proxy Resource. @@ -651,8 +717,7 @@ class SystemData(Model): 'ManagedIdentity', 'Key' :type last_modified_by_type: str or ~azure.mgmt.attestation.models.CreatedByType - :param last_modified_at: The type of identity that last modified the - resource. + :param last_modified_at: The timestamp of resource last modification (UTC) :type last_modified_at: datetime """ diff --git a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_private_endpoint_connections_operations.py b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_private_endpoint_connections_operations.py index 92f51852ecf43..a59a26be36eb3 100644 --- a/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_private_endpoint_connections_operations.py +++ b/sdk/attestation/azure-mgmt-attestation/azure/mgmt/attestation/operations/_private_endpoint_connections_operations.py @@ -181,7 +181,7 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders/{providerName}/privateEndpointConnections/{privateEndpointConnectionName}'} def create( - self, resource_group_name, provider_name, private_endpoint_connection_name, provisioning_state=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, provider_name, private_endpoint_connection_name, properties, custom_headers=None, raw=False, **operation_config): """Update the state of specified private endpoint connection associated with the attestation provider. @@ -193,11 +193,9 @@ def create( :param private_endpoint_connection_name: Name of the private endpoint connection associated with the attestation providers. :type private_endpoint_connection_name: str - :param provisioning_state: Provisioning state of the private endpoint - connection. Possible values include: 'Succeeded', 'Creating', - 'Deleting', 'Failed' - :type provisioning_state: str or - ~azure.mgmt.attestation.models.PrivateEndpointConnectionProvisioningState + :param properties: The private endpoint connection properties. + :type properties: + ~azure.mgmt.attestation.models.PrivateEndpointConnection :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -208,8 +206,6 @@ def create( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - properties = models.PrivateEndpointConnection(provisioning_state=provisioning_state) - # Construct URL url = self.create.metadata['url'] path_format_arguments = {