From 674099e526b0d64739b5345d7e51769f2bcab205 Mon Sep 17 00:00:00 2001 From: Feng Zhou Date: Mon, 4 Nov 2019 11:16:58 +0000 Subject: [PATCH 1/4] codegen for appconfiguration --- .../mgmt/appconfiguration/models/__init__.py | 6 ++ .../mgmt/appconfiguration/models/_models.py | 93 +++++++++++++++++++ .../appconfiguration/models/_models_py3.py | 93 +++++++++++++++++++ .../_configuration_stores_operations.py | 71 ++++++++++++++ 4 files changed, 263 insertions(+) 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 77b139b97b94..efa072039e5f 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 @@ -15,6 +15,8 @@ from ._models_py3 import ConfigurationStore from ._models_py3 import ConfigurationStoreUpdateParameters from ._models_py3 import Error, ErrorException + from ._models_py3 import KeyValue + from ._models_py3 import ListKeyValueParameters from ._models_py3 import NameAvailabilityStatus from ._models_py3 import OperationDefinition from ._models_py3 import OperationDefinitionDisplay @@ -26,6 +28,8 @@ from ._models import ConfigurationStore from ._models import ConfigurationStoreUpdateParameters from ._models import Error, ErrorException + from ._models import KeyValue + from ._models import ListKeyValueParameters from ._models import NameAvailabilityStatus from ._models import OperationDefinition from ._models import OperationDefinitionDisplay @@ -44,6 +48,8 @@ 'ConfigurationStore', 'ConfigurationStoreUpdateParameters', 'Error', 'ErrorException', + 'KeyValue', + 'ListKeyValueParameters', 'NameAvailabilityStatus', 'OperationDefinition', 'OperationDefinitionDisplay', 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 c6c9f8a31ee9..749c0f1957d4 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 @@ -261,6 +261,99 @@ def __init__(self, deserialize, response, *args): super(ErrorException, self).__init__(deserialize, response, 'Error', *args) +class KeyValue(Model): + """The result of a request to retrieve a key-value from the specified + configuration store. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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. + Providing a proper content-type can enable transformations of values when + they are retrieved by applications. + :vartype content_type: str + :ivar e_tag: An ETag indicating the state of a key-value within a + configuration store. + :vartype e_tag: str + :ivar last_modified: The last time a modifying operation was performed on + the given key-value. + :vartype last_modified: datetime + :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 + may be applicable for. + :vartype tags: dict[str, str] + """ + + _validation = { + '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}'}, + } + + def __init__(self, **kwargs): + super(KeyValue, self).__init__(**kwargs) + self.key = None + self.label = None + self.value = None + self.content_type = None + self.e_tag = None + self.last_modified = None + self.locked = None + self.tags = None + + +class ListKeyValueParameters(Model): + """The parameters used to list a configuration store key-value. + + All required parameters must be populated in order to send to Azure. + + :param key: Required. The key to retrieve. + :type key: str + :param label: The label of the key. + :type label: str + """ + + _validation = { + 'key': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListKeyValueParameters, self).__init__(**kwargs) + self.key = kwargs.get('key', None) + self.label = kwargs.get('label', None) + + class NameAvailabilityStatus(Model): """The result of a request to check the availability of a resource name. 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 3af279a8cb0b..8d4faa52c78b 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 @@ -261,6 +261,99 @@ def __init__(self, deserialize, response, *args): super(ErrorException, self).__init__(deserialize, response, 'Error', *args) +class KeyValue(Model): + """The result of a request to retrieve a key-value from the specified + configuration store. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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. + Providing a proper content-type can enable transformations of values when + they are retrieved by applications. + :vartype content_type: str + :ivar e_tag: An ETag indicating the state of a key-value within a + configuration store. + :vartype e_tag: str + :ivar last_modified: The last time a modifying operation was performed on + the given key-value. + :vartype last_modified: datetime + :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 + may be applicable for. + :vartype tags: dict[str, str] + """ + + _validation = { + '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}'}, + } + + def __init__(self, **kwargs) -> None: + super(KeyValue, self).__init__(**kwargs) + self.key = None + self.label = None + self.value = None + self.content_type = None + self.e_tag = None + self.last_modified = None + self.locked = None + self.tags = None + + +class ListKeyValueParameters(Model): + """The parameters used to list a configuration store key-value. + + All required parameters must be populated in order to send to Azure. + + :param key: Required. The key to retrieve. + :type key: str + :param label: The label of the key. + :type label: str + """ + + _validation = { + 'key': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + } + + def __init__(self, *, key: str, label: str=None, **kwargs) -> None: + super(ListKeyValueParameters, self).__init__(**kwargs) + self.key = key + self.label = label + + class NameAvailabilityStatus(Model): """The result of a request to check the availability of a resource name. 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 8df4aa075fed..cd82238a54f6 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 @@ -693,3 +693,74 @@ def regenerate_key( 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'} From a84f7eb7423f174f89720f0d2bd39e49d813b98c Mon Sep 17 00:00:00 2001 From: Feng Zhou Date: Mon, 4 Nov 2019 11:49:16 +0000 Subject: [PATCH 2/4] changelog --- .../azure-mgmt-appconfiguration/HISTORY.rst | 7 +++++++ .../azure/mgmt/appconfiguration/version.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/HISTORY.rst b/sdk/appconfiguration/azure-mgmt-appconfiguration/HISTORY.rst index 9001198d5005..be0f04883d17 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/HISTORY.rst +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/HISTORY.rst @@ -3,6 +3,13 @@ Release History =============== +0.2.0 (2019-11-04) +++++++++++++++++++ + +**Features** + +- Added operation ConfigurationStoresOperations.list_key_value + 0.1.0 (2019-06-17) ++++++++++++++++++ diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/version.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/version.py index e0ec669828cb..9bd1dfac7ecb 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/version.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "0.2.0" From 021242152c4598602ca83459126bd787389e3e3e Mon Sep 17 00:00:00 2001 From: Feng Zhou Date: Tue, 5 Nov 2019 05:37:46 +0000 Subject: [PATCH 3/4] add test for appconfiguration --- ...ppconfiguration.test_appconfiguration.yaml | 238 ++++++++++++++++++ .../tests/test_cli_mgmt_appconfiguration.py | 61 +++++ 2 files changed, 299 insertions(+) create mode 100644 sdk/appconfiguration/azure-mgmt-appconfiguration/tests/recordings/test_cli_mgmt_appconfiguration.test_appconfiguration.yaml create mode 100644 sdk/appconfiguration/azure-mgmt-appconfiguration/tests/test_cli_mgmt_appconfiguration.py diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/tests/recordings/test_cli_mgmt_appconfiguration.test_appconfiguration.yaml b/sdk/appconfiguration/azure-mgmt-appconfiguration/tests/recordings/test_cli_mgmt_appconfiguration.test_appconfiguration.yaml new file mode 100644 index 000000000000..14ef63ff2c9f --- /dev/null +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/tests/recordings/test_cli_mgmt_appconfiguration.test_appconfiguration.yaml @@ -0,0 +1,238 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"my_tag": "myTagValue"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '56' + Content-Type: + - application/json; charset=utf-8 + User-Agent: + - python/3.6.8 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.8 + msrest_azure/0.4.34 azure-mgmt-appconfiguration/0.2.0 Azure-SDK-For-Python + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_appconfiguration_test_appconfiguration39c8158a/providers/Microsoft.AppConfiguration/configurationStores/contoso1?api-version=2019-02-01-preview + response: + body: + string: '{"type":"Microsoft.AppConfiguration/configurationStores","properties":{"provisioningState":"Creating","creationDate":"2019-11-05T05:33:15.6377583+00:00","endpoint":"https://contoso1.azconfig.io"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_appconfiguration_test_appconfiguration39c8158a/providers/Microsoft.AppConfiguration/configurationStores/contoso1","name":"contoso1","location":"westus","tags":{}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AppConfiguration/locations/westus/operationsStatus/3c7d4565-233f-8a27-7e99-38841f35e662?api-version=2019-02-01-preview + cache-control: + - no-cache + content-length: + - '445' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 05 Nov 2019 05:33:16 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - openresty/1.15.8.1 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.6.8 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.8 + msrest_azure/0.4.34 azure-mgmt-appconfiguration/0.2.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AppConfiguration/locations/westus/operationsStatus/3c7d4565-233f-8a27-7e99-38841f35e662?api-version=2019-02-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AppConfiguration/locations/westus/operationsStatus/3c7d4565-233f-8a27-7e99-38841f35e662","name":"3c7d4565-233f-8a27-7e99-38841f35e662","status":"Succeeded","error":null}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AppConfiguration/locations/westus/operationsStatus/3c7d4565-233f-8a27-7e99-38841f35e662?api-version=2019-02-01-preview + cache-control: + - no-cache + content-length: + - '248' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 05 Nov 2019 05:33:27 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - openresty/1.15.8.1 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.6.8 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.8 + msrest_azure/0.4.34 azure-mgmt-appconfiguration/0.2.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_appconfiguration_test_appconfiguration39c8158a/providers/Microsoft.AppConfiguration/configurationStores/contoso1?api-version=2019-02-01-preview + response: + body: + string: '{"type":"Microsoft.AppConfiguration/configurationStores","properties":{"provisioningState":"Succeeded","creationDate":"2019-11-05T05:33:22+00:00","endpoint":"https://contoso1.azconfig.io"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_appconfiguration_test_appconfiguration39c8158a/providers/Microsoft.AppConfiguration/configurationStores/contoso1","name":"contoso1","location":"westus","tags":{"my_tag":"myTagValue"}}' + headers: + cache-control: + - no-cache + content-length: + - '459' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 05 Nov 2019 05:33:28 GMT + etag: + - W/"02009a9a-0000-0700-0000-5dc109a10000" + expires: + - '-1' + pragma: + - no-cache + server: + - openresty/1.15.8.1 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.6.8 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.8 + msrest_azure/0.4.34 azure-mgmt-appconfiguration/0.2.0 Azure-SDK-For-Python + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_appconfiguration_test_appconfiguration39c8158a/providers/Microsoft.AppConfiguration/configurationStores/contoso1?api-version=2019-02-01-preview + response: + body: + string: '{"type":"Microsoft.AppConfiguration/configurationStores","properties":{"provisioningState":"Succeeded","creationDate":"2019-11-05T05:33:22+00:00","endpoint":"https://contoso1.azconfig.io"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_cli_mgmt_appconfiguration_test_appconfiguration39c8158a/providers/Microsoft.AppConfiguration/configurationStores/contoso1","name":"contoso1","location":"westus","tags":{"my_tag":"myTagValue"}}' + headers: + cache-control: + - no-cache + content-length: + - '459' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 05 Nov 2019 05:33:29 GMT + etag: + - W/"02009a9a-0000-0700-0000-5dc109a10000" + expires: + - '-1' + pragma: + - no-cache + server: + - openresty/1.15.8.1 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"name": "contoso1", "type": "Microsoft.AppConfiguration/configurationStores"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '78' + Content-Type: + - application/json; charset=utf-8 + User-Agent: + - python/3.6.8 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.8 + msrest_azure/0.4.34 azure-mgmt-appconfiguration/0.2.0 Azure-SDK-For-Python + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AppConfiguration/checkNameAvailability?api-version=2019-02-01-preview + response: + body: + string: '{"nameAvailable":false,"message":"The specified name is already in + use.","reason":"AlreadyExists"}' + headers: + cache-control: + - no-cache + content-length: + - '98' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 05 Nov 2019 05:33:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - openresty/1.15.8.1 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/tests/test_cli_mgmt_appconfiguration.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/tests/test_cli_mgmt_appconfiguration.py new file mode 100644 index 000000000000..39ac8144bba4 --- /dev/null +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/tests/test_cli_mgmt_appconfiguration.py @@ -0,0 +1,61 @@ +# 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. +#-------------------------------------------------------------------------- + +import unittest + +import azure.mgmt.appconfiguration +from devtools_testutils import AzureMgmtTestCase, ResourceGroupPreparer + +AZURE_LOCATION = 'eastus' + +class MgmtAppConfigurationTest(AzureMgmtTestCase): + + def setUp(self): + super(MgmtAppConfigurationTest, self).setUp() + self.mgmt_client = self.create_mgmt_client( + azure.mgmt.appconfiguration.AppConfigurationManagementClient + ) + + @ResourceGroupPreparer(location=AZURE_LOCATION) + def test_appconfiguration(self, resource_group): + + SERVICE_NAME = "myapimrndxyz" + CONFIGURATION_STORE_NAME = "contoso1" + + # ConfigurationStores_Create[put] + BODY = { + "location": "westus", + "tags": { + "my_tag": "myTagValue" + } + } + result = self.mgmt_client.configuration_stores.create(resource_group.name, CONFIGURATION_STORE_NAME, BODY["location"], BODY["tags"]) + result = result.result() + self.assertEqual(result.name, CONFIGURATION_STORE_NAME) + self.assertEqual(result.provisioning_state, "Succeeded") + + # ConfigurationStores_Get[get] + result = self.mgmt_client.configuration_stores.get(resource_group.name, CONFIGURATION_STORE_NAME) + self.assertEqual(result.name, CONFIGURATION_STORE_NAME) + self.assertEqual(result.provisioning_state, "Succeeded") + + # ConfigurationStores_CheckNameAvailable[post] + result = self.mgmt_client.operations.check_name_availability(CONFIGURATION_STORE_NAME) + self.assertEqual(result.name_available, False) + + # ConfigurationStores_ListKeys[post] + BODY = {} + result = self.mgmt_client.configuration_stores.list_keys(resource_group.name, CONFIGURATION_STORE_NAME) + + # ConfigurationStores_List[get] + result = self.mgmt_client.configuration_stores.list() + + +#------------------------------------------------------------------------------ +if __name__ == '__main__': + unittest.main() From a252a7bee4c5c17e22bb108d6a247e3fc12535f0 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot Date: Tue, 5 Nov 2019 05:50:26 +0000 Subject: [PATCH 4/4] Packaging update of azure-mgmt-appconfiguration --- sdk/appconfiguration/azure-mgmt-appconfiguration/README.rst | 2 +- sdk/appconfiguration/azure-mgmt-appconfiguration/setup.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/README.rst b/sdk/appconfiguration/azure-mgmt-appconfiguration/README.rst index d048b80fff05..d609f27c53ac 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/README.rst +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure App Configuration Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. +This package has been tested with Python 2.7, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/sdk/appconfiguration/azure-mgmt-appconfiguration/setup.py b/sdk/appconfiguration/azure-mgmt-appconfiguration/setup.py index 85e0c58bbf93..1eee328efe1d 100644 --- a/sdk/appconfiguration/azure-mgmt-appconfiguration/setup.py +++ b/sdk/appconfiguration/azure-mgmt-appconfiguration/setup.py @@ -64,7 +64,6 @@ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7',