forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Remove docdb mgmt package from master (Azure#6585)" (Azure#6593)
This reverts commit d2ed7d8.
- Loading branch information
1 parent
b448f48
commit d5cb186
Showing
36 changed files
with
3,147 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.. :changelog: | ||
Release History | ||
=============== | ||
|
||
0.1.3 (2017-05-02) | ||
++++++++++++++++++ | ||
|
||
* Added property enableAutomaticFailover and consistencyPolicy ConsistentPrefix | ||
|
||
0.1.2 (2017-04-20) | ||
++++++++++++++++++ | ||
|
||
This wheel package is now built with the azure wheel extension | ||
|
||
0.1.1 (2017-03-21) | ||
++++++++++++++++++ | ||
|
||
* Added support for listing database account connection strings | ||
|
||
0.1.0 (2017-01-31) | ||
++++++++++++++++++ | ||
|
||
* Initial Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include *.rst | ||
include azure_bdist_wheel.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
Microsoft Azure SDK for Python | ||
============================== | ||
|
||
This is the Microsoft Azure DocumentDB 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.3, 3.4, 3.5 and 3.6. | ||
|
||
For the older Azure Service Management (ASM) libraries, see | ||
`azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library. | ||
|
||
For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/azure>`__ bundle package. | ||
|
||
|
||
Compatibility | ||
============= | ||
|
||
**IMPORTANT**: If you have an earlier version of the azure package | ||
(version < 1.0), you should uninstall it before installing this package. | ||
|
||
You can check the version using pip: | ||
|
||
.. code:: shell | ||
pip freeze | ||
If you see azure==0.11.0 (or any version below 1.0), uninstall it first: | ||
|
||
.. code:: shell | ||
pip uninstall azure | ||
Usage | ||
===== | ||
|
||
For code examples, see `DocumentDB Management | ||
<https://azure-sdk-for-python.readthedocs.org/en/latest/sample_azure-mgmt-documentdb.html>`__ | ||
on readthedocs.org. | ||
|
||
|
||
Provide Feedback | ||
================ | ||
|
||
If you encounter any bugs or have suggestions, please file an issue in the | ||
`Issues <https://github.com/Azure/azure-sdk-for-python/issues>`__ | ||
section of the project. | ||
|
||
|
||
.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-documentdb%2FREADME.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__path__ = __import__('pkgutil').extend_path(__path__, __name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__path__ = __import__('pkgutil').extend_path(__path__, __name__) |
18 changes: 18 additions & 0 deletions
18
sdk/cosmos/azure-mgmt-documentdb/azure/mgmt/documentdb/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# 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. | ||
# -------------------------------------------------------------------------- | ||
|
||
from .document_db import DocumentDB | ||
from .version import VERSION | ||
|
||
__all__ = ['DocumentDB'] | ||
|
||
__version__ = VERSION | ||
|
83 changes: 83 additions & 0 deletions
83
sdk/cosmos/azure-mgmt-documentdb/azure/mgmt/documentdb/document_db.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# 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. | ||
# -------------------------------------------------------------------------- | ||
|
||
from msrest.service_client import ServiceClient | ||
from msrest import Serializer, Deserializer | ||
from msrestazure import AzureConfiguration | ||
from .version import VERSION | ||
from .operations.database_accounts_operations import DatabaseAccountsOperations | ||
from . import models | ||
|
||
|
||
class DocumentDBConfiguration(AzureConfiguration): | ||
"""Configuration for DocumentDB | ||
Note that all parameters used to create this instance are saved as instance | ||
attributes. | ||
:param credentials: Credentials needed for the client to connect to Azure. | ||
:type credentials: :mod:`A msrestazure Credentials | ||
object<msrestazure.azure_active_directory>` | ||
:param subscription_id: Azure subscription ID. | ||
:type subscription_id: str | ||
:param str base_url: Service URL | ||
""" | ||
|
||
def __init__( | ||
self, credentials, subscription_id, base_url=None): | ||
|
||
if credentials is None: | ||
raise ValueError("Parameter 'credentials' must not be None.") | ||
if subscription_id is None: | ||
raise ValueError("Parameter 'subscription_id' must not be None.") | ||
if not isinstance(subscription_id, str): | ||
raise TypeError("Parameter 'subscription_id' must be str.") | ||
if not base_url: | ||
base_url = 'https://management.azure.com' | ||
|
||
super(DocumentDBConfiguration, self).__init__(base_url) | ||
|
||
self.add_user_agent('documentdb/{}'.format(VERSION)) | ||
self.add_user_agent('Azure-SDK-For-Python') | ||
|
||
self.credentials = credentials | ||
self.subscription_id = subscription_id | ||
|
||
|
||
class DocumentDB(object): | ||
"""Azure DocumentDB Database Service Resource Provider REST API | ||
:ivar config: Configuration for client. | ||
:vartype config: DocumentDBConfiguration | ||
:ivar database_accounts: DatabaseAccounts operations | ||
:vartype database_accounts: azure.mgmt.documentdb.operations.DatabaseAccountsOperations | ||
:param credentials: Credentials needed for the client to connect to Azure. | ||
:type credentials: :mod:`A msrestazure Credentials | ||
object<msrestazure.azure_active_directory>` | ||
:param subscription_id: Azure subscription ID. | ||
:type subscription_id: str | ||
:param str base_url: Service URL | ||
""" | ||
|
||
def __init__( | ||
self, credentials, subscription_id, base_url=None): | ||
|
||
self.config = DocumentDBConfiguration(credentials, subscription_id, base_url) | ||
self._client = ServiceClient(self.config.credentials, self.config) | ||
|
||
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} | ||
self.api_version = '2015-04-08' | ||
self._serialize = Serializer(client_models) | ||
self._deserialize = Deserializer(client_models) | ||
|
||
self.database_accounts = DatabaseAccountsOperations( | ||
self._client, self.config, self._serialize, self._deserialize) |
52 changes: 52 additions & 0 deletions
52
sdk/cosmos/azure-mgmt-documentdb/azure/mgmt/documentdb/models/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# 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. | ||
# -------------------------------------------------------------------------- | ||
|
||
from .consistency_policy import ConsistencyPolicy | ||
from .location import Location | ||
from .failover_policy import FailoverPolicy | ||
from .database_account import DatabaseAccount | ||
from .failover_policies import FailoverPolicies | ||
from .resource import Resource | ||
from .database_account_create_update_parameters import DatabaseAccountCreateUpdateParameters | ||
from .database_account_patch_parameters import DatabaseAccountPatchParameters | ||
from .database_account_list_read_only_keys_result import DatabaseAccountListReadOnlyKeysResult | ||
from .database_account_list_keys_result import DatabaseAccountListKeysResult | ||
from .database_account_connection_string import DatabaseAccountConnectionString | ||
from .database_account_list_connection_strings_result import DatabaseAccountListConnectionStringsResult | ||
from .database_account_regenerate_key_parameters import DatabaseAccountRegenerateKeyParameters | ||
from .database_account_paged import DatabaseAccountPaged | ||
from .document_db_enums import ( | ||
DatabaseAccountKind, | ||
DatabaseAccountOfferType, | ||
DefaultConsistencyLevel, | ||
KeyKind, | ||
) | ||
|
||
__all__ = [ | ||
'ConsistencyPolicy', | ||
'Location', | ||
'FailoverPolicy', | ||
'DatabaseAccount', | ||
'FailoverPolicies', | ||
'Resource', | ||
'DatabaseAccountCreateUpdateParameters', | ||
'DatabaseAccountPatchParameters', | ||
'DatabaseAccountListReadOnlyKeysResult', | ||
'DatabaseAccountListKeysResult', | ||
'DatabaseAccountConnectionString', | ||
'DatabaseAccountListConnectionStringsResult', | ||
'DatabaseAccountRegenerateKeyParameters', | ||
'DatabaseAccountPaged', | ||
'DatabaseAccountKind', | ||
'DatabaseAccountOfferType', | ||
'DefaultConsistencyLevel', | ||
'KeyKind', | ||
] |
50 changes: 50 additions & 0 deletions
50
sdk/cosmos/azure-mgmt-documentdb/azure/mgmt/documentdb/models/consistency_policy.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# 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. | ||
# -------------------------------------------------------------------------- | ||
|
||
from msrest.serialization import Model | ||
|
||
|
||
class ConsistencyPolicy(Model): | ||
"""The consistency policy for the DocumentDB database account. | ||
:param default_consistency_level: The default consistency level and | ||
configuration settings of the DocumentDB account. Possible values include: | ||
'Eventual', 'Session', 'BoundedStaleness', 'Strong', 'ConsistentPrefix' | ||
:type default_consistency_level: str or :class:`DefaultConsistencyLevel | ||
<azure.mgmt.documentdb.models.DefaultConsistencyLevel>` | ||
:param max_staleness_prefix: When used with the Bounded Staleness | ||
consistency level, this value represents the number of stale requests | ||
tolerated. Accepted range for this value is 1 – 2,147,483,647. Required | ||
when defaultConsistencyPolicy is set to 'BoundedStaleness'. | ||
:type max_staleness_prefix: long | ||
:param max_interval_in_seconds: When used with the Bounded Staleness | ||
consistency level, this value represents the time amount of staleness (in | ||
seconds) tolerated. Accepted range for this value is 1 - 100. Required | ||
when defaultConsistencyPolicy is set to 'BoundedStaleness'. | ||
:type max_interval_in_seconds: int | ||
""" | ||
|
||
_validation = { | ||
'default_consistency_level': {'required': True}, | ||
'max_staleness_prefix': {'maximum': 2147483647, 'minimum': 1}, | ||
'max_interval_in_seconds': {'maximum': 100, 'minimum': 1}, | ||
} | ||
|
||
_attribute_map = { | ||
'default_consistency_level': {'key': 'defaultConsistencyLevel', 'type': 'DefaultConsistencyLevel'}, | ||
'max_staleness_prefix': {'key': 'maxStalenessPrefix', 'type': 'long'}, | ||
'max_interval_in_seconds': {'key': 'maxIntervalInSeconds', 'type': 'int'}, | ||
} | ||
|
||
def __init__(self, default_consistency_level, max_staleness_prefix=None, max_interval_in_seconds=None): | ||
self.default_consistency_level = default_consistency_level | ||
self.max_staleness_prefix = max_staleness_prefix | ||
self.max_interval_in_seconds = max_interval_in_seconds |
Oops, something went wrong.