diff --git a/sdk/signalr/azure-mgmt-signalr/MANIFEST.in b/sdk/signalr/azure-mgmt-signalr/MANIFEST.in index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/signalr/azure-mgmt-signalr/MANIFEST.in +++ b/sdk/signalr/azure-mgmt-signalr/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/signalr/azure-mgmt-signalr/_meta.json b/sdk/signalr/azure-mgmt-signalr/_meta.json new file mode 100644 index 000000000000..43f039d9cf90 --- /dev/null +++ b/sdk/signalr/azure-mgmt-signalr/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "V2", + "use": "@microsoft.azure/autorest.python@~4.0.71", + "commit": "954a3285e388dea940dc9628cf7dd0434e92e138", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/signalr/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/signalr/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/_signal_rmanagement_client.py b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/_signal_rmanagement_client.py index 246e90ae7efb..dea1ac170bd2 100644 --- a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/_signal_rmanagement_client.py +++ b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/_signal_rmanagement_client.py @@ -15,9 +15,10 @@ from ._configuration import SignalRManagementClientConfiguration from .operations import Operations from .operations import SignalROperations +from .operations import UsagesOperations from .operations import SignalRPrivateEndpointConnectionsOperations from .operations import SignalRPrivateLinkResourcesOperations -from .operations import UsagesOperations +from .operations import SignalRSharedPrivateLinkResourcesOperations from . import models @@ -31,12 +32,14 @@ class SignalRManagementClient(SDKClient): :vartype operations: azure.mgmt.signalr.operations.Operations :ivar signal_r: SignalR operations :vartype signal_r: azure.mgmt.signalr.operations.SignalROperations + :ivar usages: Usages operations + :vartype usages: azure.mgmt.signalr.operations.UsagesOperations :ivar signal_rprivate_endpoint_connections: SignalRPrivateEndpointConnections operations :vartype signal_rprivate_endpoint_connections: azure.mgmt.signalr.operations.SignalRPrivateEndpointConnectionsOperations :ivar signal_rprivate_link_resources: SignalRPrivateLinkResources operations :vartype signal_rprivate_link_resources: azure.mgmt.signalr.operations.SignalRPrivateLinkResourcesOperations - :ivar usages: Usages operations - :vartype usages: azure.mgmt.signalr.operations.UsagesOperations + :ivar signal_rshared_private_link_resources: SignalRSharedPrivateLinkResources operations + :vartype signal_rshared_private_link_resources: azure.mgmt.signalr.operations.SignalRSharedPrivateLinkResourcesOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -55,7 +58,7 @@ def __init__( super(SignalRManagementClient, 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 = '2020-05-01' + self.api_version = '2021-04-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -63,9 +66,11 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.signal_r = SignalROperations( self._client, self.config, self._serialize, self._deserialize) + self.usages = UsagesOperations( + self._client, self.config, self._serialize, self._deserialize) self.signal_rprivate_endpoint_connections = SignalRPrivateEndpointConnectionsOperations( self._client, self.config, self._serialize, self._deserialize) self.signal_rprivate_link_resources = SignalRPrivateLinkResourcesOperations( self._client, self.config, self._serialize, self._deserialize) - self.usages = UsagesOperations( + self.signal_rshared_private_link_resources = SignalRSharedPrivateLinkResourcesOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/models/__init__.py b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/models/__init__.py index a2612c3664be..92118af6cde9 100644 --- a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/models/__init__.py +++ b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/models/__init__.py @@ -11,9 +11,12 @@ try: from ._models_py3 import Dimension + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse, ErrorResponseException - from ._models_py3 import ErrorResponseBody from ._models_py3 import LogSpecification + from ._models_py3 import ManagedIdentity + from ._models_py3 import ManagedIdentitySettings from ._models_py3 import MetricSpecification from ._models_py3 import NameAvailability from ._models_py3 import NameAvailabilityParameters @@ -32,21 +35,30 @@ from ._models_py3 import ResourceSku from ._models_py3 import ServerlessUpstreamSettings from ._models_py3 import ServiceSpecification + from ._models_py3 import ShareablePrivateLinkResourceProperties + from ._models_py3 import ShareablePrivateLinkResourceType + from ._models_py3 import SharedPrivateLinkResource from ._models_py3 import SignalRCorsSettings - from ._models_py3 import SignalRCreateOrUpdateProperties from ._models_py3 import SignalRFeature from ._models_py3 import SignalRKeys from ._models_py3 import SignalRNetworkACLs from ._models_py3 import SignalRResource + from ._models_py3 import SignalRTlsSettings from ._models_py3 import SignalRUsage from ._models_py3 import SignalRUsageName + from ._models_py3 import SystemData from ._models_py3 import TrackedResource + from ._models_py3 import UpstreamAuthSettings from ._models_py3 import UpstreamTemplate + from ._models_py3 import UserAssignedIdentityProperty except (SyntaxError, ImportError): from ._models import Dimension + from ._models import ErrorAdditionalInfo + from ._models import ErrorDetail from ._models import ErrorResponse, ErrorResponseException - from ._models import ErrorResponseBody from ._models import LogSpecification + from ._models import ManagedIdentity + from ._models import ManagedIdentitySettings from ._models import MetricSpecification from ._models import NameAvailability from ._models import NameAvailabilityParameters @@ -65,36 +77,51 @@ from ._models import ResourceSku from ._models import ServerlessUpstreamSettings from ._models import ServiceSpecification + from ._models import ShareablePrivateLinkResourceProperties + from ._models import ShareablePrivateLinkResourceType + from ._models import SharedPrivateLinkResource from ._models import SignalRCorsSettings - from ._models import SignalRCreateOrUpdateProperties from ._models import SignalRFeature from ._models import SignalRKeys from ._models import SignalRNetworkACLs from ._models import SignalRResource + from ._models import SignalRTlsSettings from ._models import SignalRUsage from ._models import SignalRUsageName + from ._models import SystemData from ._models import TrackedResource + from ._models import UpstreamAuthSettings from ._models import UpstreamTemplate + from ._models import UserAssignedIdentityProperty from ._paged_models import OperationPaged +from ._paged_models import PrivateEndpointConnectionPaged from ._paged_models import PrivateLinkResourcePaged +from ._paged_models import SharedPrivateLinkResourcePaged from ._paged_models import SignalRResourcePaged from ._paged_models import SignalRUsagePaged from ._signal_rmanagement_client_enums import ( - SignalRSkuTier, + ACLAction, + FeatureFlags, + KeyType, + ManagedIdentityType, + SignalRRequestType, + CreatedByType, ProvisioningState, PrivateLinkServiceConnectionStatus, + SignalRSkuTier, + UpstreamAuthType, ServiceKind, - FeatureFlags, - ACLAction, - SignalRRequestType, - KeyType, + SharedPrivateLinkResourceStatus, ) __all__ = [ 'Dimension', + 'ErrorAdditionalInfo', + 'ErrorDetail', 'ErrorResponse', 'ErrorResponseException', - 'ErrorResponseBody', 'LogSpecification', + 'ManagedIdentity', + 'ManagedIdentitySettings', 'MetricSpecification', 'NameAvailability', 'NameAvailabilityParameters', @@ -113,26 +140,38 @@ 'ResourceSku', 'ServerlessUpstreamSettings', 'ServiceSpecification', + 'ShareablePrivateLinkResourceProperties', + 'ShareablePrivateLinkResourceType', + 'SharedPrivateLinkResource', 'SignalRCorsSettings', - 'SignalRCreateOrUpdateProperties', 'SignalRFeature', 'SignalRKeys', 'SignalRNetworkACLs', 'SignalRResource', + 'SignalRTlsSettings', 'SignalRUsage', 'SignalRUsageName', + 'SystemData', 'TrackedResource', + 'UpstreamAuthSettings', 'UpstreamTemplate', + 'UserAssignedIdentityProperty', 'OperationPaged', 'SignalRResourcePaged', - 'PrivateLinkResourcePaged', 'SignalRUsagePaged', - 'SignalRSkuTier', + 'PrivateEndpointConnectionPaged', + 'PrivateLinkResourcePaged', + 'SharedPrivateLinkResourcePaged', + 'ACLAction', + 'FeatureFlags', + 'KeyType', + 'ManagedIdentityType', + 'SignalRRequestType', + 'CreatedByType', 'ProvisioningState', 'PrivateLinkServiceConnectionStatus', + 'SignalRSkuTier', + 'UpstreamAuthType', 'ServiceKind', - 'FeatureFlags', - 'ACLAction', - 'SignalRRequestType', - 'KeyType', + 'SharedPrivateLinkResourceStatus', ] diff --git a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/models/_models.py b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/models/_models.py index 875bc362b9ee..358d37080605 100644 --- a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/models/_models.py +++ b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/models/_models.py @@ -50,16 +50,91 @@ def __init__(self, **kwargs): self.to_be_exported_for_shoebox = kwargs.get('to_be_exported_for_shoebox', None) +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(Model): + """The error detail. + + 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. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.signalr.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.signalr.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + class ErrorResponse(Model): - """Contains information about an API error. + """Error response. - :param error: Describes a particular API error with an error code and a - message. - :type error: ~azure.mgmt.signalr.models.ErrorResponseBody + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). + + :param error: The error object. + :type error: ~azure.mgmt.signalr.models.ErrorDetail """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorResponseBody'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, } def __init__(self, **kwargs): @@ -79,63 +154,82 @@ def __init__(self, deserialize, response, *args): super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) -class ErrorResponseBody(Model): - """Describes a particular API error with an error code and a message. +class LogSpecification(Model): + """Specifications of the Logs for Azure Monitoring. - All required parameters must be populated in order to send to Azure. + :param name: Name of the log. + :type name: str + :param display_name: Localized friendly display name of the log. + :type display_name: str + """ - :param code: Required. An error code that describes the error condition - more precisely than an HTTP status code. - Can be used to programmatically handle specific error cases. - :type code: str - :param message: Required. A message that describes the error in detail and - provides debugging information. - :type message: str - :param target: The target of the particular error (for example, the name - of the property in error). - :type target: str - :param details: Contains nested errors that are related to this error. - :type details: list[~azure.mgmt.signalr.models.ErrorResponseBody] + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LogSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + + +class ManagedIdentity(Model): + """A class represent managed identities used for request and response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param type: Represent the identity type: systemAssigned, userAssigned, + None. Possible values include: 'None', 'SystemAssigned', 'UserAssigned' + :type type: str or ~azure.mgmt.signalr.models.ManagedIdentityType + :param user_assigned_identities: Get or set the user assigned identities + :type user_assigned_identities: dict[str, + ~azure.mgmt.signalr.models.UserAssignedIdentityProperty] + :ivar principal_id: Get the principal id for the system assigned identity. + Only be used in response. + :vartype principal_id: str + :ivar tenant_id: Get the tenant id for the system assigned identity. + Only be used in response + :vartype tenant_id: str """ _validation = { - 'code': {'required': True}, - 'message': {'required': True}, + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorResponseBody]'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentityProperty}'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, } def __init__(self, **kwargs): - super(ErrorResponseBody, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) + super(ManagedIdentity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + self.principal_id = None + self.tenant_id = None -class LogSpecification(Model): - """Specifications of the Logs for Azure Monitoring. +class ManagedIdentitySettings(Model): + """Managed identity settings for upstream. - :param name: Name of the log. - :type name: str - :param display_name: Localized friendly display name of the log. - :type display_name: str + :param resource: The Resource indicating the App ID URI of the target + resource. + It also appears in the aud (audience) claim of the issued token. + :type resource: str """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, } def __init__(self, **kwargs): - super(LogSpecification, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) + super(ManagedIdentitySettings, self).__init__(**kwargs) + self.resource = kwargs.get('resource', None) class MetricSpecification(Model): @@ -220,11 +314,11 @@ class NameAvailabilityParameters(Model): All required parameters must be populated in order to send to Azure. - :param type: Required. The resource type. Should be always - "Microsoft.SignalRService/SignalR". + :param type: Required. The resource type. Can be + "Microsoft.SignalRService/SignalR" or "Microsoft.SignalRService/webPubSub" :type type: str - :param name: Required. The SignalR service name to validate. - e.g."my-signalR-name-here" + :param name: Required. The resource name to validate. + e.g."my-resource-name" :type name: str """ @@ -267,7 +361,7 @@ def __init__(self, **kwargs): class Operation(Model): - """REST API operation supported by SignalR resource provider. + """REST API operation supported by resource provider. :param name: Name of the operation with format: {provider}/{resource}/{operation} @@ -459,7 +553,7 @@ def __init__(self, **kwargs): class PrivateEndpointConnection(ProxyResource): - """A private endpoint connection to SignalR resource. + """A private endpoint connection to an azure resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -471,6 +565,9 @@ class PrivateEndpointConnection(ProxyResource): :ivar type: The type of the resource - e.g. "Microsoft.SignalRService/SignalR" :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification + of the resource. + :vartype system_data: ~azure.mgmt.signalr.models.SystemData :ivar provisioning_state: Provisioning state of the private endpoint connection. Possible values include: 'Unknown', 'Succeeded', 'Failed', 'Canceled', 'Running', 'Creating', 'Updating', 'Deleting', 'Moving' @@ -488,6 +585,7 @@ class PrivateEndpointConnection(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -495,6 +593,7 @@ class PrivateEndpointConnection(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, @@ -502,6 +601,7 @@ class PrivateEndpointConnection(ProxyResource): def __init__(self, **kwargs): super(PrivateEndpointConnection, self).__init__(**kwargs) + self.system_data = None self.provisioning_state = None self.private_endpoint = kwargs.get('private_endpoint', None) self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) @@ -526,6 +626,10 @@ class PrivateLinkResource(ProxyResource): :type required_members: list[str] :param required_zone_names: Required private DNS zone names :type required_zone_names: list[str] + :param shareable_private_link_resource_types: The list of resources that + are onboarded to private link service + :type shareable_private_link_resource_types: + list[~azure.mgmt.signalr.models.ShareablePrivateLinkResourceType] """ _validation = { @@ -541,6 +645,7 @@ class PrivateLinkResource(ProxyResource): 'group_id': {'key': 'properties.groupId', 'type': 'str'}, 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + 'shareable_private_link_resource_types': {'key': 'properties.shareablePrivateLinkResourceTypes', 'type': '[ShareablePrivateLinkResourceType]'}, } def __init__(self, **kwargs): @@ -548,6 +653,7 @@ def __init__(self, **kwargs): self.group_id = kwargs.get('group_id', None) self.required_members = kwargs.get('required_members', None) self.required_zone_names = kwargs.get('required_zone_names', None) + self.shareable_private_link_resource_types = kwargs.get('shareable_private_link_resource_types', None) class PrivateLinkServiceConnectionState(Model): @@ -597,7 +703,10 @@ def __init__(self, **kwargs): class ResourceSku(Model): - """The billing information of the SignalR resource. + """The billing information of the 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. @@ -608,12 +717,12 @@ class ResourceSku(Model): `Basic` is deprecated, use `Standard` instead. Possible values include: 'Free', 'Basic', 'Standard', 'Premium' :type tier: str or ~azure.mgmt.signalr.models.SignalRSkuTier - :param size: Optional string. For future use. - :type size: str - :param family: Optional string. For future use. - :type family: str - :param capacity: Optional, integer. The unit count of SignalR resource. 1 - by default. + :ivar size: Not used. Retained for future use. + :vartype size: str + :ivar family: Not used. Retained for future use. + :vartype family: str + :param capacity: Optional, integer. The unit count of the resource. 1 by + default. If present, following values are allowed: Free: 1 Standard: 1,2,5,10,20,50,100 @@ -622,6 +731,8 @@ class ResourceSku(Model): _validation = { 'name': {'required': True}, + 'size': {'readonly': True}, + 'family': {'readonly': True}, } _attribute_map = { @@ -636,14 +747,13 @@ def __init__(self, **kwargs): super(ResourceSku, 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.size = None + self.family = None self.capacity = kwargs.get('capacity', None) class ServerlessUpstreamSettings(Model): - """The settings for the Upstream when the Azure SignalR is in server-less - mode. + """The settings for the Upstream when the service is in server-less mode. :param templates: Gets or sets the list of Upstream URL templates. Order matters, and the first matching template takes effects. @@ -683,6 +793,128 @@ def __init__(self, **kwargs): self.log_specifications = kwargs.get('log_specifications', None) +class ShareablePrivateLinkResourceProperties(Model): + """Describes the properties of a resource type that has been onboarded to + private link service. + + :param description: The description of the resource type that has been + onboarded to private link service + :type description: str + :param group_id: The resource provider group id for the resource that has + been onboarded to private link service + :type group_id: str + :param type: The resource provider type for the resource that has been + onboarded to private link service + :type type: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ShareablePrivateLinkResourceProperties, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.group_id = kwargs.get('group_id', None) + self.type = kwargs.get('type', None) + + +class ShareablePrivateLinkResourceType(Model): + """Describes a resource type that has been onboarded to private link service. + + :param name: The name of the resource type that has been onboarded to + private link service + :type name: str + :param properties: Describes the properties of a resource type that has + been onboarded to private link service + :type properties: + ~azure.mgmt.signalr.models.ShareablePrivateLinkResourceProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ShareablePrivateLinkResourceProperties'}, + } + + def __init__(self, **kwargs): + super(ShareablePrivateLinkResourceType, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) + + +class SharedPrivateLinkResource(ProxyResource): + """Describes a Shared Private Link 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. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource - e.g. + "Microsoft.SignalRService/SignalR" + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification + of the resource. + :vartype system_data: ~azure.mgmt.signalr.models.SystemData + :param group_id: Required. The group id from the provider of resource the + shared private link resource is for + :type group_id: str + :param private_link_resource_id: Required. The resource id of the resource + the shared private link resource is for + :type private_link_resource_id: str + :ivar provisioning_state: Provisioning state of the shared private link + resource. Possible values include: 'Unknown', 'Succeeded', 'Failed', + 'Canceled', 'Running', 'Creating', 'Updating', 'Deleting', 'Moving' + :vartype provisioning_state: str or + ~azure.mgmt.signalr.models.ProvisioningState + :param request_message: The request message for requesting approval of the + shared private link resource + :type request_message: str + :ivar status: Status of the shared private link resource. Possible values + include: 'Pending', 'Approved', 'Rejected', 'Disconnected', 'Timeout' + :vartype status: str or + ~azure.mgmt.signalr.models.SharedPrivateLinkResourceStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'group_id': {'required': True}, + 'private_link_resource_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SharedPrivateLinkResource, self).__init__(**kwargs) + self.system_data = None + self.group_id = kwargs.get('group_id', None) + self.private_link_resource_id = kwargs.get('private_link_resource_id', None) + self.provisioning_state = None + self.request_message = kwargs.get('request_message', None) + self.status = None + + class SignalRCorsSettings(Model): """Cross-Origin Resource Sharing (CORS) settings. @@ -702,49 +934,6 @@ def __init__(self, **kwargs): self.allowed_origins = kwargs.get('allowed_origins', None) -class SignalRCreateOrUpdateProperties(Model): - """Settings used to provision or configure the resource. - - :param host_name_prefix: Prefix for the hostName of the SignalR service. - Retained for future use. - The hostname will be of format: - <hostNamePrefix>.service.signalr.net. - :type host_name_prefix: str - :param features: List of SignalR featureFlags. e.g. ServiceMode. - FeatureFlags that are not included in the parameters for the update - operation will not be modified. - And the response will only include featureFlags that are explicitly set. - When a featureFlag is not explicitly set, SignalR service will use its - globally default value. - But keep in mind, the default value doesn't mean "false". It varies in - terms of different FeatureFlags. - :type features: list[~azure.mgmt.signalr.models.SignalRFeature] - :param cors: Cross-Origin Resource Sharing (CORS) settings. - :type cors: ~azure.mgmt.signalr.models.SignalRCorsSettings - :param upstream: Upstream settings when the Azure SignalR is in - server-less mode. - :type upstream: ~azure.mgmt.signalr.models.ServerlessUpstreamSettings - :param network_ac_ls: Network ACLs - :type network_ac_ls: ~azure.mgmt.signalr.models.SignalRNetworkACLs - """ - - _attribute_map = { - 'host_name_prefix': {'key': 'hostNamePrefix', 'type': 'str'}, - 'features': {'key': 'features', 'type': '[SignalRFeature]'}, - 'cors': {'key': 'cors', 'type': 'SignalRCorsSettings'}, - 'upstream': {'key': 'upstream', 'type': 'ServerlessUpstreamSettings'}, - 'network_ac_ls': {'key': 'networkACLs', 'type': 'SignalRNetworkACLs'}, - } - - def __init__(self, **kwargs): - super(SignalRCreateOrUpdateProperties, self).__init__(**kwargs) - self.host_name_prefix = kwargs.get('host_name_prefix', None) - self.features = kwargs.get('features', None) - self.cors = kwargs.get('cors', None) - self.upstream = kwargs.get('upstream', None) - self.network_ac_ls = kwargs.get('network_ac_ls', None) - - class SignalRFeature(Model): """Feature of a SignalR resource, which controls the SignalR runtime behavior. @@ -758,8 +947,17 @@ class SignalRFeature(Model): compatibility. Support both Default and Serverless mode but not recommended; "PredefinedOnly": for future use. - EnableConnectivityLogs: "true"/"false", to enable/disable the - connectivity log category respectively. Possible values include: - 'ServiceMode', 'EnableConnectivityLogs', 'EnableMessagingLogs' + connectivity log category respectively. + - EnableMessagingLogs: "true"/"false", to enable/disable the connectivity + log category respectively. + - EnableLiveTrace: Live Trace allows you to know what's happening inside + Azure SignalR service, it will give you live traces in real time, it will + be helpful when you developing your own Azure SignalR based web + application or self-troubleshooting some issues. Please note that live + traces are counted as outbound messages that will be charged. Values + allowed: "true"/"false", to enable/disable live trace feature. Possible + values include: 'ServiceMode', 'EnableConnectivityLogs', + 'EnableMessagingLogs', 'EnableLiveTrace' :type flag: str or ~azure.mgmt.signalr.models.FeatureFlags :param value: Required. Value of the feature flag. See Azure SignalR service document https://docs.microsoft.com/azure/azure-signalr/ for @@ -788,17 +986,17 @@ def __init__(self, **kwargs): class SignalRKeys(Model): - """A class represents the access keys of SignalR service. + """A class represents the access keys of the resource. :param primary_key: The primary access key. :type primary_key: str :param secondary_key: The secondary access key. :type secondary_key: str - :param primary_connection_string: SignalR connection string constructed - via the primaryKey + :param primary_connection_string: Connection string constructed via the + primaryKey :type primary_connection_string: str - :param secondary_connection_string: SignalR connection string constructed - via the secondaryKey + :param secondary_connection_string: Connection string constructed via the + secondaryKey :type secondary_connection_string: str """ @@ -818,7 +1016,7 @@ def __init__(self, **kwargs): class SignalRNetworkACLs(Model): - """Network ACLs for SignalR. + """Network ACLs for the resource. :param default_action: Default action when no other rule matches. Possible values include: 'Allow', 'Deny' @@ -856,8 +1054,8 @@ class TrackedResource(Resource): :ivar type: The type of the resource - e.g. "Microsoft.SignalRService/SignalR" :vartype type: str - :param location: The GEO location of the SignalR service. e.g. West US | - East US | North Central US | South Central US. + :param location: The GEO location of the resource. e.g. West US | East US + | North Central US | South Central US. :type location: str :param tags: Tags of the service which is a list of key value pairs that describe the resource. @@ -885,7 +1083,7 @@ def __init__(self, **kwargs): class SignalRResource(TrackedResource): - """A class represent a SignalR service resource. + """A class represent a resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -897,62 +1095,67 @@ class SignalRResource(TrackedResource): :ivar type: The type of the resource - e.g. "Microsoft.SignalRService/SignalR" :vartype type: str - :param location: The GEO location of the SignalR service. e.g. West US | - East US | North Central US | South Central US. + :param location: The GEO location of the resource. e.g. West US | East US + | North Central US | South Central US. :type location: str :param tags: Tags of the service which is a list of key value pairs that describe the resource. :type tags: dict[str, str] :param sku: The billing information of the resource.(e.g. Free, Standard) :type sku: ~azure.mgmt.signalr.models.ResourceSku - :param host_name_prefix: Prefix for the hostName of the SignalR service. - Retained for future use. - The hostname will be of format: - <hostNamePrefix>.service.signalr.net. - :type host_name_prefix: str - :param features: List of SignalR featureFlags. e.g. ServiceMode. - FeatureFlags that are not included in the parameters for the update - operation will not be modified. - And the response will only include featureFlags that are explicitly set. - When a featureFlag is not explicitly set, SignalR service will use its - globally default value. - But keep in mind, the default value doesn't mean "false". It varies in - terms of different FeatureFlags. - :type features: list[~azure.mgmt.signalr.models.SignalRFeature] - :param cors: Cross-Origin Resource Sharing (CORS) settings. - :type cors: ~azure.mgmt.signalr.models.SignalRCorsSettings - :param upstream: Upstream settings when the Azure SignalR is in - server-less mode. - :type upstream: ~azure.mgmt.signalr.models.ServerlessUpstreamSettings - :param network_ac_ls: Network ACLs - :type network_ac_ls: ~azure.mgmt.signalr.models.SignalRNetworkACLs :ivar provisioning_state: Provisioning state of the resource. Possible values include: 'Unknown', 'Succeeded', 'Failed', 'Canceled', 'Running', 'Creating', 'Updating', 'Deleting', 'Moving' :vartype provisioning_state: str or ~azure.mgmt.signalr.models.ProvisioningState - :ivar external_ip: The publicly accessible IP of the SignalR service. + :ivar external_ip: The publicly accessible IP of the resource. :vartype external_ip: str - :ivar host_name: FQDN of the SignalR service instance. Format: - xxx.service.signalr.net + :ivar host_name: FQDN of the service instance. :vartype host_name: str - :ivar public_port: The publicly accessible port of the SignalR service - which is designed for browser/client side usage. + :ivar public_port: The publicly accessible port of the resource which is + designed for browser/client side usage. :vartype public_port: int - :ivar server_port: The publicly accessible port of the SignalR service - which is designed for customer server side usage. + :ivar server_port: The publicly accessible port of the resource which is + designed for customer server side usage. :vartype server_port: int - :ivar version: Version of the SignalR resource. Probably you need the same - or higher version of client SDKs. + :ivar version: Version of the resource. Probably you need the same or + higher version of client SDKs. :vartype version: str :ivar private_endpoint_connections: Private endpoint connections to the - SignalR resource. + resource. :vartype private_endpoint_connections: list[~azure.mgmt.signalr.models.PrivateEndpointConnection] - :param kind: The kind of the service - e.g. "SignalR", or "RawWebSockets" - for "Microsoft.SignalRService/SignalR". Possible values include: - 'SignalR', 'RawWebSockets' + :ivar shared_private_link_resources: The list of shared private link + resources. + :vartype shared_private_link_resources: + list[~azure.mgmt.signalr.models.SharedPrivateLinkResource] + :param tls: TLS settings. + :type tls: ~azure.mgmt.signalr.models.SignalRTlsSettings + :param features: List of the featureFlags. + FeatureFlags that are not included in the parameters for the update + operation will not be modified. + And the response will only include featureFlags that are explicitly set. + When a featureFlag is not explicitly set, its globally default value will + be used + But keep in mind, the default value doesn't mean "false". It varies in + terms of different FeatureFlags. + :type features: list[~azure.mgmt.signalr.models.SignalRFeature] + :param cors: Cross-Origin Resource Sharing (CORS) settings. + :type cors: ~azure.mgmt.signalr.models.SignalRCorsSettings + :param upstream: Upstream settings when the service is in server-less + mode. + :type upstream: ~azure.mgmt.signalr.models.ServerlessUpstreamSettings + :param network_ac_ls: Network ACLs + :type network_ac_ls: ~azure.mgmt.signalr.models.SignalRNetworkACLs + :param kind: The kind of the service - e.g. "SignalR" for + "Microsoft.SignalRService/SignalR". Possible values include: 'SignalR', + 'RawWebSockets' :type kind: str or ~azure.mgmt.signalr.models.ServiceKind + :param identity: The managed identity response + :type identity: ~azure.mgmt.signalr.models.ManagedIdentity + :ivar system_data: Metadata pertaining to creation and last modification + of the resource. + :vartype system_data: ~azure.mgmt.signalr.models.SystemData """ _validation = { @@ -966,6 +1169,8 @@ class SignalRResource(TrackedResource): 'server_port': {'readonly': True}, 'version': {'readonly': True}, 'private_endpoint_connections': {'readonly': True}, + 'shared_private_link_resources': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -975,11 +1180,6 @@ class SignalRResource(TrackedResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'ResourceSku'}, - 'host_name_prefix': {'key': 'properties.hostNamePrefix', 'type': 'str'}, - 'features': {'key': 'properties.features', 'type': '[SignalRFeature]'}, - 'cors': {'key': 'properties.cors', 'type': 'SignalRCorsSettings'}, - 'upstream': {'key': 'properties.upstream', 'type': 'ServerlessUpstreamSettings'}, - 'network_ac_ls': {'key': 'properties.networkACLs', 'type': 'SignalRNetworkACLs'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'external_ip': {'key': 'properties.externalIP', 'type': 'str'}, 'host_name': {'key': 'properties.hostName', 'type': 'str'}, @@ -987,17 +1187,20 @@ class SignalRResource(TrackedResource): 'server_port': {'key': 'properties.serverPort', 'type': 'int'}, 'version': {'key': 'properties.version', 'type': 'str'}, 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, + 'tls': {'key': 'properties.tls', 'type': 'SignalRTlsSettings'}, + 'features': {'key': 'properties.features', 'type': '[SignalRFeature]'}, + 'cors': {'key': 'properties.cors', 'type': 'SignalRCorsSettings'}, + 'upstream': {'key': 'properties.upstream', 'type': 'ServerlessUpstreamSettings'}, + 'network_ac_ls': {'key': 'properties.networkACLs', 'type': 'SignalRNetworkACLs'}, 'kind': {'key': 'kind', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__(self, **kwargs): super(SignalRResource, self).__init__(**kwargs) self.sku = kwargs.get('sku', None) - self.host_name_prefix = kwargs.get('host_name_prefix', None) - self.features = kwargs.get('features', None) - self.cors = kwargs.get('cors', None) - self.upstream = kwargs.get('upstream', None) - self.network_ac_ls = kwargs.get('network_ac_ls', None) self.provisioning_state = None self.external_ip = None self.host_name = None @@ -1005,11 +1208,36 @@ def __init__(self, **kwargs): self.server_port = None self.version = None self.private_endpoint_connections = None + self.shared_private_link_resources = None + self.tls = kwargs.get('tls', None) + self.features = kwargs.get('features', None) + self.cors = kwargs.get('cors', None) + self.upstream = kwargs.get('upstream', None) + self.network_ac_ls = kwargs.get('network_ac_ls', None) self.kind = kwargs.get('kind', None) + self.identity = kwargs.get('identity', None) + self.system_data = None + + +class SignalRTlsSettings(Model): + """TLS settings for the resource. + + :param client_cert_enabled: Request client certificate during TLS + handshake if enabled + :type client_cert_enabled: bool + """ + + _attribute_map = { + 'client_cert_enabled': {'key': 'clientCertEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(SignalRTlsSettings, self).__init__(**kwargs) + self.client_cert_enabled = kwargs.get('client_cert_enabled', None) class SignalRUsage(Model): - """Object that describes a specific usage of SignalR resources. + """Object that describes a specific usage of the resources. :param id: Fully qualified ARM resource id :type id: str @@ -1063,6 +1291,68 @@ def __init__(self, **kwargs): self.localized_value = kwargs.get('localized_value', None) +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or ~azure.mgmt.signalr.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.signalr.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC) + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class UpstreamAuthSettings(Model): + """Upstream auth settings. + + :param type: Gets or sets the type of auth. None or ManagedIdentity is + supported now. Possible values include: 'None', 'ManagedIdentity' + :type type: str or ~azure.mgmt.signalr.models.UpstreamAuthType + :param managed_identity: Gets or sets the managed identity settings. It's + required if the auth type is set to ManagedIdentity. + :type managed_identity: ~azure.mgmt.signalr.models.ManagedIdentitySettings + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'managed_identity': {'key': 'managedIdentity', 'type': 'ManagedIdentitySettings'}, + } + + def __init__(self, **kwargs): + super(UpstreamAuthSettings, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.managed_identity = kwargs.get('managed_identity', None) + + class UpstreamTemplate(Model): """Upstream template item settings. It defines the Upstream URL of the incoming requests. @@ -1104,6 +1394,9 @@ class UpstreamTemplate(Model): with a client request from hub `chat` connects, it will first POST to this URL: `http://example.com/chat/api/connect`. :type url_template: str + :param auth: Gets or sets the auth settings for an upstream. If not set, + no auth is used for upstream messages. + :type auth: ~azure.mgmt.signalr.models.UpstreamAuthSettings """ _validation = { @@ -1115,6 +1408,7 @@ class UpstreamTemplate(Model): 'event_pattern': {'key': 'eventPattern', 'type': 'str'}, 'category_pattern': {'key': 'categoryPattern', 'type': 'str'}, 'url_template': {'key': 'urlTemplate', 'type': 'str'}, + 'auth': {'key': 'auth', 'type': 'UpstreamAuthSettings'}, } def __init__(self, **kwargs): @@ -1123,3 +1417,32 @@ def __init__(self, **kwargs): self.event_pattern = kwargs.get('event_pattern', None) self.category_pattern = kwargs.get('category_pattern', None) self.url_template = kwargs.get('url_template', None) + self.auth = kwargs.get('auth', None) + + +class UserAssignedIdentityProperty(Model): + """Properties of user assigned identity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: Get the principal id for the user assigned identity + :vartype principal_id: str + :ivar client_id: Get the client id for the user assigned identity + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UserAssignedIdentityProperty, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None diff --git a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/models/_models_py3.py b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/models/_models_py3.py index bb2cfe47dc0d..e03b526bf6a9 100644 --- a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/models/_models_py3.py +++ b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/models/_models_py3.py @@ -50,16 +50,91 @@ def __init__(self, *, name: str=None, display_name: str=None, internal_name: str self.to_be_exported_for_shoebox = to_be_exported_for_shoebox +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(Model): + """The error detail. + + 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. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.signalr.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.signalr.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + class ErrorResponse(Model): - """Contains information about an API error. + """Error response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). - :param error: Describes a particular API error with an error code and a - message. - :type error: ~azure.mgmt.signalr.models.ErrorResponseBody + :param error: The error object. + :type error: ~azure.mgmt.signalr.models.ErrorDetail """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorResponseBody'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, } def __init__(self, *, error=None, **kwargs) -> None: @@ -79,45 +154,6 @@ def __init__(self, deserialize, response, *args): super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) -class ErrorResponseBody(Model): - """Describes a particular API error with an error code and a message. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. An error code that describes the error condition - more precisely than an HTTP status code. - Can be used to programmatically handle specific error cases. - :type code: str - :param message: Required. A message that describes the error in detail and - provides debugging information. - :type message: str - :param target: The target of the particular error (for example, the name - of the property in error). - :type target: str - :param details: Contains nested errors that are related to this error. - :type details: list[~azure.mgmt.signalr.models.ErrorResponseBody] - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorResponseBody]'}, - } - - def __init__(self, *, code: str, message: str, target: str=None, details=None, **kwargs) -> None: - super(ErrorResponseBody, self).__init__(**kwargs) - self.code = code - self.message = message - self.target = target - self.details = details - - class LogSpecification(Model): """Specifications of the Logs for Azure Monitoring. @@ -138,6 +174,64 @@ def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: self.display_name = display_name +class ManagedIdentity(Model): + """A class represent managed identities used for request and response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param type: Represent the identity type: systemAssigned, userAssigned, + None. Possible values include: 'None', 'SystemAssigned', 'UserAssigned' + :type type: str or ~azure.mgmt.signalr.models.ManagedIdentityType + :param user_assigned_identities: Get or set the user assigned identities + :type user_assigned_identities: dict[str, + ~azure.mgmt.signalr.models.UserAssignedIdentityProperty] + :ivar principal_id: Get the principal id for the system assigned identity. + Only be used in response. + :vartype principal_id: str + :ivar tenant_id: Get the tenant id for the system assigned identity. + Only be used in response + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentityProperty}'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, *, type=None, user_assigned_identities=None, **kwargs) -> None: + super(ManagedIdentity, self).__init__(**kwargs) + self.type = type + self.user_assigned_identities = user_assigned_identities + self.principal_id = None + self.tenant_id = None + + +class ManagedIdentitySettings(Model): + """Managed identity settings for upstream. + + :param resource: The Resource indicating the App ID URI of the target + resource. + It also appears in the aud (audience) claim of the issued token. + :type resource: str + """ + + _attribute_map = { + 'resource': {'key': 'resource', 'type': 'str'}, + } + + def __init__(self, *, resource: str=None, **kwargs) -> None: + super(ManagedIdentitySettings, self).__init__(**kwargs) + self.resource = resource + + class MetricSpecification(Model): """Specifications of the Metrics for Azure Monitoring. @@ -220,11 +314,11 @@ class NameAvailabilityParameters(Model): All required parameters must be populated in order to send to Azure. - :param type: Required. The resource type. Should be always - "Microsoft.SignalRService/SignalR". + :param type: Required. The resource type. Can be + "Microsoft.SignalRService/SignalR" or "Microsoft.SignalRService/webPubSub" :type type: str - :param name: Required. The SignalR service name to validate. - e.g."my-signalR-name-here" + :param name: Required. The resource name to validate. + e.g."my-resource-name" :type name: str """ @@ -267,7 +361,7 @@ def __init__(self, *, allow=None, deny=None, **kwargs) -> None: class Operation(Model): - """REST API operation supported by SignalR resource provider. + """REST API operation supported by resource provider. :param name: Name of the operation with format: {provider}/{resource}/{operation} @@ -459,7 +553,7 @@ def __init__(self, **kwargs) -> None: class PrivateEndpointConnection(ProxyResource): - """A private endpoint connection to SignalR resource. + """A private endpoint connection to an azure resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -471,6 +565,9 @@ class PrivateEndpointConnection(ProxyResource): :ivar type: The type of the resource - e.g. "Microsoft.SignalRService/SignalR" :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification + of the resource. + :vartype system_data: ~azure.mgmt.signalr.models.SystemData :ivar provisioning_state: Provisioning state of the private endpoint connection. Possible values include: 'Unknown', 'Succeeded', 'Failed', 'Canceled', 'Running', 'Creating', 'Updating', 'Deleting', 'Moving' @@ -488,6 +585,7 @@ class PrivateEndpointConnection(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -495,6 +593,7 @@ class PrivateEndpointConnection(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, @@ -502,6 +601,7 @@ class PrivateEndpointConnection(ProxyResource): def __init__(self, *, private_endpoint=None, private_link_service_connection_state=None, **kwargs) -> None: super(PrivateEndpointConnection, self).__init__(**kwargs) + self.system_data = None self.provisioning_state = None self.private_endpoint = private_endpoint self.private_link_service_connection_state = private_link_service_connection_state @@ -526,6 +626,10 @@ class PrivateLinkResource(ProxyResource): :type required_members: list[str] :param required_zone_names: Required private DNS zone names :type required_zone_names: list[str] + :param shareable_private_link_resource_types: The list of resources that + are onboarded to private link service + :type shareable_private_link_resource_types: + list[~azure.mgmt.signalr.models.ShareablePrivateLinkResourceType] """ _validation = { @@ -541,13 +645,15 @@ class PrivateLinkResource(ProxyResource): 'group_id': {'key': 'properties.groupId', 'type': 'str'}, 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + 'shareable_private_link_resource_types': {'key': 'properties.shareablePrivateLinkResourceTypes', 'type': '[ShareablePrivateLinkResourceType]'}, } - def __init__(self, *, group_id: str=None, required_members=None, required_zone_names=None, **kwargs) -> None: + def __init__(self, *, group_id: str=None, required_members=None, required_zone_names=None, shareable_private_link_resource_types=None, **kwargs) -> None: super(PrivateLinkResource, self).__init__(**kwargs) self.group_id = group_id self.required_members = required_members self.required_zone_names = required_zone_names + self.shareable_private_link_resource_types = shareable_private_link_resource_types class PrivateLinkServiceConnectionState(Model): @@ -597,7 +703,10 @@ def __init__(self, *, key_type=None, **kwargs) -> None: class ResourceSku(Model): - """The billing information of the SignalR resource. + """The billing information of the 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. @@ -608,12 +717,12 @@ class ResourceSku(Model): `Basic` is deprecated, use `Standard` instead. Possible values include: 'Free', 'Basic', 'Standard', 'Premium' :type tier: str or ~azure.mgmt.signalr.models.SignalRSkuTier - :param size: Optional string. For future use. - :type size: str - :param family: Optional string. For future use. - :type family: str - :param capacity: Optional, integer. The unit count of SignalR resource. 1 - by default. + :ivar size: Not used. Retained for future use. + :vartype size: str + :ivar family: Not used. Retained for future use. + :vartype family: str + :param capacity: Optional, integer. The unit count of the resource. 1 by + default. If present, following values are allowed: Free: 1 Standard: 1,2,5,10,20,50,100 @@ -622,6 +731,8 @@ class ResourceSku(Model): _validation = { 'name': {'required': True}, + 'size': {'readonly': True}, + 'family': {'readonly': True}, } _attribute_map = { @@ -632,18 +743,17 @@ class ResourceSku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, *, name: str, tier=None, size: str=None, family: str=None, capacity: int=None, **kwargs) -> None: + def __init__(self, *, name: str, tier=None, capacity: int=None, **kwargs) -> None: super(ResourceSku, self).__init__(**kwargs) self.name = name self.tier = tier - self.size = size - self.family = family + self.size = None + self.family = None self.capacity = capacity class ServerlessUpstreamSettings(Model): - """The settings for the Upstream when the Azure SignalR is in server-less - mode. + """The settings for the Upstream when the service is in server-less mode. :param templates: Gets or sets the list of Upstream URL templates. Order matters, and the first matching template takes effects. @@ -683,6 +793,128 @@ def __init__(self, *, metric_specifications=None, log_specifications=None, **kwa self.log_specifications = log_specifications +class ShareablePrivateLinkResourceProperties(Model): + """Describes the properties of a resource type that has been onboarded to + private link service. + + :param description: The description of the resource type that has been + onboarded to private link service + :type description: str + :param group_id: The resource provider group id for the resource that has + been onboarded to private link service + :type group_id: str + :param type: The resource provider type for the resource that has been + onboarded to private link service + :type type: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, group_id: str=None, type: str=None, **kwargs) -> None: + super(ShareablePrivateLinkResourceProperties, self).__init__(**kwargs) + self.description = description + self.group_id = group_id + self.type = type + + +class ShareablePrivateLinkResourceType(Model): + """Describes a resource type that has been onboarded to private link service. + + :param name: The name of the resource type that has been onboarded to + private link service + :type name: str + :param properties: Describes the properties of a resource type that has + been onboarded to private link service + :type properties: + ~azure.mgmt.signalr.models.ShareablePrivateLinkResourceProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ShareablePrivateLinkResourceProperties'}, + } + + def __init__(self, *, name: str=None, properties=None, **kwargs) -> None: + super(ShareablePrivateLinkResourceType, self).__init__(**kwargs) + self.name = name + self.properties = properties + + +class SharedPrivateLinkResource(ProxyResource): + """Describes a Shared Private Link 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. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource - e.g. + "Microsoft.SignalRService/SignalR" + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification + of the resource. + :vartype system_data: ~azure.mgmt.signalr.models.SystemData + :param group_id: Required. The group id from the provider of resource the + shared private link resource is for + :type group_id: str + :param private_link_resource_id: Required. The resource id of the resource + the shared private link resource is for + :type private_link_resource_id: str + :ivar provisioning_state: Provisioning state of the shared private link + resource. Possible values include: 'Unknown', 'Succeeded', 'Failed', + 'Canceled', 'Running', 'Creating', 'Updating', 'Deleting', 'Moving' + :vartype provisioning_state: str or + ~azure.mgmt.signalr.models.ProvisioningState + :param request_message: The request message for requesting approval of the + shared private link resource + :type request_message: str + :ivar status: Status of the shared private link resource. Possible values + include: 'Pending', 'Approved', 'Rejected', 'Disconnected', 'Timeout' + :vartype status: str or + ~azure.mgmt.signalr.models.SharedPrivateLinkResourceStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'group_id': {'required': True}, + 'private_link_resource_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'private_link_resource_id': {'key': 'properties.privateLinkResourceId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'request_message': {'key': 'properties.requestMessage', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__(self, *, group_id: str, private_link_resource_id: str, request_message: str=None, **kwargs) -> None: + super(SharedPrivateLinkResource, self).__init__(**kwargs) + self.system_data = None + self.group_id = group_id + self.private_link_resource_id = private_link_resource_id + self.provisioning_state = None + self.request_message = request_message + self.status = None + + class SignalRCorsSettings(Model): """Cross-Origin Resource Sharing (CORS) settings. @@ -702,49 +934,6 @@ def __init__(self, *, allowed_origins=None, **kwargs) -> None: self.allowed_origins = allowed_origins -class SignalRCreateOrUpdateProperties(Model): - """Settings used to provision or configure the resource. - - :param host_name_prefix: Prefix for the hostName of the SignalR service. - Retained for future use. - The hostname will be of format: - <hostNamePrefix>.service.signalr.net. - :type host_name_prefix: str - :param features: List of SignalR featureFlags. e.g. ServiceMode. - FeatureFlags that are not included in the parameters for the update - operation will not be modified. - And the response will only include featureFlags that are explicitly set. - When a featureFlag is not explicitly set, SignalR service will use its - globally default value. - But keep in mind, the default value doesn't mean "false". It varies in - terms of different FeatureFlags. - :type features: list[~azure.mgmt.signalr.models.SignalRFeature] - :param cors: Cross-Origin Resource Sharing (CORS) settings. - :type cors: ~azure.mgmt.signalr.models.SignalRCorsSettings - :param upstream: Upstream settings when the Azure SignalR is in - server-less mode. - :type upstream: ~azure.mgmt.signalr.models.ServerlessUpstreamSettings - :param network_ac_ls: Network ACLs - :type network_ac_ls: ~azure.mgmt.signalr.models.SignalRNetworkACLs - """ - - _attribute_map = { - 'host_name_prefix': {'key': 'hostNamePrefix', 'type': 'str'}, - 'features': {'key': 'features', 'type': '[SignalRFeature]'}, - 'cors': {'key': 'cors', 'type': 'SignalRCorsSettings'}, - 'upstream': {'key': 'upstream', 'type': 'ServerlessUpstreamSettings'}, - 'network_ac_ls': {'key': 'networkACLs', 'type': 'SignalRNetworkACLs'}, - } - - def __init__(self, *, host_name_prefix: str=None, features=None, cors=None, upstream=None, network_ac_ls=None, **kwargs) -> None: - super(SignalRCreateOrUpdateProperties, self).__init__(**kwargs) - self.host_name_prefix = host_name_prefix - self.features = features - self.cors = cors - self.upstream = upstream - self.network_ac_ls = network_ac_ls - - class SignalRFeature(Model): """Feature of a SignalR resource, which controls the SignalR runtime behavior. @@ -758,8 +947,17 @@ class SignalRFeature(Model): compatibility. Support both Default and Serverless mode but not recommended; "PredefinedOnly": for future use. - EnableConnectivityLogs: "true"/"false", to enable/disable the - connectivity log category respectively. Possible values include: - 'ServiceMode', 'EnableConnectivityLogs', 'EnableMessagingLogs' + connectivity log category respectively. + - EnableMessagingLogs: "true"/"false", to enable/disable the connectivity + log category respectively. + - EnableLiveTrace: Live Trace allows you to know what's happening inside + Azure SignalR service, it will give you live traces in real time, it will + be helpful when you developing your own Azure SignalR based web + application or self-troubleshooting some issues. Please note that live + traces are counted as outbound messages that will be charged. Values + allowed: "true"/"false", to enable/disable live trace feature. Possible + values include: 'ServiceMode', 'EnableConnectivityLogs', + 'EnableMessagingLogs', 'EnableLiveTrace' :type flag: str or ~azure.mgmt.signalr.models.FeatureFlags :param value: Required. Value of the feature flag. See Azure SignalR service document https://docs.microsoft.com/azure/azure-signalr/ for @@ -788,17 +986,17 @@ def __init__(self, *, flag, value: str, properties=None, **kwargs) -> None: class SignalRKeys(Model): - """A class represents the access keys of SignalR service. + """A class represents the access keys of the resource. :param primary_key: The primary access key. :type primary_key: str :param secondary_key: The secondary access key. :type secondary_key: str - :param primary_connection_string: SignalR connection string constructed - via the primaryKey + :param primary_connection_string: Connection string constructed via the + primaryKey :type primary_connection_string: str - :param secondary_connection_string: SignalR connection string constructed - via the secondaryKey + :param secondary_connection_string: Connection string constructed via the + secondaryKey :type secondary_connection_string: str """ @@ -818,7 +1016,7 @@ def __init__(self, *, primary_key: str=None, secondary_key: str=None, primary_co class SignalRNetworkACLs(Model): - """Network ACLs for SignalR. + """Network ACLs for the resource. :param default_action: Default action when no other rule matches. Possible values include: 'Allow', 'Deny' @@ -856,8 +1054,8 @@ class TrackedResource(Resource): :ivar type: The type of the resource - e.g. "Microsoft.SignalRService/SignalR" :vartype type: str - :param location: The GEO location of the SignalR service. e.g. West US | - East US | North Central US | South Central US. + :param location: The GEO location of the resource. e.g. West US | East US + | North Central US | South Central US. :type location: str :param tags: Tags of the service which is a list of key value pairs that describe the resource. @@ -885,7 +1083,7 @@ def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: class SignalRResource(TrackedResource): - """A class represent a SignalR service resource. + """A class represent a resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -897,62 +1095,67 @@ class SignalRResource(TrackedResource): :ivar type: The type of the resource - e.g. "Microsoft.SignalRService/SignalR" :vartype type: str - :param location: The GEO location of the SignalR service. e.g. West US | - East US | North Central US | South Central US. + :param location: The GEO location of the resource. e.g. West US | East US + | North Central US | South Central US. :type location: str :param tags: Tags of the service which is a list of key value pairs that describe the resource. :type tags: dict[str, str] :param sku: The billing information of the resource.(e.g. Free, Standard) :type sku: ~azure.mgmt.signalr.models.ResourceSku - :param host_name_prefix: Prefix for the hostName of the SignalR service. - Retained for future use. - The hostname will be of format: - <hostNamePrefix>.service.signalr.net. - :type host_name_prefix: str - :param features: List of SignalR featureFlags. e.g. ServiceMode. - FeatureFlags that are not included in the parameters for the update - operation will not be modified. - And the response will only include featureFlags that are explicitly set. - When a featureFlag is not explicitly set, SignalR service will use its - globally default value. - But keep in mind, the default value doesn't mean "false". It varies in - terms of different FeatureFlags. - :type features: list[~azure.mgmt.signalr.models.SignalRFeature] - :param cors: Cross-Origin Resource Sharing (CORS) settings. - :type cors: ~azure.mgmt.signalr.models.SignalRCorsSettings - :param upstream: Upstream settings when the Azure SignalR is in - server-less mode. - :type upstream: ~azure.mgmt.signalr.models.ServerlessUpstreamSettings - :param network_ac_ls: Network ACLs - :type network_ac_ls: ~azure.mgmt.signalr.models.SignalRNetworkACLs :ivar provisioning_state: Provisioning state of the resource. Possible values include: 'Unknown', 'Succeeded', 'Failed', 'Canceled', 'Running', 'Creating', 'Updating', 'Deleting', 'Moving' :vartype provisioning_state: str or ~azure.mgmt.signalr.models.ProvisioningState - :ivar external_ip: The publicly accessible IP of the SignalR service. + :ivar external_ip: The publicly accessible IP of the resource. :vartype external_ip: str - :ivar host_name: FQDN of the SignalR service instance. Format: - xxx.service.signalr.net + :ivar host_name: FQDN of the service instance. :vartype host_name: str - :ivar public_port: The publicly accessible port of the SignalR service - which is designed for browser/client side usage. + :ivar public_port: The publicly accessible port of the resource which is + designed for browser/client side usage. :vartype public_port: int - :ivar server_port: The publicly accessible port of the SignalR service - which is designed for customer server side usage. + :ivar server_port: The publicly accessible port of the resource which is + designed for customer server side usage. :vartype server_port: int - :ivar version: Version of the SignalR resource. Probably you need the same - or higher version of client SDKs. + :ivar version: Version of the resource. Probably you need the same or + higher version of client SDKs. :vartype version: str :ivar private_endpoint_connections: Private endpoint connections to the - SignalR resource. + resource. :vartype private_endpoint_connections: list[~azure.mgmt.signalr.models.PrivateEndpointConnection] - :param kind: The kind of the service - e.g. "SignalR", or "RawWebSockets" - for "Microsoft.SignalRService/SignalR". Possible values include: - 'SignalR', 'RawWebSockets' + :ivar shared_private_link_resources: The list of shared private link + resources. + :vartype shared_private_link_resources: + list[~azure.mgmt.signalr.models.SharedPrivateLinkResource] + :param tls: TLS settings. + :type tls: ~azure.mgmt.signalr.models.SignalRTlsSettings + :param features: List of the featureFlags. + FeatureFlags that are not included in the parameters for the update + operation will not be modified. + And the response will only include featureFlags that are explicitly set. + When a featureFlag is not explicitly set, its globally default value will + be used + But keep in mind, the default value doesn't mean "false". It varies in + terms of different FeatureFlags. + :type features: list[~azure.mgmt.signalr.models.SignalRFeature] + :param cors: Cross-Origin Resource Sharing (CORS) settings. + :type cors: ~azure.mgmt.signalr.models.SignalRCorsSettings + :param upstream: Upstream settings when the service is in server-less + mode. + :type upstream: ~azure.mgmt.signalr.models.ServerlessUpstreamSettings + :param network_ac_ls: Network ACLs + :type network_ac_ls: ~azure.mgmt.signalr.models.SignalRNetworkACLs + :param kind: The kind of the service - e.g. "SignalR" for + "Microsoft.SignalRService/SignalR". Possible values include: 'SignalR', + 'RawWebSockets' :type kind: str or ~azure.mgmt.signalr.models.ServiceKind + :param identity: The managed identity response + :type identity: ~azure.mgmt.signalr.models.ManagedIdentity + :ivar system_data: Metadata pertaining to creation and last modification + of the resource. + :vartype system_data: ~azure.mgmt.signalr.models.SystemData """ _validation = { @@ -966,6 +1169,8 @@ class SignalRResource(TrackedResource): 'server_port': {'readonly': True}, 'version': {'readonly': True}, 'private_endpoint_connections': {'readonly': True}, + 'shared_private_link_resources': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { @@ -975,11 +1180,6 @@ class SignalRResource(TrackedResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'ResourceSku'}, - 'host_name_prefix': {'key': 'properties.hostNamePrefix', 'type': 'str'}, - 'features': {'key': 'properties.features', 'type': '[SignalRFeature]'}, - 'cors': {'key': 'properties.cors', 'type': 'SignalRCorsSettings'}, - 'upstream': {'key': 'properties.upstream', 'type': 'ServerlessUpstreamSettings'}, - 'network_ac_ls': {'key': 'properties.networkACLs', 'type': 'SignalRNetworkACLs'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'external_ip': {'key': 'properties.externalIP', 'type': 'str'}, 'host_name': {'key': 'properties.hostName', 'type': 'str'}, @@ -987,17 +1187,20 @@ class SignalRResource(TrackedResource): 'server_port': {'key': 'properties.serverPort', 'type': 'int'}, 'version': {'key': 'properties.version', 'type': 'str'}, 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'shared_private_link_resources': {'key': 'properties.sharedPrivateLinkResources', 'type': '[SharedPrivateLinkResource]'}, + 'tls': {'key': 'properties.tls', 'type': 'SignalRTlsSettings'}, + 'features': {'key': 'properties.features', 'type': '[SignalRFeature]'}, + 'cors': {'key': 'properties.cors', 'type': 'SignalRCorsSettings'}, + 'upstream': {'key': 'properties.upstream', 'type': 'ServerlessUpstreamSettings'}, + 'network_ac_ls': {'key': 'properties.networkACLs', 'type': 'SignalRNetworkACLs'}, 'kind': {'key': 'kind', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } - def __init__(self, *, location: str=None, tags=None, sku=None, host_name_prefix: str=None, features=None, cors=None, upstream=None, network_ac_ls=None, kind=None, **kwargs) -> None: + def __init__(self, *, location: str=None, tags=None, sku=None, tls=None, features=None, cors=None, upstream=None, network_ac_ls=None, kind=None, identity=None, **kwargs) -> None: super(SignalRResource, self).__init__(location=location, tags=tags, **kwargs) self.sku = sku - self.host_name_prefix = host_name_prefix - self.features = features - self.cors = cors - self.upstream = upstream - self.network_ac_ls = network_ac_ls self.provisioning_state = None self.external_ip = None self.host_name = None @@ -1005,11 +1208,36 @@ def __init__(self, *, location: str=None, tags=None, sku=None, host_name_prefix: self.server_port = None self.version = None self.private_endpoint_connections = None + self.shared_private_link_resources = None + self.tls = tls + self.features = features + self.cors = cors + self.upstream = upstream + self.network_ac_ls = network_ac_ls self.kind = kind + self.identity = identity + self.system_data = None + + +class SignalRTlsSettings(Model): + """TLS settings for the resource. + + :param client_cert_enabled: Request client certificate during TLS + handshake if enabled + :type client_cert_enabled: bool + """ + + _attribute_map = { + 'client_cert_enabled': {'key': 'clientCertEnabled', 'type': 'bool'}, + } + + def __init__(self, *, client_cert_enabled: bool=None, **kwargs) -> None: + super(SignalRTlsSettings, self).__init__(**kwargs) + self.client_cert_enabled = client_cert_enabled class SignalRUsage(Model): - """Object that describes a specific usage of SignalR resources. + """Object that describes a specific usage of the resources. :param id: Fully qualified ARM resource id :type id: str @@ -1063,6 +1291,68 @@ def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> N self.localized_value = localized_value +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or ~azure.mgmt.signalr.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.signalr.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC) + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, *, created_by: str=None, created_by_type=None, created_at=None, last_modified_by: str=None, last_modified_by_type=None, last_modified_at=None, **kwargs) -> None: + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class UpstreamAuthSettings(Model): + """Upstream auth settings. + + :param type: Gets or sets the type of auth. None or ManagedIdentity is + supported now. Possible values include: 'None', 'ManagedIdentity' + :type type: str or ~azure.mgmt.signalr.models.UpstreamAuthType + :param managed_identity: Gets or sets the managed identity settings. It's + required if the auth type is set to ManagedIdentity. + :type managed_identity: ~azure.mgmt.signalr.models.ManagedIdentitySettings + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'managed_identity': {'key': 'managedIdentity', 'type': 'ManagedIdentitySettings'}, + } + + def __init__(self, *, type=None, managed_identity=None, **kwargs) -> None: + super(UpstreamAuthSettings, self).__init__(**kwargs) + self.type = type + self.managed_identity = managed_identity + + class UpstreamTemplate(Model): """Upstream template item settings. It defines the Upstream URL of the incoming requests. @@ -1104,6 +1394,9 @@ class UpstreamTemplate(Model): with a client request from hub `chat` connects, it will first POST to this URL: `http://example.com/chat/api/connect`. :type url_template: str + :param auth: Gets or sets the auth settings for an upstream. If not set, + no auth is used for upstream messages. + :type auth: ~azure.mgmt.signalr.models.UpstreamAuthSettings """ _validation = { @@ -1115,11 +1408,41 @@ class UpstreamTemplate(Model): 'event_pattern': {'key': 'eventPattern', 'type': 'str'}, 'category_pattern': {'key': 'categoryPattern', 'type': 'str'}, 'url_template': {'key': 'urlTemplate', 'type': 'str'}, + 'auth': {'key': 'auth', 'type': 'UpstreamAuthSettings'}, } - def __init__(self, *, url_template: str, hub_pattern: str=None, event_pattern: str=None, category_pattern: str=None, **kwargs) -> None: + def __init__(self, *, url_template: str, hub_pattern: str=None, event_pattern: str=None, category_pattern: str=None, auth=None, **kwargs) -> None: super(UpstreamTemplate, self).__init__(**kwargs) self.hub_pattern = hub_pattern self.event_pattern = event_pattern self.category_pattern = category_pattern self.url_template = url_template + self.auth = auth + + +class UserAssignedIdentityProperty(Model): + """Properties of user assigned identity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: Get the principal id for the user assigned identity + :vartype principal_id: str + :ivar client_id: Get the client id for the user assigned identity + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UserAssignedIdentityProperty, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None diff --git a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/models/_paged_models.py b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/models/_paged_models.py index dfd570281168..977000092979 100644 --- a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/models/_paged_models.py +++ b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/models/_paged_models.py @@ -38,6 +38,32 @@ class SignalRResourcePaged(Paged): def __init__(self, *args, **kwargs): super(SignalRResourcePaged, self).__init__(*args, **kwargs) +class SignalRUsagePaged(Paged): + """ + A paging container for iterating over a list of :class:`SignalRUsage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SignalRUsage]'} + } + + def __init__(self, *args, **kwargs): + + super(SignalRUsagePaged, 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 PrivateLinkResourcePaged(Paged): """ A paging container for iterating over a list of :class:`PrivateLinkResource ` object @@ -51,16 +77,16 @@ class PrivateLinkResourcePaged(Paged): def __init__(self, *args, **kwargs): super(PrivateLinkResourcePaged, self).__init__(*args, **kwargs) -class SignalRUsagePaged(Paged): +class SharedPrivateLinkResourcePaged(Paged): """ - A paging container for iterating over a list of :class:`SignalRUsage ` object + A paging container for iterating over a list of :class:`SharedPrivateLinkResource ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[SignalRUsage]'} + 'current_page': {'key': 'value', 'type': '[SharedPrivateLinkResource]'} } def __init__(self, *args, **kwargs): - super(SignalRUsagePaged, self).__init__(*args, **kwargs) + super(SharedPrivateLinkResourcePaged, self).__init__(*args, **kwargs) diff --git a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/models/_signal_rmanagement_client_enums.py b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/models/_signal_rmanagement_client_enums.py index 429b7949f666..da063fe9bd1a 100644 --- a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/models/_signal_rmanagement_client_enums.py +++ b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/models/_signal_rmanagement_client_enums.py @@ -12,12 +12,47 @@ from enum import Enum -class SignalRSkuTier(str, Enum): +class ACLAction(str, Enum): - free = "Free" - basic = "Basic" - standard = "Standard" - premium = "Premium" + allow = "Allow" + deny = "Deny" + + +class FeatureFlags(str, Enum): + + service_mode = "ServiceMode" + enable_connectivity_logs = "EnableConnectivityLogs" + enable_messaging_logs = "EnableMessagingLogs" + enable_live_trace = "EnableLiveTrace" + + +class KeyType(str, Enum): + + primary = "Primary" + secondary = "Secondary" + + +class ManagedIdentityType(str, Enum): + + none = "None" + system_assigned = "SystemAssigned" + user_assigned = "UserAssigned" + + +class SignalRRequestType(str, Enum): + + client_connection = "ClientConnection" + server_connection = "ServerConnection" + restapi = "RESTAPI" + trace = "Trace" + + +class CreatedByType(str, Enum): + + user = "User" + application = "Application" + managed_identity = "ManagedIdentity" + key = "Key" class ProvisioningState(str, Enum): @@ -41,33 +76,30 @@ class PrivateLinkServiceConnectionStatus(str, Enum): disconnected = "Disconnected" -class ServiceKind(str, Enum): - - signal_r = "SignalR" - raw_web_sockets = "RawWebSockets" +class SignalRSkuTier(str, Enum): + free = "Free" + basic = "Basic" + standard = "Standard" + premium = "Premium" -class FeatureFlags(str, Enum): - service_mode = "ServiceMode" - enable_connectivity_logs = "EnableConnectivityLogs" - enable_messaging_logs = "EnableMessagingLogs" +class UpstreamAuthType(str, Enum): + none = "None" + managed_identity = "ManagedIdentity" -class ACLAction(str, Enum): - allow = "Allow" - deny = "Deny" - - -class SignalRRequestType(str, Enum): +class ServiceKind(str, Enum): - client_connection = "ClientConnection" - server_connection = "ServerConnection" - restapi = "RESTAPI" + signal_r = "SignalR" + raw_web_sockets = "RawWebSockets" -class KeyType(str, Enum): +class SharedPrivateLinkResourceStatus(str, Enum): - primary = "Primary" - secondary = "Secondary" + pending = "Pending" + approved = "Approved" + rejected = "Rejected" + disconnected = "Disconnected" + timeout = "Timeout" diff --git a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/__init__.py b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/__init__.py index 7c73aef2e2c1..ed1f6ece0f91 100644 --- a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/__init__.py +++ b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/__init__.py @@ -11,14 +11,16 @@ from ._operations import Operations from ._signal_roperations import SignalROperations +from ._usages_operations import UsagesOperations from ._signal_rprivate_endpoint_connections_operations import SignalRPrivateEndpointConnectionsOperations from ._signal_rprivate_link_resources_operations import SignalRPrivateLinkResourcesOperations -from ._usages_operations import UsagesOperations +from ._signal_rshared_private_link_resources_operations import SignalRSharedPrivateLinkResourcesOperations __all__ = [ 'Operations', 'SignalROperations', + 'UsagesOperations', 'SignalRPrivateEndpointConnectionsOperations', 'SignalRPrivateLinkResourcesOperations', - 'UsagesOperations', + 'SignalRSharedPrivateLinkResourcesOperations', ] diff --git a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/_operations.py b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/_operations.py index c14d0227a4b2..b20d7ca139c9 100644 --- a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/_operations.py +++ b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/_operations.py @@ -24,7 +24,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2020-05-01". + :ivar api_version: Client Api Version. Constant value: "2021-04-01-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 = "2020-05-01" + self.api_version = "2021-04-01-preview" self.config = config diff --git a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/_signal_roperations.py b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/_signal_roperations.py index 054b4fbd8f37..fb447fe6d809 100644 --- a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/_signal_roperations.py +++ b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/_signal_roperations.py @@ -26,7 +26,7 @@ class SignalROperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2020-05-01". + :ivar api_version: Client Api Version. Constant value: "2021-04-01-preview". """ models = models @@ -36,21 +36,21 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-05-01" + self.api_version = "2021-04-01-preview" self.config = config def check_name_availability( self, location, type, name, custom_headers=None, raw=False, **operation_config): - """Checks that the SignalR name is valid and is not already in use. + """Checks that the resource name is valid and is not already in use. :param location: the region :type location: str - :param type: The resource type. Should be always - "Microsoft.SignalRService/SignalR". + :param type: The resource type. Can be + "Microsoft.SignalRService/SignalR" or + "Microsoft.SignalRService/webPubSub" :type type: str - :param name: The SignalR service name to validate. - e.g."my-signalR-name-here" + :param name: The resource name to validate. e.g."my-resource-name" :type name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -63,9 +63,7 @@ def check_name_availability( :raises: :class:`ErrorResponseException` """ - parameters = None - if type is not None or name is not None: - parameters = models.NameAvailabilityParameters(type=type, name=name) + parameters = models.NameAvailabilityParameters(type=type, name=name) # Construct URL url = self.check_name_availability.metadata['url'] @@ -91,10 +89,7 @@ def check_name_availability( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - if parameters is not None: - body_content = self._serialize.body(parameters, 'NameAvailabilityParameters') - else: - body_content = None + body_content = self._serialize.body(parameters, 'NameAvailabilityParameters') # Construct and send request request = self._client.post(url, query_parameters, header_parameters, body_content) @@ -249,29 +244,29 @@ def internal_paging(next_link=None): return deserialized list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR'} - def list_keys( + def get( self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): - """Get the access keys of the SignalR resource. + """Get the resource and its properties. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str - :param resource_name: The name of the SignalR resource. + :param resource_name: The name of the resource. :type resource_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: SignalRKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.signalr.models.SignalRKeys or + :return: SignalRResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.signalr.models.SignalRResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.list_keys.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -294,7 +289,7 @@ def list_keys( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + 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]: @@ -302,24 +297,20 @@ def list_keys( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('SignalRKeys', response) + deserialized = self._deserialize('SignalRResource', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/listKeys'} - + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}'} - def _regenerate_key_initial( - self, resource_group_name, resource_name, key_type=None, custom_headers=None, raw=False, **operation_config): - parameters = None - if key_type is not None: - parameters = models.RegenerateKeyParameters(key_type=key_type) + def _create_or_update_initial( + self, parameters, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.regenerate_key.metadata['url'] + url = self.create_or_update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -343,22 +334,21 @@ def _regenerate_key_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - if parameters is not None: - body_content = self._serialize.body(parameters, 'RegenerateKeyParameters') - else: - body_content = None + body_content = self._serialize.body(parameters, 'SignalRResource') # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) + 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 [201]: + if response.status_code not in [200, 201, 202]: raise models.ErrorResponseException(self._deserialize, response) deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SignalRResource', response) if response.status_code == 201: - deserialized = self._deserialize('SignalRKeys', response) + deserialized = self._deserialize('SignalRResource', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -366,46 +356,43 @@ def _regenerate_key_initial( return deserialized - def regenerate_key( - self, resource_group_name, resource_name, key_type=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Regenerate SignalR service access key. PrimaryKey and SecondaryKey - cannot be regenerated at the same time. + def create_or_update( + self, parameters, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a resource. + :param parameters: Parameters for the create or update operation + :type parameters: ~azure.mgmt.signalr.models.SignalRResource :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str - :param resource_name: The name of the SignalR resource. + :param resource_name: The name of the resource. :type resource_name: str - :param key_type: The keyType to regenerate. Must be either 'primary' - or 'secondary'(case-insensitive). Possible values include: 'Primary', - 'Secondary' - :type key_type: str or ~azure.mgmt.signalr.models.KeyType :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 SignalRKeys or - ClientRawResponse if raw==True + :return: An instance of LROPoller that returns SignalRResource or + ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.signalr.models.SignalRKeys] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.signalr.models.SignalRResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.signalr.models.SignalRKeys]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.signalr.models.SignalRResource]] :raises: :class:`ErrorResponseException` """ - raw_result = self._regenerate_key_initial( + raw_result = self._create_or_update_initial( + parameters=parameters, resource_group_name=resource_group_name, resource_name=resource_name, - key_type=key_type, custom_headers=custom_headers, raw=True, **operation_config ) def get_long_running_output(response): - deserialized = self._deserialize('SignalRKeys', response) + deserialized = self._deserialize('SignalRResource', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -416,35 +403,17 @@ def get_long_running_output(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, lro_options={'final-state-via': 'azure-async-operation'}, **operation_config) + 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) - regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/regenerateKey'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}'} - def get( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): - """Get the SignalR service and its properties. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param resource_name: The name of the SignalR resource. - :type resource_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: SignalRResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.signalr.models.SignalRResource or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ + def _delete_initial( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.get.metadata['url'] + url = self.delete.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -458,7 +427,6 @@ def get( # 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: @@ -467,28 +435,65 @@ def get( 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) + 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]: + if response.status_code not in [200, 202, 204]: raise models.ErrorResponseException(self._deserialize, response) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('SignalRResource', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}'} + def delete( + self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Operation to delete a resource. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param resource_name: The name of the resource. + :type resource_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:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_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 - def _create_or_update_initial( - self, resource_group_name, resource_name, parameters=None, custom_headers=None, raw=False, **operation_config): + 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.SignalRService/signalR/{resourceName}'} + + + def _update_initial( + self, parameters, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.create_or_update.metadata['url'] + url = self.update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -512,24 +517,19 @@ def _create_or_update_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - if parameters is not None: - body_content = self._serialize.body(parameters, 'SignalRResource') - else: - body_content = None + body_content = self._serialize.body(parameters, 'SignalRResource') # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 201, 202]: + if response.status_code not in [200, 202]: raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: deserialized = self._deserialize('SignalRResource', response) - if response.status_code == 201: - deserialized = self._deserialize('SignalRResource', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -537,18 +537,18 @@ def _create_or_update_initial( return deserialized - def create_or_update( - self, resource_group_name, resource_name, parameters=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Create a new SignalR service and update an exiting SignalR service. + def update( + self, parameters, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Operation to update an exiting resource. + :param parameters: Parameters for the update operation + :type parameters: ~azure.mgmt.signalr.models.SignalRResource :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str - :param resource_name: The name of the SignalR resource. + :param resource_name: The name of the resource. :type resource_name: str - :param parameters: Parameters for the create or update operation - :type parameters: ~azure.mgmt.signalr.models.SignalRResource :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 @@ -563,10 +563,10 @@ def create_or_update( :raises: :class:`ErrorResponseException` """ - raw_result = self._create_or_update_initial( + raw_result = self._update_initial( + parameters=parameters, resource_group_name=resource_group_name, resource_name=resource_name, - parameters=parameters, custom_headers=custom_headers, raw=True, **operation_config @@ -588,13 +588,31 @@ def get_long_running_output(response): 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.SignalRService/signalR/{resourceName}'} - + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}'} - def _delete_initial( + def list_keys( self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Get the access keys of the resource. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param resource_name: The name of the resource. + :type resource_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: SignalRKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.signalr.models.SignalRKeys or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ # Construct URL - url = self.delete.metadata['url'] + url = self.list_keys.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -608,6 +626,7 @@ def _delete_initial( # 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: @@ -616,65 +635,30 @@ def _delete_initial( 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) + request = self._client.post(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [202, 204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SignalRKeys', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - def delete( - self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Operation to delete a SignalR service. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param resource_name: The name of the SignalR resource. - :type resource_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:`ErrorResponseException` - """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_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 + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/listKeys'} - 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.SignalRService/signalR/{resourceName}'} + def _regenerate_key_initial( + self, resource_group_name, resource_name, key_type=None, custom_headers=None, raw=False, **operation_config): + parameters = models.RegenerateKeyParameters(key_type=key_type) - def _update_initial( - self, resource_group_name, resource_name, parameters=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.update.metadata['url'] + url = self.regenerate_key.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -698,22 +682,19 @@ def _update_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - if parameters is not None: - body_content = self._serialize.body(parameters, 'SignalRResource') - else: - body_content = None + body_content = self._serialize.body(parameters, 'RegenerateKeyParameters') # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) + request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 202]: + if response.status_code not in [202]: raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('SignalRResource', response) + if response.status_code == 202: + deserialized = self._deserialize('SignalRKeys', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -721,43 +702,46 @@ def _update_initial( return deserialized - def update( - self, resource_group_name, resource_name, parameters=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Operation to update an exiting SignalR service. + def regenerate_key( + self, resource_group_name, resource_name, key_type=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Regenerate the access key for the resource. PrimaryKey and SecondaryKey + cannot be regenerated at the same time. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str - :param resource_name: The name of the SignalR resource. + :param resource_name: The name of the resource. :type resource_name: str - :param parameters: Parameters for the update operation - :type parameters: ~azure.mgmt.signalr.models.SignalRResource + :param key_type: The keyType to regenerate. Must be either 'primary' + or 'secondary'(case-insensitive). Possible values include: 'Primary', + 'Secondary' + :type key_type: str or ~azure.mgmt.signalr.models.KeyType :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 SignalRResource or - ClientRawResponse if raw==True + :return: An instance of LROPoller that returns SignalRKeys or + ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.signalr.models.SignalRResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.signalr.models.SignalRKeys] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.signalr.models.SignalRResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.signalr.models.SignalRKeys]] :raises: :class:`ErrorResponseException` """ - raw_result = self._update_initial( + raw_result = self._regenerate_key_initial( resource_group_name=resource_group_name, resource_name=resource_name, - parameters=parameters, + key_type=key_type, custom_headers=custom_headers, raw=True, **operation_config ) def get_long_running_output(response): - deserialized = self._deserialize('SignalRResource', response) + deserialized = self._deserialize('SignalRKeys', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -768,11 +752,11 @@ def get_long_running_output(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) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}'} + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/regenerateKey'} def _restart_initial( @@ -812,13 +796,13 @@ def _restart_initial( def restart( self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Operation to restart a SignalR service. + """Operation to restart a resource. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str - :param resource_name: The name of the SignalR resource. + :param resource_name: The name of the resource. :type resource_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the diff --git a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/_signal_rprivate_endpoint_connections_operations.py b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/_signal_rprivate_endpoint_connections_operations.py index 73c157337a8d..8dd4d0be2d25 100644 --- a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/_signal_rprivate_endpoint_connections_operations.py +++ b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/_signal_rprivate_endpoint_connections_operations.py @@ -26,7 +26,7 @@ class SignalRPrivateEndpointConnectionsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2020-05-01". + :ivar api_version: Client Api Version. Constant value: "2021-04-01-preview". """ models = models @@ -36,23 +36,95 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-05-01" + self.api_version = "2021-04-01-preview" self.config = config + def list( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """List private endpoint connections. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param resource_name: The name of the resource. + :type resource_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.signalr.models.PrivateEndpointConnectionPaged[~azure.mgmt.signalr.models.PrivateEndpointConnection] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_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') + + 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.ErrorResponseException(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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/privateEndpointConnections'} + def get( self, private_endpoint_connection_name, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): - """Get the specified private endpoint connection associated with a SignalR - resource. + """Get the specified private endpoint connection. :param private_endpoint_connection_name: The name of the private - endpoint connection associated with the SignalR resource. + endpoint connection :type private_endpoint_connection_name: str :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str - :param resource_name: The name of the SignalR resource. + :param resource_name: The name of the resource. :type resource_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -109,17 +181,16 @@ def get( def update( self, private_endpoint_connection_name, resource_group_name, resource_name, private_endpoint=None, private_link_service_connection_state=None, custom_headers=None, raw=False, **operation_config): - """Update the state of specified private endpoint connection associated - with a SignalR resource. + """Update the state of specified private endpoint connection. :param private_endpoint_connection_name: The name of the private - endpoint connection associated with the SignalR resource. + endpoint connection :type private_endpoint_connection_name: str :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str - :param resource_name: The name of the SignalR resource. + :param resource_name: The name of the resource. :type resource_name: str :param private_endpoint: Private endpoint associated with the private endpoint connection @@ -138,9 +209,7 @@ def update( :raises: :class:`ErrorResponseException` """ - parameters = None - if private_endpoint is not None or private_link_service_connection_state is not None: - parameters = models.PrivateEndpointConnection(private_endpoint=private_endpoint, private_link_service_connection_state=private_link_service_connection_state) + parameters = models.PrivateEndpointConnection(private_endpoint=private_endpoint, private_link_service_connection_state=private_link_service_connection_state) # Construct URL url = self.update.metadata['url'] @@ -168,10 +237,7 @@ def update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - if parameters is not None: - body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') - else: - body_content = None + body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -221,7 +287,7 @@ def _delete_initial( request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202, 204]: raise models.ErrorResponseException(self._deserialize, response) if raw: @@ -230,17 +296,16 @@ def _delete_initial( def delete( self, private_endpoint_connection_name, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Delete the specified private endpoint connection associated with a - SignalR resource. + """Delete the specified private endpoint connection. :param private_endpoint_connection_name: The name of the private - endpoint connection associated with the SignalR resource. + endpoint connection :type private_endpoint_connection_name: str :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str - :param resource_name: The name of the SignalR resource. + :param resource_name: The name of the resource. :type resource_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the diff --git a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/_signal_rprivate_link_resources_operations.py b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/_signal_rprivate_link_resources_operations.py index 53a713abf289..aea0b5f3af19 100644 --- a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/_signal_rprivate_link_resources_operations.py +++ b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/_signal_rprivate_link_resources_operations.py @@ -24,7 +24,7 @@ class SignalRPrivateLinkResourcesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2020-05-01". + :ivar api_version: Client Api Version. Constant value: "2021-04-01-preview". """ models = models @@ -34,20 +34,19 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-05-01" + self.api_version = "2021-04-01-preview" self.config = config def list( self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): - """Get the private link resources that need to be created for a SignalR - resource. + """Get the private link resources that need to be created for a resource. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str - :param resource_name: The name of the SignalR resource. + :param resource_name: The name of the resource. :type resource_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the diff --git a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/_signal_rshared_private_link_resources_operations.py b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/_signal_rshared_private_link_resources_operations.py new file mode 100644 index 000000000000..9cbb998389cb --- /dev/null +++ b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/_signal_rshared_private_link_resources_operations.py @@ -0,0 +1,374 @@ +# 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 SignalRSharedPrivateLinkResourcesOperations(object): + """SignalRSharedPrivateLinkResourcesOperations 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: Client Api Version. Constant value: "2021-04-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-04-01-preview" + + self.config = config + + def list( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """List shared private link resources. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param resource_name: The name of the resource. + :type resource_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 SharedPrivateLinkResource + :rtype: + ~azure.mgmt.signalr.models.SharedPrivateLinkResourcePaged[~azure.mgmt.signalr.models.SharedPrivateLinkResource] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_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') + + 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.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.SharedPrivateLinkResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/sharedPrivateLinkResources'} + + def get( + self, shared_private_link_resource_name, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Get the specified shared private link resource. + + :param shared_private_link_resource_name: The name of the shared + private link resource + :type shared_private_link_resource_name: str + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param resource_name: The name of the resource. + :type resource_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: SharedPrivateLinkResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.signalr.models.SharedPrivateLinkResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'sharedPrivateLinkResourceName': self._serialize.url("shared_private_link_resource_name", shared_private_link_resource_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SharedPrivateLinkResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}'} + + + def _create_or_update_initial( + self, shared_private_link_resource_name, parameters, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'sharedPrivateLinkResourceName': self._serialize.url("shared_private_link_resource_name", shared_private_link_resource_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 'SharedPrivateLinkResource') + + # 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.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SharedPrivateLinkResource', response) + if response.status_code == 201: + deserialized = self._deserialize('SharedPrivateLinkResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, shared_private_link_resource_name, parameters, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a shared private link resource. + + :param shared_private_link_resource_name: The name of the shared + private link resource + :type shared_private_link_resource_name: str + :param parameters: The shared private link resource + :type parameters: ~azure.mgmt.signalr.models.SharedPrivateLinkResource + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param resource_name: The name of the resource. + :type resource_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 + SharedPrivateLinkResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.signalr.models.SharedPrivateLinkResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.signalr.models.SharedPrivateLinkResource]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + shared_private_link_resource_name=shared_private_link_resource_name, + parameters=parameters, + resource_group_name=resource_group_name, + resource_name=resource_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('SharedPrivateLinkResource', 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.SignalRService/signalR/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}'} + + + def _delete_initial( + self, shared_private_link_resource_name, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'sharedPrivateLinkResourceName': self._serialize.url("shared_private_link_resource_name", shared_private_link_resource_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + 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.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, shared_private_link_resource_name, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete the specified shared private link resource. + + :param shared_private_link_resource_name: The name of the shared + private link resource + :type shared_private_link_resource_name: str + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param resource_name: The name of the resource. + :type resource_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:`ErrorResponseException` + """ + raw_result = self._delete_initial( + shared_private_link_resource_name=shared_private_link_resource_name, + resource_group_name=resource_group_name, + resource_name=resource_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.SignalRService/signalR/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}'} diff --git a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/_usages_operations.py b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/_usages_operations.py index afe9a3f4c2fd..d0dc6b782bc1 100644 --- a/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/_usages_operations.py +++ b/sdk/signalr/azure-mgmt-signalr/azure/mgmt/signalr/operations/_usages_operations.py @@ -24,7 +24,7 @@ class UsagesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2020-05-01". + :ivar api_version: Client Api Version. Constant value: "2021-04-01-preview". """ models = models @@ -34,13 +34,13 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-05-01" + self.api_version = "2021-04-01-preview" self.config = config def list( self, location, custom_headers=None, raw=False, **operation_config): - """List usage quotas for Azure SignalR service by location. + """List resource usage quotas by location. :param location: the location like "eastus" :type location: str