Skip to content

Commit

Permalink
CodeGen from PR 13710 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 4fb56a9329006253f3696928d71c19dd74f55f82 into 915386f
  • Loading branch information
SDKAuto committed Apr 22, 2021
1 parent 582085e commit 3a68dcc
Show file tree
Hide file tree
Showing 78 changed files with 15,696 additions and 1,844 deletions.
1 change: 1 addition & 0 deletions sdk/cosmos/azure-mgmt-cosmosdb/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include _meta.json
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
Expand Down
8 changes: 8 additions & 0 deletions sdk/cosmos/azure-mgmt-cosmosdb/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"autorest": "3.3.0",
"use": "@autorest/python@5.6.6",
"commit": "0b645cfc55b1125273abc0a02dbedbff6fc2c26a",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/cosmos-db/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.6.6 --version=3.3.0",
"readme": "specification/cosmos-db/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2021-03-15"
self.api_version = "2021-04-01-preview"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-cosmosdb/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from typing import Any, Optional

from azure.core.credentials import TokenCredential
from azure.core.pipeline.transport import HttpRequest, HttpResponse

from ._configuration import CosmosDBManagementClientConfiguration
from .operations import DatabaseAccountsOperations
Expand All @@ -36,13 +37,24 @@
from .operations import TableResourcesOperations
from .operations import CassandraResourcesOperations
from .operations import GremlinResourcesOperations
from .operations import RestorableDatabaseAccountsOperations
from .operations import CosmosDBManagementClientOperationsMixin
from .operations import NotebookWorkspacesOperations
from .operations import RestorableSqlDatabasesOperations
from .operations import RestorableSqlContainersOperations
from .operations import RestorableSqlResourcesOperations
from .operations import RestorableMongodbDatabasesOperations
from .operations import RestorableMongodbCollectionsOperations
from .operations import RestorableMongodbResourcesOperations
from .operations import CassandraClustersOperations
from .operations import CassandraDataCentersOperations
from .operations import PrivateLinkResourcesOperations
from .operations import PrivateEndpointConnectionsOperations
from .operations import ServiceOperations
from . import models


class CosmosDBManagementClient(object):
class CosmosDBManagementClient(CosmosDBManagementClientOperationsMixin):
"""Azure Cosmos DB Database Service Resource Provider REST API.
:ivar database_accounts: DatabaseAccountsOperations operations
Expand Down Expand Up @@ -81,12 +93,32 @@ class CosmosDBManagementClient(object):
:vartype cassandra_resources: azure.mgmt.cosmosdb.operations.CassandraResourcesOperations
:ivar gremlin_resources: GremlinResourcesOperations operations
:vartype gremlin_resources: azure.mgmt.cosmosdb.operations.GremlinResourcesOperations
:ivar restorable_database_accounts: RestorableDatabaseAccountsOperations operations
:vartype restorable_database_accounts: azure.mgmt.cosmosdb.operations.RestorableDatabaseAccountsOperations
:ivar notebook_workspaces: NotebookWorkspacesOperations operations
:vartype notebook_workspaces: azure.mgmt.cosmosdb.operations.NotebookWorkspacesOperations
:ivar restorable_sql_databases: RestorableSqlDatabasesOperations operations
:vartype restorable_sql_databases: azure.mgmt.cosmosdb.operations.RestorableSqlDatabasesOperations
:ivar restorable_sql_containers: RestorableSqlContainersOperations operations
:vartype restorable_sql_containers: azure.mgmt.cosmosdb.operations.RestorableSqlContainersOperations
:ivar restorable_sql_resources: RestorableSqlResourcesOperations operations
:vartype restorable_sql_resources: azure.mgmt.cosmosdb.operations.RestorableSqlResourcesOperations
:ivar restorable_mongodb_databases: RestorableMongodbDatabasesOperations operations
:vartype restorable_mongodb_databases: azure.mgmt.cosmosdb.operations.RestorableMongodbDatabasesOperations
:ivar restorable_mongodb_collections: RestorableMongodbCollectionsOperations operations
:vartype restorable_mongodb_collections: azure.mgmt.cosmosdb.operations.RestorableMongodbCollectionsOperations
:ivar restorable_mongodb_resources: RestorableMongodbResourcesOperations operations
:vartype restorable_mongodb_resources: azure.mgmt.cosmosdb.operations.RestorableMongodbResourcesOperations
:ivar cassandra_clusters: CassandraClustersOperations operations
:vartype cassandra_clusters: azure.mgmt.cosmosdb.operations.CassandraClustersOperations
:ivar cassandra_data_centers: CassandraDataCentersOperations operations
:vartype cassandra_data_centers: azure.mgmt.cosmosdb.operations.CassandraDataCentersOperations
:ivar private_link_resources: PrivateLinkResourcesOperations operations
:vartype private_link_resources: azure.mgmt.cosmosdb.operations.PrivateLinkResourcesOperations
:ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
:vartype private_endpoint_connections: azure.mgmt.cosmosdb.operations.PrivateEndpointConnectionsOperations
:ivar service: ServiceOperations operations
:vartype service: azure.mgmt.cosmosdb.operations.ServiceOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription.
Expand Down Expand Up @@ -149,12 +181,50 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.gremlin_resources = GremlinResourcesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.restorable_database_accounts = RestorableDatabaseAccountsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.notebook_workspaces = NotebookWorkspacesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.restorable_sql_databases = RestorableSqlDatabasesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.restorable_sql_containers = RestorableSqlContainersOperations(
self._client, self._config, self._serialize, self._deserialize)
self.restorable_sql_resources = RestorableSqlResourcesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.restorable_mongodb_databases = RestorableMongodbDatabasesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.restorable_mongodb_collections = RestorableMongodbCollectionsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.restorable_mongodb_resources = RestorableMongodbResourcesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.cassandra_clusters = CassandraClustersOperations(
self._client, self._config, self._serialize, self._deserialize)
self.cassandra_data_centers = CassandraDataCentersOperations(
self._client, self._config, self._serialize, self._deserialize)
self.private_link_resources = PrivateLinkResourcesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.service = ServiceOperations(
self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, http_request, **kwargs):
# type: (HttpRequest, Any) -> HttpResponse
"""Runs the network request through the client's chained policies.
:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.HttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

