Skip to content

Commit 1e34379

Browse files
authored
test,version,CHANGELOG (#14838)
1 parent bd4d9bd commit 1e34379

File tree

141 files changed

+15718
-7389
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+15718
-7389
lines changed

sdk/consumption/azure-mgmt-consumption/CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,36 @@
11
# Release History
22

3+
## 8.0.0b1 (2020-10-31)
4+
5+
This is beta preview version.
6+
For detailed changelog please refer to equivalent stable version 3.0.0(https://pypi.org/project/azure-mgmt-consumption/3.0.0/)
7+
8+
This version uses a next-generation code generator that introduces important breaking changes, but also important new features (like unified authentication and async programming).
9+
10+
**General breaking changes**
11+
12+
- Credential system has been completly revamped:
13+
14+
- `azure.common.credentials` or `msrestazure.azure_active_directory` instances are no longer supported, use the `azure-identity` classes instead: https://pypi.org/project/azure-identity/
15+
- `credentials` parameter has been renamed `credential`
16+
17+
- The `config` attribute no longer exists on a client, configuration should be passed as kwarg. Example: `MyClient(credential, subscription_id, enable_logging=True)`. For a complete set of
18+
supported options, see the [parameters accept in init documentation of azure-core](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#available-policies)
19+
- You can't import a `version` module anymore, use `__version__` instead
20+
- Operations that used to return a `msrest.polling.LROPoller` now returns a `azure.core.polling.LROPoller` and are prefixed with `begin_`.
21+
- Exceptions tree have been simplified and most exceptions are now `azure.core.exceptions.HttpResponseError` (`CloudError` has been removed).
22+
- Most of the operation kwarg have changed. Some of the most noticeable:
23+
24+
- `raw` has been removed. Equivalent feature can be found using `cls`, a callback that will give access to internal HTTP response for advanced user
25+
- For a complete set of supported options, see the [parameters accept in Request documentation of azure-core](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#available-policies)
26+
27+
**General new features**
28+
29+
- Type annotations support using `typing`. SDKs are mypy ready.
30+
- This client has now stable and official support for async. Check the `aio` namespace of your package to find the async client.
31+
- This client now support natively tracing library like OpenCensus or OpenTelemetry. See this [tracing quickstart](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/core/azure-core-tracing-opentelemetry) for an overview.
32+
33+
334
## 3.0.0 (2018-05-16)
435

536
**Features**

sdk/consumption/azure-mgmt-consumption/README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@ library.
1414
For a more complete set of Azure libraries, see the
1515
[azure sdk python release](https://aka.ms/azsdk/python/all).
1616

17-
## Usage
17+
# Usage
18+
19+
20+
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
21+
22+
23+
24+
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
25+
Code samples for this package can be found at [Consumption Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
26+
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
1827

19-
For code examples, see
20-
[Consumption](https://docs.microsoft.com/python/api/overview/azure/consumption)
21-
on docs.microsoft.com.
2228

2329
## Provide Feedback
2430

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
# coding=utf-8
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
4-
# Licensed under the MIT License. See License.txt in the project root for
5-
# license information.
6-
#
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
75
# Code generated by Microsoft (R) AutoRest Code Generator.
8-
# Changes may cause incorrect behavior and will be lost if the code is
9-
# regenerated.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
107
# --------------------------------------------------------------------------
118

12-
from .consumption_management_client import ConsumptionManagementClient
13-
from .version import VERSION
14-
15-
__all__ = ['ConsumptionManagementClient']
9+
from ._consumption_management_client import ConsumptionManagementClient
10+
from ._version import VERSION
1611

1712
__version__ = VERSION
13+
__all__ = ['ConsumptionManagementClient']
1814

15+
try:
16+
from ._patch import patch_sdk # type: ignore
17+
patch_sdk()
18+
except ImportError:
19+
pass
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from typing import TYPE_CHECKING
10+
11+
from azure.core.configuration import Configuration
12+
from azure.core.pipeline import policies
13+
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
14+
15+
from ._version import VERSION
16+
17+
if TYPE_CHECKING:
18+
# pylint: disable=unused-import,ungrouped-imports
19+
from typing import Any
20+
21+
from azure.core.credentials import TokenCredential
22+
23+
24+
class ConsumptionManagementClientConfiguration(Configuration):
25+
"""Configuration for ConsumptionManagementClient.
26+
27+
Note that all parameters used to create this instance are saved as instance
28+
attributes.
29+
30+
:param credential: Credential needed for the client to connect to Azure.
31+
:type credential: ~azure.core.credentials.TokenCredential
32+
:param subscription_id: Azure Subscription ID.
33+
:type subscription_id: str
34+
"""
35+
36+
def __init__(
37+
self,
38+
credential, # type: "TokenCredential"
39+
subscription_id, # type: str
40+
**kwargs # type: Any
41+
):
42+
# type: (...) -> None
43+
if credential is None:
44+
raise ValueError("Parameter 'credential' must not be None.")
45+
if subscription_id is None:
46+
raise ValueError("Parameter 'subscription_id' must not be None.")
47+
super(ConsumptionManagementClientConfiguration, self).__init__(**kwargs)
48+
49+
self.credential = credential
50+
self.subscription_id = subscription_id
51+
self.api_version = "2019-10-01"
52+
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
53+
kwargs.setdefault('sdk_moniker', 'mgmt-consumption/{}'.format(VERSION))
54+
self._configure(**kwargs)
55+
56+
def _configure(
57+
self,
58+
**kwargs # type: Any
59+
):
60+
# type: (...) -> None
61+
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
62+
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
63+
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
64+
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
65+
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
66+
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
67+
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
68+
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
69+
self.authentication_policy = kwargs.get('authentication_policy')
70+
if self.credential and not self.authentication_policy:
71+
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from typing import TYPE_CHECKING
10+
11+
from azure.mgmt.core import ARMPipelineClient
12+
from msrest import Deserializer, Serializer
13+
14+
if TYPE_CHECKING:
15+
# pylint: disable=unused-import,ungrouped-imports
16+
from typing import Any, Optional
17+
18+
from azure.core.credentials import TokenCredential
19+
20+
from ._configuration import ConsumptionManagementClientConfiguration
21+
from .operations import UsageDetailsOperations
22+
from .operations import MarketplacesOperations
23+
from .operations import BudgetsOperations
24+
from .operations import TagsOperations
25+
from .operations import ChargesOperations
26+
from .operations import BalancesOperations
27+
from .operations import ReservationsSummariesOperations
28+
from .operations import ReservationsDetailsOperations
29+
from .operations import ReservationRecommendationsOperations
30+
from .operations import ReservationRecommendationDetailsOperations
31+
from .operations import ReservationTransactionsOperations
32+
from .operations import PriceSheetOperations
33+
from .operations import ForecastsOperations
34+
from .operations import Operations
35+
from .operations import AggregatedCostOperations
36+
from .operations import EventsOperations
37+
from .operations import LotsOperations
38+
from .operations import CreditsOperations
39+
from . import models
40+
41+
42+
class ConsumptionManagementClient(object):
43+
"""Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions.
44+
45+
:ivar usage_details: UsageDetailsOperations operations
46+
:vartype usage_details: azure.mgmt.consumption.operations.UsageDetailsOperations
47+
:ivar marketplaces: MarketplacesOperations operations
48+
:vartype marketplaces: azure.mgmt.consumption.operations.MarketplacesOperations
49+
:ivar budgets: BudgetsOperations operations
50+
:vartype budgets: azure.mgmt.consumption.operations.BudgetsOperations
51+
:ivar tags: TagsOperations operations
52+
:vartype tags: azure.mgmt.consumption.operations.TagsOperations
53+
:ivar charges: ChargesOperations operations
54+
:vartype charges: azure.mgmt.consumption.operations.ChargesOperations
55+
:ivar balances: BalancesOperations operations
56+
:vartype balances: azure.mgmt.consumption.operations.BalancesOperations
57+
:ivar reservations_summaries: ReservationsSummariesOperations operations
58+
:vartype reservations_summaries: azure.mgmt.consumption.operations.ReservationsSummariesOperations
59+
:ivar reservations_details: ReservationsDetailsOperations operations
60+
:vartype reservations_details: azure.mgmt.consumption.operations.ReservationsDetailsOperations
61+
:ivar reservation_recommendations: ReservationRecommendationsOperations operations
62+
:vartype reservation_recommendations: azure.mgmt.consumption.operations.ReservationRecommendationsOperations
63+
:ivar reservation_recommendation_details: ReservationRecommendationDetailsOperations operations
64+
:vartype reservation_recommendation_details: azure.mgmt.consumption.operations.ReservationRecommendationDetailsOperations
65+
:ivar reservation_transactions: ReservationTransactionsOperations operations
66+
:vartype reservation_transactions: azure.mgmt.consumption.operations.ReservationTransactionsOperations
67+
:ivar price_sheet: PriceSheetOperations operations
68+
:vartype price_sheet: azure.mgmt.consumption.operations.PriceSheetOperations
69+
:ivar forecasts: ForecastsOperations operations
70+
:vartype forecasts: azure.mgmt.consumption.operations.ForecastsOperations
71+
:ivar operations: Operations operations
72+
:vartype operations: azure.mgmt.consumption.operations.Operations
73+
:ivar aggregated_cost: AggregatedCostOperations operations
74+
:vartype aggregated_cost: azure.mgmt.consumption.operations.AggregatedCostOperations
75+
:ivar events: EventsOperations operations
76+
:vartype events: azure.mgmt.consumption.operations.EventsOperations
77+
:ivar lots: LotsOperations operations
78+
:vartype lots: azure.mgmt.consumption.operations.LotsOperations
79+
:ivar credits: CreditsOperations operations
80+
:vartype credits: azure.mgmt.consumption.operations.CreditsOperations
81+
:param credential: Credential needed for the client to connect to Azure.
82+
:type credential: ~azure.core.credentials.TokenCredential
83+
:param subscription_id: Azure Subscription ID.
84+
:type subscription_id: str
85+
:param str base_url: Service URL
86+
"""
87+
88+
def __init__(
89+
self,
90+
credential, # type: "TokenCredential"
91+
subscription_id, # type: str
92+
base_url=None, # type: Optional[str]
93+
**kwargs # type: Any
94+
):
95+
# type: (...) -> None
96+
if not base_url:
97+
base_url = 'https://management.azure.com'
98+
self._config = ConsumptionManagementClientConfiguration(credential, subscription_id, **kwargs)
99+
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
100+
101+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
102+
self._serialize = Serializer(client_models)
103+
self._serialize.client_side_validation = False
104+
self._deserialize = Deserializer(client_models)
105+
106+
self.usage_details = UsageDetailsOperations(
107+
self._client, self._config, self._serialize, self._deserialize)
108+
self.marketplaces = MarketplacesOperations(
109+
self._client, self._config, self._serialize, self._deserialize)
110+
self.budgets = BudgetsOperations(
111+
self._client, self._config, self._serialize, self._deserialize)
112+
self.tags = TagsOperations(
113+
self._client, self._config, self._serialize, self._deserialize)
114+
self.charges = ChargesOperations(
115+
self._client, self._config, self._serialize, self._deserialize)
116+
self.balances = BalancesOperations(
117+
self._client, self._config, self._serialize, self._deserialize)
118+
self.reservations_summaries = ReservationsSummariesOperations(
119+
self._client, self._config, self._serialize, self._deserialize)
120+
self.reservations_details = ReservationsDetailsOperations(
121+
self._client, self._config, self._serialize, self._deserialize)
122+
self.reservation_recommendations = ReservationRecommendationsOperations(
123+
self._client, self._config, self._serialize, self._deserialize)
124+
self.reservation_recommendation_details = ReservationRecommendationDetailsOperations(
125+
self._client, self._config, self._serialize, self._deserialize)
126+
self.reservation_transactions = ReservationTransactionsOperations(
127+
self._client, self._config, self._serialize, self._deserialize)
128+
self.price_sheet = PriceSheetOperations(
129+
self._client, self._config, self._serialize, self._deserialize)
130+
self.forecasts = ForecastsOperations(
131+
self._client, self._config, self._serialize, self._deserialize)
132+
self.operations = Operations(
133+
self._client, self._config, self._serialize, self._deserialize)
134+
self.aggregated_cost = AggregatedCostOperations(
135+
self._client, self._config, self._serialize, self._deserialize)
136+
self.events = EventsOperations(
137+
self._client, self._config, self._serialize, self._deserialize)
138+
self.lots = LotsOperations(
139+
self._client, self._config, self._serialize, self._deserialize)
140+
self.credits = CreditsOperations(
141+
self._client, self._config, self._serialize, self._deserialize)
142+
143+
def close(self):
144+
# type: () -> None
145+
self._client.close()
146+
147+
def __enter__(self):
148+
# type: () -> ConsumptionManagementClient
149+
self._client.__enter__()
150+
return self
151+
152+
def __exit__(self, *exc_details):
153+
# type: (Any) -> None
154+
self._client.__exit__(*exc_details)
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
# coding=utf-8
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
4-
# Licensed under the MIT License. See License.txt in the project root for
5-
# license information.
6-
#
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
75
# Code generated by Microsoft (R) AutoRest Code Generator.
8-
# Changes may cause incorrect behavior and will be lost if the code is
9-
# regenerated.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
107
# --------------------------------------------------------------------------
118

12-
VERSION = "3.0.0"
13-
9+
VERSION = "8.0.0b1"
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,10 @@
11
# coding=utf-8
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
4-
# Licensed under the MIT License. See License.txt in the project root for
5-
# license information.
6-
#
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
75
# Code generated by Microsoft (R) AutoRest Code Generator.
8-
# Changes may cause incorrect behavior and will be lost if the code is
9-
# regenerated.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
107
# --------------------------------------------------------------------------
118

12-
from msrest.serialization import Model
13-
14-
15-
class Tag(Model):
16-
"""The tag resource.
17-
18-
:param key: Tag key.
19-
:type key: str
20-
"""
21-
22-
_attribute_map = {
23-
'key': {'key': 'key', 'type': 'str'},
24-
}
25-
26-
def __init__(self, **kwargs):
27-
super(Tag, self).__init__(**kwargs)
28-
self.key = kwargs.get('key', None)
9+
from ._consumption_management_client import ConsumptionManagementClient
10+
__all__ = ['ConsumptionManagementClient']

0 commit comments

Comments
 (0)