Skip to content

Commit fedc18d

Browse files
authored
generate servicefabric track2 version (#15601)
1 parent 983cf5b commit fedc18d

39 files changed

+14153
-4034
lines changed

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

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

3+
## 1.0.0b1 (2020-12-02)
4+
5+
This is beta preview version.
6+
7+
This version uses a next-generation code generator that introduces important breaking changes, but also important new features (like unified authentication and async programming).
8+
9+
**General breaking changes**
10+
11+
- Credential system has been completly revamped:
12+
13+
- `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/
14+
- `credentials` parameter has been renamed `credential`
15+
16+
- 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
17+
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)
18+
- You can't import a `version` module anymore, use `__version__` instead
19+
- Operations that used to return a `msrest.polling.LROPoller` now returns a `azure.core.polling.LROPoller` and are prefixed with `begin_`.
20+
- Exceptions tree have been simplified and most exceptions are now `azure.core.exceptions.HttpResponseError` (`CloudError` has been removed).
21+
- Most of the operation kwarg have changed. Some of the most noticeable:
22+
23+
- `raw` has been removed. Equivalent feature can be found using `cls`, a callback that will give access to internal HTTP response for advanced user
24+
- For a complete set of
25+
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+
## 0.5.0 (2020-07-28)
34+
35+
**Features**
36+
37+
- Model StatelessServiceProperties has a new parameter instance_close_delay_duration
38+
- Model StatelessServiceProperties has a new parameter service_dns_name
39+
- Model StatelessServiceUpdateProperties has a new parameter instance_close_delay_duration
40+
- Model ServiceResource has a new parameter service_dns_name
41+
- Model ServiceResourceProperties has a new parameter service_dns_name
42+
- Model Cluster has a new parameter application_type_versions_cleanup_policy
43+
- Model ApplicationResourceUpdate has a new parameter managed_identities
44+
- Model StatefulServiceProperties has a new parameter service_dns_name
45+
- Model ApplicationUpgradePolicy has a new parameter upgrade_mode
46+
- Model DiagnosticsStorageAccountConfig has a new parameter protected_account_key_name2
47+
- Model ApplicationResource has a new parameter identity
48+
- Model ApplicationResource has a new parameter managed_identities
49+
- Model ClusterUpdateParameters has a new parameter application_type_versions_cleanup_policy
50+
- Added operation group NodeTypesOperations
51+
- Added operation group ManagedClusterVersionsOperations
52+
- Added operation group ManagedClustersOperations
53+
354
## 0.4.0 (2019-08-19)
455

556
**Features**

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,15 @@ For a more complete set of Azure libraries, see the
1616

1717
## Usage
1818

19-
For code examples, see [Service Fabric
20-
Management](https://docs.microsoft.com/python/api/overview/azure/servicefabric)
21-
on docs.microsoft.com.
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 [Service Fabric 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)
27+
2228

2329
## Provide Feedback
2430

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
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 ._configuration import ServiceFabricManagementClientConfiguration
139
from ._service_fabric_management_client import ServiceFabricManagementClient
14-
__all__ = ['ServiceFabricManagementClient', 'ServiceFabricManagementClientConfiguration']
15-
16-
from .version import VERSION
17-
18-
__version__ = VERSION
10+
__all__ = ['ServiceFabricManagementClient']
1911

12+
try:
13+
from ._patch import patch_sdk # type: ignore
14+
patch_sdk()
15+
except ImportError:
16+
pass
Lines changed: 49 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,69 @@
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
# --------------------------------------------------------------------------
11-
from msrestazure import AzureConfiguration
128

13-
from .version import VERSION
9+
from typing import TYPE_CHECKING
1410

11+
from azure.core.configuration import Configuration
12+
from azure.core.pipeline import policies
13+
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
14+
15+
if TYPE_CHECKING:
16+
# pylint: disable=unused-import,ungrouped-imports
17+
from typing import Any
18+
19+
from azure.core.credentials import TokenCredential
20+
21+
VERSION = "unknown"
22+
23+
class ServiceFabricManagementClientConfiguration(Configuration):
24+
"""Configuration for ServiceFabricManagementClient.
1525
16-
class ServiceFabricManagementClientConfiguration(AzureConfiguration):
17-
"""Configuration for ServiceFabricManagementClient
1826
Note that all parameters used to create this instance are saved as instance
1927
attributes.
2028
21-
:param credentials: Credentials needed for the client to connect to Azure.
22-
:type credentials: :mod:`A msrestazure Credentials
23-
object<msrestazure.azure_active_directory>`
29+
:param credential: Credential needed for the client to connect to Azure.
30+
:type credential: ~azure.core.credentials.TokenCredential
2431
:param subscription_id: The customer subscription identifier.
2532
:type subscription_id: str
26-
:param str base_url: Service URL
2733
"""
2834

2935
def __init__(
30-
self, credentials, subscription_id, base_url=None):
31-
32-
if credentials is None:
33-
raise ValueError("Parameter 'credentials' must not be None.")
36+
self,
37+
credential, # type: "TokenCredential"
38+
subscription_id, # type: str
39+
**kwargs # type: Any
40+
):
41+
# type: (...) -> None
42+
if credential is None:
43+
raise ValueError("Parameter 'credential' must not be None.")
3444
if subscription_id is None:
3545
raise ValueError("Parameter 'subscription_id' must not be None.")
36-
if not base_url:
37-
base_url = 'https://management.azure.com'
46+
super(ServiceFabricManagementClientConfiguration, self).__init__(**kwargs)
3847

39-
super(ServiceFabricManagementClientConfiguration, self).__init__(base_url)
40-
41-
# Starting Autorest.Python 4.0.64, make connection pool activated by default
42-
self.keep_alive = True
43-
44-
self.add_user_agent('azure-mgmt-servicefabric/{}'.format(VERSION))
45-
self.add_user_agent('Azure-SDK-For-Python')
46-
47-
self.credentials = credentials
48+
self.credential = credential
4849
self.subscription_id = subscription_id
50+
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
51+
kwargs.setdefault('sdk_moniker', 'mgmt-servicefabric/{}'.format(VERSION))
52+
self._configure(**kwargs)
53+
54+
def _configure(
55+
self,
56+
**kwargs # type: Any
57+
):
58+
# type: (...) -> None
59+
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
60+
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
61+
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
62+
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
63+
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
64+
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
65+
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
66+
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
67+
self.authentication_policy = kwargs.get('authentication_policy')
68+
if self.credential and not self.authentication_policy:
69+
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
Lines changed: 70 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
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.service_client import SDKClient
13-
from msrest import Serializer, Deserializer
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
1419

1520
from ._configuration import ServiceFabricManagementClientConfiguration
1621
from .operations import ClustersOperations
@@ -20,60 +25,91 @@
2025
from .operations import ApplicationTypeVersionsOperations
2126
from .operations import ApplicationsOperations
2227
from .operations import ServicesOperations
28+
from .operations import ManagedClustersOperations
29+
from .operations import ManagedClusterVersionsOperations
30+
from .operations import NodeTypesOperations
2331
from . import models
2432

2533

26-
class ServiceFabricManagementClient(SDKClient):
27-
"""Service Fabric Management Client
34+
class ServiceFabricManagementClient(object):
35+
"""Service Fabric Management Client.
2836
29-
:ivar config: Configuration for client.
30-
:vartype config: ServiceFabricManagementClientConfiguration
31-
32-
:ivar clusters: Clusters operations
37+
:ivar clusters: ClustersOperations operations
3338
:vartype clusters: azure.mgmt.servicefabric.operations.ClustersOperations
34-
:ivar cluster_versions: ClusterVersions operations
39+
:ivar cluster_versions: ClusterVersionsOperations operations
3540
:vartype cluster_versions: azure.mgmt.servicefabric.operations.ClusterVersionsOperations
3641
:ivar operations: Operations operations
3742
:vartype operations: azure.mgmt.servicefabric.operations.Operations
38-
:ivar application_types: ApplicationTypes operations
43+
:ivar application_types: ApplicationTypesOperations operations
3944
:vartype application_types: azure.mgmt.servicefabric.operations.ApplicationTypesOperations
40-
:ivar application_type_versions: ApplicationTypeVersions operations
45+
:ivar application_type_versions: ApplicationTypeVersionsOperations operations
4146
:vartype application_type_versions: azure.mgmt.servicefabric.operations.ApplicationTypeVersionsOperations
42-
:ivar applications: Applications operations
47+
:ivar applications: ApplicationsOperations operations
4348
:vartype applications: azure.mgmt.servicefabric.operations.ApplicationsOperations
44-
:ivar services: Services operations
49+
:ivar services: ServicesOperations operations
4550
:vartype services: azure.mgmt.servicefabric.operations.ServicesOperations
46-
47-
:param credentials: Credentials needed for the client to connect to Azure.
48-
:type credentials: :mod:`A msrestazure Credentials
49-
object<msrestazure.azure_active_directory>`
51+
:ivar managed_clusters: ManagedClustersOperations operations
52+
:vartype managed_clusters: azure.mgmt.servicefabric.operations.ManagedClustersOperations
53+
:ivar managed_cluster_versions: ManagedClusterVersionsOperations operations
54+
:vartype managed_cluster_versions: azure.mgmt.servicefabric.operations.ManagedClusterVersionsOperations
55+
:ivar node_types: NodeTypesOperations operations
56+
:vartype node_types: azure.mgmt.servicefabric.operations.NodeTypesOperations
57+
:param credential: Credential needed for the client to connect to Azure.
58+
:type credential: ~azure.core.credentials.TokenCredential
5059
:param subscription_id: The customer subscription identifier.
5160
:type subscription_id: str
5261
:param str base_url: Service URL
62+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
5363
"""
5464

5565
def __init__(
56-
self, credentials, subscription_id, base_url=None):
57-
58-
self.config = ServiceFabricManagementClientConfiguration(credentials, subscription_id, base_url)
59-
super(ServiceFabricManagementClient, self).__init__(self.config.credentials, self.config)
66+
self,
67+
credential, # type: "TokenCredential"
68+
subscription_id, # type: str
69+
base_url=None, # type: Optional[str]
70+
**kwargs # type: Any
71+
):
72+
# type: (...) -> None
73+
if not base_url:
74+
base_url = 'https://management.azure.com'
75+
self._config = ServiceFabricManagementClientConfiguration(credential, subscription_id, **kwargs)
76+
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
6077

6178
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
62-
self.api_version = '2019-03-01'
6379
self._serialize = Serializer(client_models)
80+
self._serialize.client_side_validation = False
6481
self._deserialize = Deserializer(client_models)
6582

6683
self.clusters = ClustersOperations(
67-
self._client, self.config, self._serialize, self._deserialize)
84+
self._client, self._config, self._serialize, self._deserialize)
6885
self.cluster_versions = ClusterVersionsOperations(
69-
self._client, self.config, self._serialize, self._deserialize)
86+
self._client, self._config, self._serialize, self._deserialize)
7087
self.operations = Operations(
71-
self._client, self.config, self._serialize, self._deserialize)
88+
self._client, self._config, self._serialize, self._deserialize)
7289
self.application_types = ApplicationTypesOperations(
73-
self._client, self.config, self._serialize, self._deserialize)
90+
self._client, self._config, self._serialize, self._deserialize)
7491
self.application_type_versions = ApplicationTypeVersionsOperations(
75-
self._client, self.config, self._serialize, self._deserialize)
92+
self._client, self._config, self._serialize, self._deserialize)
7693
self.applications = ApplicationsOperations(
77-
self._client, self.config, self._serialize, self._deserialize)
94+
self._client, self._config, self._serialize, self._deserialize)
7895
self.services = ServicesOperations(
79-
self._client, self.config, self._serialize, self._deserialize)
96+
self._client, self._config, self._serialize, self._deserialize)
97+
self.managed_clusters = ManagedClustersOperations(
98+
self._client, self._config, self._serialize, self._deserialize)
99+
self.managed_cluster_versions = ManagedClusterVersionsOperations(
100+
self._client, self._config, self._serialize, self._deserialize)
101+
self.node_types = NodeTypesOperations(
102+
self._client, self._config, self._serialize, self._deserialize)
103+
104+
def close(self):
105+
# type: () -> None
106+
self._client.close()
107+
108+
def __enter__(self):
109+
# type: () -> ServiceFabricManagementClient
110+
self._client.__enter__()
111+
return self
112+
113+
def __exit__(self, *exc_details):
114+
# type: (Any) -> None
115+
self._client.__exit__(*exc_details)
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +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-
VERSION = "0.4.0"
9+
VERSION = "1.0.0b1"
1310

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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 ._service_fabric_management_client import ServiceFabricManagementClient
10+
__all__ = ['ServiceFabricManagementClient']

0 commit comments

Comments
 (0)