def close(self):
# type: () -> None
Expand Down
104 changes: 93 additions & 11 deletions sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chosen_version": "2021-03-15",
"total_api_version_list": ["2021-03-15"],
"chosen_version": "2021-04-01-preview",
"total_api_version_list": ["2021-04-01-preview"],
"client": {
"name": "CosmosDBManagementClient",
"filename": "_cosmos_db_management_client",
Expand All @@ -9,7 +9,9 @@
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": false
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"CosmosDBManagementClientConfiguration\"], \"._operations_mixin\": [\"CosmosDBManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"CosmosDBManagementClientConfiguration\"], \"._operations_mixin\": [\"CosmosDBManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
},
"global_parameters": {
"sync": {
Expand All @@ -28,28 +30,72 @@
},
"async": {
"credential": {
"signature": "credential, # type: \"AsyncTokenCredential\"",
"signature": "credential: \"AsyncTokenCredential\",",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"signature": "subscription_id: str,",
"description": "The ID of the target subscription.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"call": "credential, subscription_id"
"call": "credential, subscription_id",
"service_client_specific": {
"sync": {
"api_version": {
"signature": "api_version=None, # type: Optional[str]",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url=None, # type: Optional[str]",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
},
"async": {
"api_version": {
"signature": "api_version: Optional[str] = None,",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url: Optional[str] = None,",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile: KnownProfiles = KnownProfiles.default,",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
}
}
},
"config": {
"credential": true,
"credential_scopes": ["https://management.azure.com/.default"],
"credential_default_policy_type": "BearerTokenCredentialPolicy",
"credential_default_policy_type_has_async_version": true,
"credential_key_header_name": null
"credential_key_header_name": null,
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"operation_groups": {
"database_accounts": "DatabaseAccountsOperations",
Expand All @@ -70,12 +116,48 @@
"table_resources": "TableResourcesOperations",
"cassandra_resources": "CassandraResourcesOperations",
"gremlin_resources": "GremlinResourcesOperations",
"restorable_database_accounts": "RestorableDatabaseAccountsOperations",
"notebook_workspaces": "NotebookWorkspacesOperations",
"restorable_sql_databases": "RestorableSqlDatabasesOperations",
"restorable_sql_containers": "RestorableSqlContainersOperations",
"restorable_sql_resources": "RestorableSqlResourcesOperations",
"restorable_mongodb_databases": "RestorableMongodbDatabasesOperations",
"restorable_mongodb_collections": "RestorableMongodbCollectionsOperations",
"restorable_mongodb_resources": "RestorableMongodbResourcesOperations",
"cassandra_clusters": "CassandraClustersOperations",
"cassandra_data_centers": "CassandraDataCentersOperations",
"private_link_resources": "PrivateLinkResourcesOperations",
"private_endpoint_connections": "PrivateEndpointConnectionsOperations"
"private_endpoint_connections": "PrivateEndpointConnectionsOperations",
"service": "ServiceOperations"
},
"operation_mixins": {
},
"sync_imports": "None",
"async_imports": "None"
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Iterable\", \"Optional\", \"TypeVar\"]}}}",
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"], \"azure.core.async_paging\": [\"AsyncItemPaged\", \"AsyncList\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}",
"operations": {
"location_list" : {
"sync": {
"signature": "def location_list(\n self,\n **kwargs # type: Any\n):\n",
"doc": "\"\"\"List Cosmos DB locations and their properties.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either LocationListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.LocationListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"async": {
"coroutine": false,
"signature": "def location_list(\n self,\n **kwargs\n) -\u003e AsyncItemPaged[\"_models.LocationListResult\"]:\n",
"doc": "\"\"\"List Cosmos DB locations and their properties.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either LocationListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.LocationListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"call": ""
},
"location_get" : {
"sync": {
"signature": "def location_get(\n self,\n location, # type: str\n **kwargs # type: Any\n):\n",
"doc": "\"\"\"Get the properties of an existing Cosmos DB location.\n\n:param location: Cosmos DB region, with spaces between words and each word capitalized.\n:type location: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: LocationGetResult, or the result of cls(response)\n:rtype: ~azure.mgmt.cosmosdb.models.LocationGetResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"async": {
"coroutine": true,
"signature": "async def location_get(\n self,\n location: str,\n **kwargs\n) -\u003e \"_models.LocationGetResult\":\n",
"doc": "\"\"\"Get the properties of an existing Cosmos DB location.\n\n:param location: Cosmos DB region, with spaces between words and each word capitalized.\n:type location: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: LocationGetResult, or the result of cls(response)\n:rtype: ~azure.mgmt.cosmosdb.models.LocationGetResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"call": "location"
}
}
}
}
Loading

0 comments on commit 3a68dcc

Please sign in to comment.