Skip to content

Commit

Permalink
Generated from 6d9c73eb24e60d117da852b974504d93e47d1a3c (#2744)
Browse files Browse the repository at this point in the history
renaming older operation
  • Loading branch information
AutorestCI authored Jun 19, 2018
1 parent 600c8e7 commit ce2cd5f
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,71 @@ def get_long_running_output(response):
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
online_region.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion'}

def get_read_only_keys(
self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config):
"""Lists the read-only access keys for the specified Azure Cosmos DB
database account.
:param resource_group_name: Name of an Azure resource group.
:type resource_group_name: str
:param account_name: Cosmos DB database account name.
:type account_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<msrest:optionsforoperations>`.
:return: DatabaseAccountListReadOnlyKeysResult or ClientRawResponse if
raw=true
:rtype:
~azure.mgmt.cosmosdb.models.DatabaseAccountListReadOnlyKeysResult or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = self.get_read_only_keys.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3)
}
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['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 and send request
request = self._client.get(url, query_parameters)
response = self._client.send(request, header_parameters, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('DatabaseAccountListReadOnlyKeysResult', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized
get_read_only_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys'}

def list_read_only_keys(
self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config):
"""Lists the read-only access keys for the specified Azure Cosmos DB
Expand Down Expand Up @@ -972,7 +1037,7 @@ def list_read_only_keys(
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)
request = self._client.post(url, query_parameters)
response = self._client.send(request, header_parameters, stream=False, **operation_config)

if response.status_code not in [200]:
Expand Down
2 changes: 1 addition & 1 deletion azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
# regenerated.
# --------------------------------------------------------------------------

VERSION = "0.4.1"
VERSION = "0.3.0"

0 comments on commit ce2cd5f

Please sign in to comment.