diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/MANIFEST.in b/sdk/appconfiguration/azure-mgmt-appconfiguration/MANIFEST.in index a3cb07df87658..3a9b6517412bc 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/MANIFEST.in +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/_meta.json b/sdk/appconfiguration/azure-mgmt-appconfiguration/_meta.json new file mode 100644 index 0000000000000..e16f609d85d72 --- /dev/null +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "V2", + "use": "@microsoft.azure/autorest.python@~4.0.71", + "commit": "b93bd818d2c2bf3a014dbf2306658a65fa25a160", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/appconfiguration/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/appconfiguration/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/_app_configuration_management_client.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/_app_configuration_management_client.py index e87b243ceb8d5..abbe7a1a2a229 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/_app_configuration_management_client.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/_app_configuration_management_client.py @@ -17,6 +17,7 @@ from .operations import Operations from .operations import PrivateEndpointConnectionsOperations from .operations import PrivateLinkResourcesOperations +from .operations import KeyValuesOperations from . import models @@ -34,6 +35,8 @@ class AppConfigurationManagementClient(SDKClient): :vartype private_endpoint_connections: azure.mgmt.appconfiguration.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResources operations :vartype private_link_resources: azure.mgmt.appconfiguration.operations.PrivateLinkResourcesOperations + :ivar key_values: KeyValues operations + :vartype key_values: azure.mgmt.appconfiguration.operations.KeyValuesOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -50,7 +53,7 @@ def __init__( super(AppConfigurationManagementClient, 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-06-01' + self.api_version = '2021-03-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -62,3 +65,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.private_link_resources = PrivateLinkResourcesOperations( self._client, self.config, self._serialize, self._deserialize) + self.key_values = KeyValuesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/__init__.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/__init__.py index 8f670de6be62f..841aaa1e8d7df 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/__init__.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/__init__.py @@ -11,52 +11,73 @@ try: from ._models_py3 import ApiKey + from ._models_py3 import AzureEntityResource from ._models_py3 import CheckNameAvailabilityParameters from ._models_py3 import ConfigurationStore from ._models_py3 import ConfigurationStoreUpdateParameters from ._models_py3 import EncryptionProperties - from ._models_py3 import Error, ErrorException + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetails + from ._models_py3 import ErrorResponse, ErrorResponseException from ._models_py3 import KeyValue from ._models_py3 import KeyVaultProperties - from ._models_py3 import ListKeyValueParameters + from ._models_py3 import LogSpecification + from ._models_py3 import MetricDimension + from ._models_py3 import MetricSpecification from ._models_py3 import NameAvailabilityStatus from ._models_py3 import OperationDefinition from ._models_py3 import OperationDefinitionDisplay + from ._models_py3 import OperationProperties from ._models_py3 import PrivateEndpoint from ._models_py3 import PrivateEndpointConnection from ._models_py3 import PrivateEndpointConnectionReference from ._models_py3 import PrivateLinkResource from ._models_py3 import PrivateLinkServiceConnectionState + from ._models_py3 import ProxyResource from ._models_py3 import RegenerateKeyParameters from ._models_py3 import Resource from ._models_py3 import ResourceIdentity + from ._models_py3 import ServiceSpecification from ._models_py3 import Sku + from ._models_py3 import SystemData + from ._models_py3 import TrackedResource from ._models_py3 import UserIdentity except (SyntaxError, ImportError): from ._models import ApiKey + from ._models import AzureEntityResource from ._models import CheckNameAvailabilityParameters from ._models import ConfigurationStore from ._models import ConfigurationStoreUpdateParameters from ._models import EncryptionProperties - from ._models import Error, ErrorException + from ._models import ErrorAdditionalInfo + from ._models import ErrorDetails + from ._models import ErrorResponse, ErrorResponseException from ._models import KeyValue from ._models import KeyVaultProperties - from ._models import ListKeyValueParameters + from ._models import LogSpecification + from ._models import MetricDimension + from ._models import MetricSpecification from ._models import NameAvailabilityStatus from ._models import OperationDefinition from ._models import OperationDefinitionDisplay + from ._models import OperationProperties from ._models import PrivateEndpoint from ._models import PrivateEndpointConnection from ._models import PrivateEndpointConnectionReference from ._models import PrivateLinkResource from ._models import PrivateLinkServiceConnectionState + from ._models import ProxyResource from ._models import RegenerateKeyParameters from ._models import Resource from ._models import ResourceIdentity + from ._models import ServiceSpecification from ._models import Sku + from ._models import SystemData + from ._models import TrackedResource from ._models import UserIdentity from ._paged_models import ApiKeyPaged from ._paged_models import ConfigurationStorePaged +from ._paged_models import KeyValuePaged from ._paged_models import OperationDefinitionPaged from ._paged_models import PrivateEndpointConnectionPaged from ._paged_models import PrivateLinkResourcePaged @@ -66,39 +87,52 @@ ConnectionStatus, ActionsRequired, PublicNetworkAccess, + CreatedByType, ) __all__ = [ 'ApiKey', + 'AzureEntityResource', 'CheckNameAvailabilityParameters', 'ConfigurationStore', 'ConfigurationStoreUpdateParameters', 'EncryptionProperties', - 'Error', 'ErrorException', + 'ErrorAdditionalInfo', + 'ErrorDetails', + 'ErrorResponse', 'ErrorResponseException', 'KeyValue', 'KeyVaultProperties', - 'ListKeyValueParameters', + 'LogSpecification', + 'MetricDimension', + 'MetricSpecification', 'NameAvailabilityStatus', 'OperationDefinition', 'OperationDefinitionDisplay', + 'OperationProperties', 'PrivateEndpoint', 'PrivateEndpointConnection', 'PrivateEndpointConnectionReference', 'PrivateLinkResource', 'PrivateLinkServiceConnectionState', + 'ProxyResource', 'RegenerateKeyParameters', 'Resource', 'ResourceIdentity', + 'ServiceSpecification', 'Sku', + 'SystemData', + 'TrackedResource', 'UserIdentity', 'ConfigurationStorePaged', 'ApiKeyPaged', 'OperationDefinitionPaged', 'PrivateEndpointConnectionPaged', 'PrivateLinkResourcePaged', + 'KeyValuePaged', 'IdentityType', 'ProvisioningState', 'ConnectionStatus', 'ActionsRequired', 'PublicNetworkAccess', + 'CreatedByType', ] diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/_app_configuration_management_client_enums.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/_app_configuration_management_client_enums.py index 81df981c080e2..990a38ebe6a0e 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/_app_configuration_management_client_enums.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/_app_configuration_management_client_enums.py @@ -48,3 +48,11 @@ class PublicNetworkAccess(str, Enum): enabled = "Enabled" disabled = "Disabled" + + +class CreatedByType(str, Enum): + + user = "User" + application = "Application" + managed_identity = "ManagedIdentity" + key = "Key" diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/_models.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/_models.py index 4c892b7a7a3c5..a2753796d5ffd 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/_models.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/_models.py @@ -64,6 +64,84 @@ def __init__(self, **kwargs): self.read_only = None +class Resource(Model): + """Resource. + + Common fields that are returned in the response for all Azure Resource + Manager resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """Entity Resource. + + The resource model definition for an Azure Resource Manager resource with + an etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + class CheckNameAvailabilityParameters(Model): """Parameters used for checking whether a resource name is available. @@ -104,25 +182,29 @@ class CloudError(Model): } -class Resource(Model): - """An Azure resource. +class TrackedResource(Resource): + """Tracked Resource. + + The resource model definition for an Azure Resource Manager tracked top + level resource which has 'tags' and a 'location'. 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: The resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str - :ivar name: The name of the resource. + :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str - :param location: Required. The location of the resource. This cannot be - changed after the resource is created. - :type location: str - :param tags: The tags of the resource. + :param tags: Resource tags. :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str """ _validation = { @@ -136,20 +218,17 @@ class Resource(Model): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, } def __init__(self, **kwargs): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs.get('location', None) + super(TrackedResource, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) -class ConfigurationStore(Resource): +class ConfigurationStore(TrackedResource): """The configuration store along with all resource properties. The Configuration Store will have all information to begin utilizing it. @@ -158,17 +237,18 @@ class ConfigurationStore(Resource): All required parameters must be populated in order to send to Azure. - :ivar id: The resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str - :ivar name: The name of the resource. + :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str - :param location: Required. The location of the resource. This cannot be - changed after the resource is created. - :type location: str - :param tags: The tags of the resource. + :param tags: Resource tags. :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str :param identity: The managed identity information, if configured. :type identity: ~azure.mgmt.appconfiguration.models.ResourceIdentity :ivar provisioning_state: The provisioning state of the configuration @@ -192,8 +272,13 @@ class ConfigurationStore(Resource): values include: 'Enabled', 'Disabled' :type public_network_access: str or ~azure.mgmt.appconfiguration.models.PublicNetworkAccess + :param disable_local_auth: Disables all authentication methods other than + AAD authentication. + :type disable_local_auth: bool :param sku: Required. The sku of the configuration store. :type sku: ~azure.mgmt.appconfiguration.models.Sku + :param system_data: Resource system metadata. + :type system_data: ~azure.mgmt.appconfiguration.models.SystemData """ _validation = { @@ -212,8 +297,8 @@ class ConfigurationStore(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, @@ -221,7 +306,9 @@ class ConfigurationStore(Resource): 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperties'}, 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnectionReference]'}, 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'disable_local_auth': {'key': 'properties.disableLocalAuth', 'type': 'bool'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__(self, **kwargs): @@ -233,7 +320,9 @@ def __init__(self, **kwargs): self.encryption = kwargs.get('encryption', None) self.private_endpoint_connections = None self.public_network_access = kwargs.get('public_network_access', None) + self.disable_local_auth = kwargs.get('disable_local_auth', None) self.sku = kwargs.get('sku', None) + self.system_data = kwargs.get('system_data', None) class ConfigurationStoreUpdateParameters(Model): @@ -241,11 +330,9 @@ class ConfigurationStoreUpdateParameters(Model): :param encryption: The encryption settings of the configuration store. :type encryption: ~azure.mgmt.appconfiguration.models.EncryptionProperties - :param public_network_access: Control permission for data plane traffic - coming from public networks while private endpoint is enabled. Possible - values include: 'Enabled', 'Disabled' - :type public_network_access: str or - ~azure.mgmt.appconfiguration.models.PublicNetworkAccess + :param disable_local_auth: Disables all authentication methods other than + AAD authentication. + :type disable_local_auth: bool :param identity: The managed identity information for the configuration store. :type identity: ~azure.mgmt.appconfiguration.models.ResourceIdentity @@ -257,7 +344,7 @@ class ConfigurationStoreUpdateParameters(Model): _attribute_map = { 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperties'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'disable_local_auth': {'key': 'properties.disableLocalAuth', 'type': 'bool'}, 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, 'sku': {'key': 'sku', 'type': 'Sku'}, 'tags': {'key': 'tags', 'type': '{str}'}, @@ -266,7 +353,7 @@ class ConfigurationStoreUpdateParameters(Model): def __init__(self, **kwargs): super(ConfigurationStoreUpdateParameters, self).__init__(**kwargs) self.encryption = kwargs.get('encryption', None) - self.public_network_access = kwargs.get('public_network_access', None) + self.disable_local_auth = kwargs.get('disable_local_auth', None) self.identity = kwargs.get('identity', None) self.sku = kwargs.get('sku', None) self.tags = kwargs.get('tags', None) @@ -289,28 +376,87 @@ def __init__(self, **kwargs): self.key_vault_properties = kwargs.get('key_vault_properties', None) -class Error(Model): - """AppConfiguration error object. +class ErrorAdditionalInfo(Model): + """The resource management error additional info. - :param code: Error code. - :type code: str - :param message: Error message. - :type message: str + 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 ErrorDetails(Model): + """The details of the error. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.appconfiguration.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } def __init__(self, **kwargs): - super(Error, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) + super(ErrorDetails, self).__init__(**kwargs) + self.code = None + self.message = None + self.additional_info = None + + +class ErrorResponse(Model): + """Error response indicates that the service is not able to process the + incoming request. The reason is provided in the error message. + + :param error: The details of the error. + :type error: ~azure.mgmt.appconfiguration.models.ErrorDetails + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) -class ErrorException(HttpOperationError): - """Server responsed with exception of type: 'Error'. +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. :param deserialize: A deserializer :param response: Server response to be deserialized. @@ -318,28 +464,33 @@ class ErrorException(HttpOperationError): def __init__(self, deserialize, response, *args): - super(ErrorException, self).__init__(deserialize, response, 'Error', *args) + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) class KeyValue(Model): - """The result of a request to retrieve a key-value from the specified - configuration store. + """The key-value resource along with all resource properties. Variables are only populated by the server, and will be ignored when sending a request. + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str :ivar key: The primary identifier of a key-value. The key is used in unison with the label to uniquely identify a key-value. :vartype key: str :ivar label: A value used to group key-values. The label is used in unison with the key to uniquely identify a key-value. :vartype label: str - :ivar value: The value of the key-value. - :vartype value: str - :ivar content_type: The content type of the key-value's value. + :param value: The value of the key-value. + :type value: str + :param content_type: The content type of the key-value's value. Providing a proper content-type can enable transformations of values when they are retrieved by applications. - :vartype content_type: str + :type content_type: str :ivar e_tag: An ETag indicating the state of a key-value within a configuration store. :vartype e_tag: str @@ -349,43 +500,49 @@ class KeyValue(Model): :ivar locked: A value indicating whether the key-value is locked. A locked key-value may not be modified until it is unlocked. :vartype locked: bool - :ivar tags: A dictionary of tags that can help identify what a key-value + :param tags: A dictionary of tags that can help identify what a key-value may be applicable for. - :vartype tags: dict[str, str] + :type tags: dict[str, str] """ _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, 'key': {'readonly': True}, 'label': {'readonly': True}, - 'value': {'readonly': True}, - 'content_type': {'readonly': True}, 'e_tag': {'readonly': True}, 'last_modified': {'readonly': True}, 'locked': {'readonly': True}, - 'tags': {'readonly': True}, } _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'content_type': {'key': 'contentType', 'type': 'str'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, - 'locked': {'key': 'locked', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'key': {'key': 'properties.key', 'type': 'str'}, + 'label': {'key': 'properties.label', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'content_type': {'key': 'properties.contentType', 'type': 'str'}, + 'e_tag': {'key': 'properties.eTag', 'type': 'str'}, + 'last_modified': {'key': 'properties.lastModified', 'type': 'iso-8601'}, + 'locked': {'key': 'properties.locked', 'type': 'bool'}, + 'tags': {'key': 'properties.tags', 'type': '{str}'}, } def __init__(self, **kwargs): super(KeyValue, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None self.key = None self.label = None - self.value = None - self.content_type = None + self.value = kwargs.get('value', None) + self.content_type = kwargs.get('content_type', None) self.e_tag = None self.last_modified = None self.locked = None - self.tags = None + self.tags = kwargs.get('tags', None) class KeyVaultProperties(Model): @@ -409,30 +566,99 @@ def __init__(self, **kwargs): self.identity_client_id = kwargs.get('identity_client_id', None) -class ListKeyValueParameters(Model): - """The parameters used to list a configuration store key-value. +class LogSpecification(Model): + """Specifications of the Log 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 blob_duration: Blob duration of the log + :type blob_duration: str + """ - :param key: Required. The key to retrieve. - :type key: str - :param label: The label of the key. - :type label: str + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', '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) + self.blob_duration = kwargs.get('blob_duration', None) + + +class MetricDimension(Model): + """Specifications of the Dimension of metrics. + + :param name: Name of the dimension + :type name: str + :param display_name: Localized friendly display name of the dimension + :type display_name: str + :param internal_name: Internal name of the dimension. + :type internal_name: str """ - _validation = { - 'key': {'required': True}, + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', 'type': 'str'}, } + def __init__(self, **kwargs): + super(MetricDimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.internal_name = kwargs.get('internal_name', None) + + +class MetricSpecification(Model): + """Specifications of the Metrics for Azure Monitoring. + + :param name: Name of the metric + :type name: str + :param display_name: Localized friendly display name of the metric + :type display_name: str + :param display_description: Localized friendly description of the metric + :type display_description: str + :param unit: Unit that makes sense for the metric + :type unit: str + :param aggregation_type: Only provide one value for this field. Valid + values: Average, Minimum, Maximum, Total, Count. + :type aggregation_type: str + :param internal_metric_name: Internal metric name. + :type internal_metric_name: str + :param dimensions: Dimensions of the metric + :type dimensions: + list[~azure.mgmt.appconfiguration.models.MetricDimension] + :param fill_gap_with_zero: Optional. If set to true, then zero will be + returned for time duration where no metric is emitted/published. + :type fill_gap_with_zero: bool + """ + _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, } def __init__(self, **kwargs): - super(ListKeyValueParameters, self).__init__(**kwargs) - self.key = kwargs.get('key', None) - self.label = kwargs.get('label', None) + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.internal_metric_name = kwargs.get('internal_metric_name', None) + self.dimensions = kwargs.get('dimensions', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) class NameAvailabilityStatus(Model): @@ -475,21 +701,33 @@ class OperationDefinition(Model): :param name: Operation name: {provider}/{resource}/{operation}. :type name: str + :param is_data_action: Indicates whether the operation is a data action + :type is_data_action: bool :param display: The display information for the configuration store operation. :type display: ~azure.mgmt.appconfiguration.models.OperationDefinitionDisplay + :param origin: Origin of the operation + :type origin: str + :param properties: Properties of the operation + :type properties: ~azure.mgmt.appconfiguration.models.OperationProperties """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, 'display': {'key': 'display', 'type': 'OperationDefinitionDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'OperationProperties'}, } def __init__(self, **kwargs): super(OperationDefinition, self).__init__(**kwargs) self.name = kwargs.get('name', None) + self.is_data_action = kwargs.get('is_data_action', None) self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.properties = kwargs.get('properties', None) class OperationDefinitionDisplay(Model): @@ -527,6 +765,23 @@ def __init__(self, **kwargs): self.description = kwargs.get('description', None) +class OperationProperties(Model): + """Extra Operation properties. + + :param service_specification: Service specifications of the operation + :type service_specification: + ~azure.mgmt.appconfiguration.models.ServiceSpecification + """ + + _attribute_map = { + 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, **kwargs): + super(OperationProperties, self).__init__(**kwargs) + self.service_specification = kwargs.get('service_specification', None) + + class PrivateEndpoint(Model): """Private endpoint which a connection belongs to. @@ -738,6 +993,41 @@ def __init__(self, **kwargs): self.actions_required = None +class ProxyResource(Resource): + """Proxy Resource. + + The resource model definition for a Azure Resource Manager proxy resource. + It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) + + class RegenerateKeyParameters(Model): """The parameters used to regenerate an API key. @@ -800,6 +1090,29 @@ def __init__(self, **kwargs): self.tenant_id = None +class ServiceSpecification(Model): + """Service specification payload. + + :param log_specifications: Specifications of the Log for Azure Monitoring + :type log_specifications: + list[~azure.mgmt.appconfiguration.models.LogSpecification] + :param metric_specifications: Specifications of the Metrics for Azure + Monitoring + :type metric_specifications: + list[~azure.mgmt.appconfiguration.models.MetricSpecification] + """ + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.log_specifications = kwargs.get('log_specifications', None) + self.metric_specifications = kwargs.get('metric_specifications', None) + + class Sku(Model): """Describes a configuration store SKU. @@ -822,6 +1135,47 @@ def __init__(self, **kwargs): self.name = kwargs.get('name', 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.appconfiguration.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.appconfiguration.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 UserIdentity(Model): """A resource identity that is managed by the user of the service. diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/_models_py3.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/_models_py3.py index 15213ffa3a2dd..26ff2df5587ad 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/_models_py3.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/_models_py3.py @@ -64,6 +64,84 @@ def __init__(self, **kwargs) -> None: self.read_only = None +class Resource(Model): + """Resource. + + Common fields that are returned in the response for all Azure Resource + Manager resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """Entity Resource. + + The resource model definition for an Azure Resource Manager resource with + an etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + class CheckNameAvailabilityParameters(Model): """Parameters used for checking whether a resource name is available. @@ -104,25 +182,29 @@ class CloudError(Model): } -class Resource(Model): - """An Azure resource. +class TrackedResource(Resource): + """Tracked Resource. + + The resource model definition for an Azure Resource Manager tracked top + level resource which has 'tags' and a 'location'. 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: The resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str - :ivar name: The name of the resource. + :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str - :param location: Required. The location of the resource. This cannot be - changed after the resource is created. - :type location: str - :param tags: The tags of the resource. + :param tags: Resource tags. :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str """ _validation = { @@ -136,20 +218,17 @@ class Resource(Model): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, } def __init__(self, *, location: str, tags=None, **kwargs) -> None: - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = location + super(TrackedResource, self).__init__(**kwargs) self.tags = tags + self.location = location -class ConfigurationStore(Resource): +class ConfigurationStore(TrackedResource): """The configuration store along with all resource properties. The Configuration Store will have all information to begin utilizing it. @@ -158,17 +237,18 @@ class ConfigurationStore(Resource): All required parameters must be populated in order to send to Azure. - :ivar id: The resource ID. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str - :ivar name: The name of the resource. + :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str - :param location: Required. The location of the resource. This cannot be - changed after the resource is created. - :type location: str - :param tags: The tags of the resource. + :param tags: Resource tags. :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str :param identity: The managed identity information, if configured. :type identity: ~azure.mgmt.appconfiguration.models.ResourceIdentity :ivar provisioning_state: The provisioning state of the configuration @@ -192,8 +272,13 @@ class ConfigurationStore(Resource): values include: 'Enabled', 'Disabled' :type public_network_access: str or ~azure.mgmt.appconfiguration.models.PublicNetworkAccess + :param disable_local_auth: Disables all authentication methods other than + AAD authentication. + :type disable_local_auth: bool :param sku: Required. The sku of the configuration store. :type sku: ~azure.mgmt.appconfiguration.models.Sku + :param system_data: Resource system metadata. + :type system_data: ~azure.mgmt.appconfiguration.models.SystemData """ _validation = { @@ -212,8 +297,8 @@ class ConfigurationStore(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, @@ -221,11 +306,13 @@ class ConfigurationStore(Resource): 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperties'}, 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnectionReference]'}, 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'disable_local_auth': {'key': 'properties.disableLocalAuth', 'type': 'bool'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } - def __init__(self, *, location: str, sku, tags=None, identity=None, encryption=None, public_network_access=None, **kwargs) -> None: - super(ConfigurationStore, self).__init__(location=location, tags=tags, **kwargs) + def __init__(self, *, location: str, sku, tags=None, identity=None, encryption=None, public_network_access=None, disable_local_auth: bool=None, system_data=None, **kwargs) -> None: + super(ConfigurationStore, self).__init__(tags=tags, location=location, **kwargs) self.identity = identity self.provisioning_state = None self.creation_date = None @@ -233,7 +320,9 @@ def __init__(self, *, location: str, sku, tags=None, identity=None, encryption=N self.encryption = encryption self.private_endpoint_connections = None self.public_network_access = public_network_access + self.disable_local_auth = disable_local_auth self.sku = sku + self.system_data = system_data class ConfigurationStoreUpdateParameters(Model): @@ -241,11 +330,9 @@ class ConfigurationStoreUpdateParameters(Model): :param encryption: The encryption settings of the configuration store. :type encryption: ~azure.mgmt.appconfiguration.models.EncryptionProperties - :param public_network_access: Control permission for data plane traffic - coming from public networks while private endpoint is enabled. Possible - values include: 'Enabled', 'Disabled' - :type public_network_access: str or - ~azure.mgmt.appconfiguration.models.PublicNetworkAccess + :param disable_local_auth: Disables all authentication methods other than + AAD authentication. + :type disable_local_auth: bool :param identity: The managed identity information for the configuration store. :type identity: ~azure.mgmt.appconfiguration.models.ResourceIdentity @@ -257,16 +344,16 @@ class ConfigurationStoreUpdateParameters(Model): _attribute_map = { 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionProperties'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'disable_local_auth': {'key': 'properties.disableLocalAuth', 'type': 'bool'}, 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, 'sku': {'key': 'sku', 'type': 'Sku'}, 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, encryption=None, public_network_access=None, identity=None, sku=None, tags=None, **kwargs) -> None: + def __init__(self, *, encryption=None, disable_local_auth: bool=None, identity=None, sku=None, tags=None, **kwargs) -> None: super(ConfigurationStoreUpdateParameters, self).__init__(**kwargs) self.encryption = encryption - self.public_network_access = public_network_access + self.disable_local_auth = disable_local_auth self.identity = identity self.sku = sku self.tags = tags @@ -289,28 +376,87 @@ def __init__(self, *, key_vault_properties=None, **kwargs) -> None: self.key_vault_properties = key_vault_properties -class Error(Model): - """AppConfiguration error object. +class ErrorAdditionalInfo(Model): + """The resource management error additional info. - :param code: Error code. - :type code: str - :param message: Error message. - :type message: str + 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 ErrorDetails(Model): + """The details of the error. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.appconfiguration.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.code = None + self.message = None + self.additional_info = None + + +class ErrorResponse(Model): + """Error response indicates that the service is not able to process the + incoming request. The reason is provided in the error message. + + :param error: The details of the error. + :type error: ~azure.mgmt.appconfiguration.models.ErrorDetails + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, } - def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: - super(Error, self).__init__(**kwargs) - self.code = code - self.message = message + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error -class ErrorException(HttpOperationError): - """Server responsed with exception of type: 'Error'. +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. :param deserialize: A deserializer :param response: Server response to be deserialized. @@ -318,28 +464,33 @@ class ErrorException(HttpOperationError): def __init__(self, deserialize, response, *args): - super(ErrorException, self).__init__(deserialize, response, 'Error', *args) + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) class KeyValue(Model): - """The result of a request to retrieve a key-value from the specified - configuration store. + """The key-value resource along with all resource properties. Variables are only populated by the server, and will be ignored when sending a request. + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str :ivar key: The primary identifier of a key-value. The key is used in unison with the label to uniquely identify a key-value. :vartype key: str :ivar label: A value used to group key-values. The label is used in unison with the key to uniquely identify a key-value. :vartype label: str - :ivar value: The value of the key-value. - :vartype value: str - :ivar content_type: The content type of the key-value's value. + :param value: The value of the key-value. + :type value: str + :param content_type: The content type of the key-value's value. Providing a proper content-type can enable transformations of values when they are retrieved by applications. - :vartype content_type: str + :type content_type: str :ivar e_tag: An ETag indicating the state of a key-value within a configuration store. :vartype e_tag: str @@ -349,43 +500,49 @@ class KeyValue(Model): :ivar locked: A value indicating whether the key-value is locked. A locked key-value may not be modified until it is unlocked. :vartype locked: bool - :ivar tags: A dictionary of tags that can help identify what a key-value + :param tags: A dictionary of tags that can help identify what a key-value may be applicable for. - :vartype tags: dict[str, str] + :type tags: dict[str, str] """ _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, 'key': {'readonly': True}, 'label': {'readonly': True}, - 'value': {'readonly': True}, - 'content_type': {'readonly': True}, 'e_tag': {'readonly': True}, 'last_modified': {'readonly': True}, 'locked': {'readonly': True}, - 'tags': {'readonly': True}, } _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'content_type': {'key': 'contentType', 'type': 'str'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, - 'locked': {'key': 'locked', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'key': {'key': 'properties.key', 'type': 'str'}, + 'label': {'key': 'properties.label', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'content_type': {'key': 'properties.contentType', 'type': 'str'}, + 'e_tag': {'key': 'properties.eTag', 'type': 'str'}, + 'last_modified': {'key': 'properties.lastModified', 'type': 'iso-8601'}, + 'locked': {'key': 'properties.locked', 'type': 'bool'}, + 'tags': {'key': 'properties.tags', 'type': '{str}'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, value: str=None, content_type: str=None, tags=None, **kwargs) -> None: super(KeyValue, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None self.key = None self.label = None - self.value = None - self.content_type = None + self.value = value + self.content_type = content_type self.e_tag = None self.last_modified = None self.locked = None - self.tags = None + self.tags = tags class KeyVaultProperties(Model): @@ -409,30 +566,99 @@ def __init__(self, *, key_identifier: str=None, identity_client_id: str=None, ** self.identity_client_id = identity_client_id -class ListKeyValueParameters(Model): - """The parameters used to list a configuration store key-value. +class LogSpecification(Model): + """Specifications of the Log 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 blob_duration: Blob duration of the log + :type blob_duration: str + """ - :param key: Required. The key to retrieve. - :type key: str - :param label: The label of the key. - :type label: str + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, blob_duration: str=None, **kwargs) -> None: + super(LogSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.blob_duration = blob_duration + + +class MetricDimension(Model): + """Specifications of the Dimension of metrics. + + :param name: Name of the dimension + :type name: str + :param display_name: Localized friendly display name of the dimension + :type display_name: str + :param internal_name: Internal name of the dimension. + :type internal_name: str """ - _validation = { - 'key': {'required': True}, + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', 'type': 'str'}, } + def __init__(self, *, name: str=None, display_name: str=None, internal_name: str=None, **kwargs) -> None: + super(MetricDimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.internal_name = internal_name + + +class MetricSpecification(Model): + """Specifications of the Metrics for Azure Monitoring. + + :param name: Name of the metric + :type name: str + :param display_name: Localized friendly display name of the metric + :type display_name: str + :param display_description: Localized friendly description of the metric + :type display_description: str + :param unit: Unit that makes sense for the metric + :type unit: str + :param aggregation_type: Only provide one value for this field. Valid + values: Average, Minimum, Maximum, Total, Count. + :type aggregation_type: str + :param internal_metric_name: Internal metric name. + :type internal_metric_name: str + :param dimensions: Dimensions of the metric + :type dimensions: + list[~azure.mgmt.appconfiguration.models.MetricDimension] + :param fill_gap_with_zero: Optional. If set to true, then zero will be + returned for time duration where no metric is emitted/published. + :type fill_gap_with_zero: bool + """ + _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, } - def __init__(self, *, key: str, label: str=None, **kwargs) -> None: - super(ListKeyValueParameters, self).__init__(**kwargs) - self.key = key - self.label = label + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, aggregation_type: str=None, internal_metric_name: str=None, dimensions=None, fill_gap_with_zero: bool=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.internal_metric_name = internal_metric_name + self.dimensions = dimensions + self.fill_gap_with_zero = fill_gap_with_zero class NameAvailabilityStatus(Model): @@ -475,21 +701,33 @@ class OperationDefinition(Model): :param name: Operation name: {provider}/{resource}/{operation}. :type name: str + :param is_data_action: Indicates whether the operation is a data action + :type is_data_action: bool :param display: The display information for the configuration store operation. :type display: ~azure.mgmt.appconfiguration.models.OperationDefinitionDisplay + :param origin: Origin of the operation + :type origin: str + :param properties: Properties of the operation + :type properties: ~azure.mgmt.appconfiguration.models.OperationProperties """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, 'display': {'key': 'display', 'type': 'OperationDefinitionDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'OperationProperties'}, } - def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + def __init__(self, *, name: str=None, is_data_action: bool=None, display=None, origin: str=None, properties=None, **kwargs) -> None: super(OperationDefinition, self).__init__(**kwargs) self.name = name + self.is_data_action = is_data_action self.display = display + self.origin = origin + self.properties = properties class OperationDefinitionDisplay(Model): @@ -527,6 +765,23 @@ def __init__(self, *, resource: str=None, operation: str=None, description: str= self.description = description +class OperationProperties(Model): + """Extra Operation properties. + + :param service_specification: Service specifications of the operation + :type service_specification: + ~azure.mgmt.appconfiguration.models.ServiceSpecification + """ + + _attribute_map = { + 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, *, service_specification=None, **kwargs) -> None: + super(OperationProperties, self).__init__(**kwargs) + self.service_specification = service_specification + + class PrivateEndpoint(Model): """Private endpoint which a connection belongs to. @@ -738,6 +993,41 @@ def __init__(self, *, status=None, description: str=None, **kwargs) -> None: self.actions_required = None +class ProxyResource(Resource): + """Proxy Resource. + + The resource model definition for a Azure Resource Manager proxy resource. + It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) + + class RegenerateKeyParameters(Model): """The parameters used to regenerate an API key. @@ -800,6 +1090,29 @@ def __init__(self, *, type=None, user_assigned_identities=None, **kwargs) -> Non self.tenant_id = None +class ServiceSpecification(Model): + """Service specification payload. + + :param log_specifications: Specifications of the Log for Azure Monitoring + :type log_specifications: + list[~azure.mgmt.appconfiguration.models.LogSpecification] + :param metric_specifications: Specifications of the Metrics for Azure + Monitoring + :type metric_specifications: + list[~azure.mgmt.appconfiguration.models.MetricSpecification] + """ + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, *, log_specifications=None, metric_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.log_specifications = log_specifications + self.metric_specifications = metric_specifications + + class Sku(Model): """Describes a configuration store SKU. @@ -822,6 +1135,47 @@ def __init__(self, *, name: str, **kwargs) -> None: self.name = name +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.appconfiguration.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.appconfiguration.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 UserIdentity(Model): """A resource identity that is managed by the user of the service. diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/_paged_models.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/_paged_models.py index 1605c10566780..4b75921107d4c 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/_paged_models.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/models/_paged_models.py @@ -77,3 +77,16 @@ class PrivateLinkResourcePaged(Paged): def __init__(self, *args, **kwargs): super(PrivateLinkResourcePaged, self).__init__(*args, **kwargs) +class KeyValuePaged(Paged): + """ + A paging container for iterating over a list of :class:`KeyValue ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[KeyValue]'} + } + + def __init__(self, *args, **kwargs): + + super(KeyValuePaged, self).__init__(*args, **kwargs) diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/__init__.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/__init__.py index 3f2fa8e0ec487..0651b55494aa9 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/__init__.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/__init__.py @@ -13,10 +13,12 @@ from ._operations import Operations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._key_values_operations import KeyValuesOperations __all__ = [ 'ConfigurationStoresOperations', 'Operations', 'PrivateEndpointConnectionsOperations', 'PrivateLinkResourcesOperations', + 'KeyValuesOperations', ] diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_configuration_stores_operations.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_configuration_stores_operations.py index e81ce3612e771..a61e16718ca86 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_configuration_stores_operations.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_configuration_stores_operations.py @@ -26,7 +26,7 @@ class ConfigurationStoresOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The client API version. Constant value: "2020-06-01". + :ivar api_version: The client API version. Constant value: "2021-03-01-preview". """ models = models @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-06-01" + self.api_version = "2021-03-01-preview" self.config = config @@ -59,7 +59,7 @@ def list( :rtype: ~azure.mgmt.appconfiguration.models.ConfigurationStorePaged[~azure.mgmt.appconfiguration.models.ConfigurationStore] :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -100,7 +100,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) return response @@ -135,7 +135,7 @@ def list_by_resource_group( :rtype: ~azure.mgmt.appconfiguration.models.ConfigurationStorePaged[~azure.mgmt.appconfiguration.models.ConfigurationStore] :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -177,7 +177,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) return response @@ -208,7 +208,7 @@ def get( :rtype: ~azure.mgmt.appconfiguration.models.ConfigurationStore or ~msrest.pipeline.ClientRawResponse :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -238,7 +238,7 @@ def get( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -286,7 +286,7 @@ def _create_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -326,7 +326,7 @@ def create( or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appconfiguration.models.ConfigurationStore]] :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ raw_result = self._create_initial( resource_group_name=resource_group_name, @@ -385,7 +385,7 @@ def _delete_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -410,7 +410,7 @@ def delete( :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -469,7 +469,7 @@ def _update_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -509,7 +509,7 @@ def update( or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appconfiguration.models.ConfigurationStore]] :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -562,7 +562,7 @@ def list_keys( :rtype: ~azure.mgmt.appconfiguration.models.ApiKeyPaged[~azure.mgmt.appconfiguration.models.ApiKey] :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -605,7 +605,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) return response @@ -616,7 +616,7 @@ def internal_paging(next_link=None): deserialized = models.ApiKeyPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/ListKeys'} + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/listKeys'} def regenerate_key( self, resource_group_name, config_store_name, id=None, custom_headers=None, raw=False, **operation_config): @@ -638,7 +638,7 @@ def regenerate_key( :rtype: ~azure.mgmt.appconfiguration.models.ApiKey or ~msrest.pipeline.ClientRawResponse :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ regenerate_key_parameters = models.RegenerateKeyParameters(id=id) @@ -674,7 +674,7 @@ def regenerate_key( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -685,75 +685,4 @@ def regenerate_key( return client_raw_response return deserialized - regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/RegenerateKey'} - - def list_key_value( - self, resource_group_name, config_store_name, key, label=None, custom_headers=None, raw=False, **operation_config): - """Lists a configuration store key-value. - - :param resource_group_name: The name of the resource group to which - the container registry belongs. - :type resource_group_name: str - :param config_store_name: The name of the configuration store. - :type config_store_name: str - :param key: The key to retrieve. - :type key: str - :param label: The label of the key. - :type label: 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: KeyValue or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.appconfiguration.models.KeyValue or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorException` - """ - list_key_value_parameters = models.ListKeyValueParameters(key=key, label=label) - - # Construct URL - url = self.list_key_value.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'), - 'configStoreName': self._serialize.url("config_store_name", config_store_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9_-]*$') - } - 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(list_key_value_parameters, 'ListKeyValueParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('KeyValue', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_key_value.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/listKeyValue'} + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/regenerateKey'} diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_key_values_operations.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_key_values_operations.py new file mode 100644 index 0000000000000..317c4a3078a8e --- /dev/null +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_key_values_operations.py @@ -0,0 +1,345 @@ +# 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 KeyValuesOperations(object): + """KeyValuesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The client API version. Constant value: "2021-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-01-preview" + + self.config = config + + def list_by_configuration_store( + self, resource_group_name, config_store_name, skip_token=None, custom_headers=None, raw=False, **operation_config): + """Lists the key-values for a given configuration store. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param config_store_name: The name of the configuration store. + :type config_store_name: str + :param skip_token: A skip token is used to continue retrieving items + after an operation returns a partial result. If a previous response + contains a nextLink element, the value of the nextLink element will + include a skipToken parameter that specifies a starting point to use + for subsequent calls. + :type skip_token: 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 KeyValue + :rtype: + ~azure.mgmt.appconfiguration.models.KeyValuePaged[~azure.mgmt.appconfiguration.models.KeyValue] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_configuration_store.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'), + 'configStoreName': self._serialize.url("config_store_name", config_store_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9_-]*$') + } + 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') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.KeyValuePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_configuration_store.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues'} + + def get( + self, resource_group_name, config_store_name, key_value_name, custom_headers=None, raw=False, **operation_config): + """Gets the properties of the specified key-value. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param config_store_name: The name of the configuration store. + :type config_store_name: str + :param key_value_name: Identifier of key and label combination. Key + and label are joined by $ character. Label is optional. + :type key_value_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: KeyValue or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appconfiguration.models.KeyValue or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct 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'), + 'configStoreName': self._serialize.url("config_store_name", config_store_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9_-]*$'), + 'keyValueName': self._serialize.url("key_value_name", key_value_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('KeyValue', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}'} + + def create_or_update( + self, resource_group_name, config_store_name, key_value_name, key_value_parameters=None, custom_headers=None, raw=False, **operation_config): + """Creates a key-value. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param config_store_name: The name of the configuration store. + :type config_store_name: str + :param key_value_name: Identifier of key and label combination. Key + and label are joined by $ character. Label is optional. + :type key_value_name: str + :param key_value_parameters: The parameters for creating a key-value. + :type key_value_parameters: + ~azure.mgmt.appconfiguration.models.KeyValue + :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: KeyValue or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appconfiguration.models.KeyValue or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'configStoreName': self._serialize.url("config_store_name", config_store_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9_-]*$'), + 'keyValueName': self._serialize.url("key_value_name", key_value_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 + if key_value_parameters is not None: + body_content = self._serialize.body(key_value_parameters, 'KeyValue') + else: + body_content = None + + # 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('KeyValue', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}'} + + + def _delete_initial( + self, resource_group_name, config_store_name, key_value_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'configStoreName': self._serialize.url("config_store_name", config_store_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9_-]*$'), + 'keyValueName': self._serialize.url("key_value_name", key_value_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, resource_group_name, config_store_name, key_value_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a key-value. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param config_store_name: The name of the configuration store. + :type config_store_name: str + :param key_value_name: Identifier of key and label combination. Key + and label are joined by $ character. Label is optional. + :type key_value_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, + config_store_name=config_store_name, + key_value_name=key_value_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.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}'} diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_operations.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_operations.py index 98a1d019392d1..992bee33697ca 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_operations.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_operations.py @@ -24,7 +24,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The client API version. Constant value: "2020-06-01". + :ivar api_version: The client API version. Constant value: "2021-03-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-06-01" + self.api_version = "2021-03-01-preview" self.config = config @@ -53,7 +53,7 @@ def check_name_availability( :rtype: ~azure.mgmt.appconfiguration.models.NameAvailabilityStatus or ~msrest.pipeline.ClientRawResponse :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ check_name_availability_parameters = models.CheckNameAvailabilityParameters(name=name) @@ -87,7 +87,7 @@ def check_name_availability( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -119,7 +119,7 @@ def list( :rtype: ~azure.mgmt.appconfiguration.models.OperationDefinitionPaged[~azure.mgmt.appconfiguration.models.OperationDefinition] :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -156,7 +156,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) return response diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_private_endpoint_connections_operations.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_private_endpoint_connections_operations.py index 0994852951e1c..96a37d2d6832e 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_private_endpoint_connections_operations.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_private_endpoint_connections_operations.py @@ -26,7 +26,7 @@ class PrivateEndpointConnectionsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The client API version. Constant value: "2020-06-01". + :ivar api_version: The client API version. Constant value: "2021-03-01-preview". """ models = models @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-06-01" + self.api_version = "2021-03-01-preview" self.config = config @@ -58,7 +58,7 @@ def list_by_configuration_store( :rtype: ~azure.mgmt.appconfiguration.models.PrivateEndpointConnectionPaged[~azure.mgmt.appconfiguration.models.PrivateEndpointConnection] :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -99,7 +99,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) return response @@ -134,7 +134,7 @@ def get( :rtype: ~azure.mgmt.appconfiguration.models.PrivateEndpointConnection or ~msrest.pipeline.ClientRawResponse :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -165,7 +165,7 @@ def get( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -216,7 +216,7 @@ def _create_or_update_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -265,7 +265,7 @@ def create_or_update( or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appconfiguration.models.PrivateEndpointConnection]] :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -327,7 +327,7 @@ def _delete_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -355,7 +355,7 @@ def delete( :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ raw_result = self._delete_initial( resource_group_name=resource_group_name, diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_private_link_resources_operations.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_private_link_resources_operations.py index 2889aa906108d..c59615cd56ebc 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_private_link_resources_operations.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/operations/_private_link_resources_operations.py @@ -24,7 +24,7 @@ class PrivateLinkResourcesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The client API version. Constant value: "2020-06-01". + :ivar api_version: The client API version. Constant value: "2021-03-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-06-01" + self.api_version = "2021-03-01-preview" self.config = config @@ -57,7 +57,7 @@ def list_by_configuration_store( :rtype: ~azure.mgmt.appconfiguration.models.PrivateLinkResourcePaged[~azure.mgmt.appconfiguration.models.PrivateLinkResource] :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -98,7 +98,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) return response @@ -132,7 +132,7 @@ def get( :rtype: ~azure.mgmt.appconfiguration.models.PrivateLinkResource or ~msrest.pipeline.ClientRawResponse :raises: - :class:`ErrorException` + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -163,7 +163,7 @@ def get( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: