Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -44,6 +48,8 @@
'ConfigurationStore',
'ConfigurationStoreUpdateParameters',
'Error', 'ErrorException',
'KeyValue',
'ListKeyValueParameters',
'NameAvailabilityStatus',
'OperationDefinition',
'OperationDefinitionDisplay',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<msrest:optionsforoperations>`.
:return: KeyValue or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.appconfiguration.models.KeyValue or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorException<azure.mgmt.appconfiguration.models.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'}
1 change: 0 additions & 1 deletion sdk/appconfiguration/azure-mgmt-appconfiguration/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down