Skip to content

Commit c6580d9

Browse files
zhangyan133SDKAutoYan Zhang (WICRESOFT NORTH AMERICA LTD)
authored
T2 servicefabricmanagedclusters 2021 02 26 (#16958)
* CodeGen from PR 13170 in Azure/azure-rest-api-specs changetotrack2 (#13170) * changetotrack2 * new readme.python.md * some modification Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) <[email protected]> * test,version,CHANGELOG * modify changelog&version * modify changelog * delete repetitive usage Co-authored-by: SDKAuto <[email protected]> Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) <[email protected]>
1 parent 061b268 commit c6580d9

38 files changed

+15084
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Release History
2+
3+
## 1.0.0b1 (2021-02-26)
4+
5+
* Initial Release
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
recursive-include tests *.py *.yaml
2+
include *.md
3+
include azure/__init__.py
4+
include azure/mgmt/__init__.py
5+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Microsoft Azure SDK for Python
2+
3+
This is the Microsoft Azure Servicefabricmanagedclusters Management Client Library.
4+
This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8.
5+
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
6+
7+
8+
# Usage
9+
10+
11+
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
12+
13+
14+
15+
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
16+
Code samples for this package can be found at [Servicefabricmanagedclusters Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
17+
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
18+
19+
20+
# Provide Feedback
21+
22+
If you encounter any bugs or have suggestions, please file an issue in the
23+
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
24+
section of the project.
25+
26+
27+
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-servicefabricmanagedclusters%2FREADME.png)
28+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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_managed_clusters_management_client import ServiceFabricManagedClustersManagementClient
10+
from ._version import VERSION
11+
12+
__version__ = VERSION
13+
__all__ = ['ServiceFabricManagedClustersManagementClient']
14+
15+
try:
16+
from ._patch import patch_sdk # type: ignore
17+
patch_sdk()
18+
except ImportError:
19+
pass
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 ServiceFabricManagedClustersManagementClientConfiguration(Configuration):
25+
"""Configuration for ServiceFabricManagedClustersManagementClient.
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: The customer subscription identifier.
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(ServiceFabricManagedClustersManagementClientConfiguration, self).__init__(**kwargs)
48+
49+
self.credential = credential
50+
self.subscription_id = subscription_id
51+
self.api_version = "2021-01-01-preview"
52+
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
53+
kwargs.setdefault('sdk_moniker', 'mgmt-servicefabricmanagedclusters/{}'.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)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"chosen_version": "2021-01-01-preview",
3+
"total_api_version_list": ["2021-01-01-preview"],
4+
"client": {
5+
"name": "ServiceFabricManagedClustersManagementClient",
6+
"filename": "_service_fabric_managed_clusters_management_client",
7+
"description": "Service Fabric Managed Clusters Management Client.",
8+
"base_url": "\u0027https://management.azure.com\u0027",
9+
"custom_base_url": null,
10+
"azure_arm": true,
11+
"has_lro_operations": true,
12+
"client_side_validation": true
13+
},
14+
"global_parameters": {
15+
"sync": {
16+
"credential": {
17+
"signature": "credential, # type: \"TokenCredential\"",
18+
"description": "Credential needed for the client to connect to Azure.",
19+
"docstring_type": "~azure.core.credentials.TokenCredential",
20+
"required": true
21+
},
22+
"subscription_id": {
23+
"signature": "subscription_id, # type: str",
24+
"description": "The customer subscription identifier.",
25+
"docstring_type": "str",
26+
"required": true
27+
}
28+
},
29+
"async": {
30+
"credential": {
31+
"signature": "credential, # type: \"AsyncTokenCredential\"",
32+
"description": "Credential needed for the client to connect to Azure.",
33+
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
34+
"required": true
35+
},
36+
"subscription_id": {
37+
"signature": "subscription_id, # type: str",
38+
"description": "The customer subscription identifier.",
39+
"docstring_type": "str",
40+
"required": true
41+
}
42+
},
43+
"constant": {
44+
},
45+
"call": "credential, subscription_id"
46+
},
47+
"config": {
48+
"credential": true,
49+
"credential_scopes": ["https://management.azure.com/.default"],
50+
"credential_default_policy_type": "BearerTokenCredentialPolicy",
51+
"credential_default_policy_type_has_async_version": true,
52+
"credential_key_header_name": null
53+
},
54+
"operation_groups": {
55+
"application_types": "ApplicationTypesOperations",
56+
"application_type_versions": "ApplicationTypeVersionsOperations",
57+
"applications": "ApplicationsOperations",
58+
"services": "ServicesOperations",
59+
"managed_clusters": "ManagedClustersOperations",
60+
"operations": "Operations",
61+
"node_types": "NodeTypesOperations"
62+
},
63+
"operation_mixins": {
64+
},
65+
"sync_imports": "None",
66+
"async_imports": "None"
67+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
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 ServiceFabricManagedClustersManagementClientConfiguration
21+
from .operations import ApplicationTypesOperations
22+
from .operations import ApplicationTypeVersionsOperations
23+
from .operations import ApplicationsOperations
24+
from .operations import ServicesOperations
25+
from .operations import ManagedClustersOperations
26+
from .operations import Operations
27+
from .operations import NodeTypesOperations
28+
from . import models
29+
30+
31+
class ServiceFabricManagedClustersManagementClient(object):
32+
"""Service Fabric Managed Clusters Management Client.
33+
34+
:ivar application_types: ApplicationTypesOperations operations
35+
:vartype application_types: service_fabric_managed_clusters_management_client.operations.ApplicationTypesOperations
36+
:ivar application_type_versions: ApplicationTypeVersionsOperations operations
37+
:vartype application_type_versions: service_fabric_managed_clusters_management_client.operations.ApplicationTypeVersionsOperations
38+
:ivar applications: ApplicationsOperations operations
39+
:vartype applications: service_fabric_managed_clusters_management_client.operations.ApplicationsOperations
40+
:ivar services: ServicesOperations operations
41+
:vartype services: service_fabric_managed_clusters_management_client.operations.ServicesOperations
42+
:ivar managed_clusters: ManagedClustersOperations operations
43+
:vartype managed_clusters: service_fabric_managed_clusters_management_client.operations.ManagedClustersOperations
44+
:ivar operations: Operations operations
45+
:vartype operations: service_fabric_managed_clusters_management_client.operations.Operations
46+
:ivar node_types: NodeTypesOperations operations
47+
:vartype node_types: service_fabric_managed_clusters_management_client.operations.NodeTypesOperations
48+
:param credential: Credential needed for the client to connect to Azure.
49+
:type credential: ~azure.core.credentials.TokenCredential
50+
:param subscription_id: The customer subscription identifier.
51+
:type subscription_id: str
52+
:param str base_url: Service URL
53+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
54+
"""
55+
56+
def __init__(
57+
self,
58+
credential, # type: "TokenCredential"
59+
subscription_id, # type: str
60+
base_url=None, # type: Optional[str]
61+
**kwargs # type: Any
62+
):
63+
# type: (...) -> None
64+
if not base_url:
65+
base_url = 'https://management.azure.com'
66+
self._config = ServiceFabricManagedClustersManagementClientConfiguration(credential, subscription_id, **kwargs)
67+
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
68+
69+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
70+
self._serialize = Serializer(client_models)
71+
self._deserialize = Deserializer(client_models)
72+
73+
self.application_types = ApplicationTypesOperations(
74+
self._client, self._config, self._serialize, self._deserialize)
75+
self.application_type_versions = ApplicationTypeVersionsOperations(
76+
self._client, self._config, self._serialize, self._deserialize)
77+
self.applications = ApplicationsOperations(
78+
self._client, self._config, self._serialize, self._deserialize)
79+
self.services = ServicesOperations(
80+
self._client, self._config, self._serialize, self._deserialize)
81+
self.managed_clusters = ManagedClustersOperations(
82+
self._client, self._config, self._serialize, self._deserialize)
83+
self.operations = Operations(
84+
self._client, self._config, self._serialize, self._deserialize)
85+
self.node_types = NodeTypesOperations(
86+
self._client, self._config, self._serialize, self._deserialize)
87+
88+
def close(self):
89+
# type: () -> None
90+
self._client.close()
91+
92+
def __enter__(self):
93+
# type: () -> ServiceFabricManagedClustersManagementClient
94+
self._client.__enter__()
95+
return self
96+
97+
def __exit__(self, *exc_details):
98+
# type: (Any) -> None
99+
self._client.__exit__(*exc_details)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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+
VERSION = "1.0.0b1"
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_managed_clusters_management_client import ServiceFabricManagedClustersManagementClient
10+
__all__ = ['ServiceFabricManagedClustersManagementClient']
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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 Any, 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 azure.core.credentials_async import AsyncTokenCredential
20+
21+
22+
class ServiceFabricManagedClustersManagementClientConfiguration(Configuration):
23+
"""Configuration for ServiceFabricManagedClustersManagementClient.
24+
25+
Note that all parameters used to create this instance are saved as instance
26+
attributes.
27+
28+
:param credential: Credential needed for the client to connect to Azure.
29+
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
30+
:param subscription_id: The customer subscription identifier.
31+
:type subscription_id: str
32+
"""
33+
34+
def __init__(
35+
self,
36+
credential: "AsyncTokenCredential",
37+
subscription_id: str,
38+
**kwargs: Any
39+
) -> None:
40+
if credential is None:
41+
raise ValueError("Parameter 'credential' must not be None.")
42+
if subscription_id is None:
43+
raise ValueError("Parameter 'subscription_id' must not be None.")
44+
super(ServiceFabricManagedClustersManagementClientConfiguration, self).__init__(**kwargs)
45+
46+
self.credential = credential
47+
self.subscription_id = subscription_id
48+
self.api_version = "2021-01-01-preview"
49+
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
50+
kwargs.setdefault('sdk_moniker', 'mgmt-servicefabricmanagedclusters/{}'.format(VERSION))
51+
self._configure(**kwargs)
52+
53+
def _configure(
54+
self,
55+
**kwargs: Any
56+
) -> None:
57+
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
58+
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
59+
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
60+
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
61+
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
62+
self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
63+
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
64+
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
65+
self.authentication_policy = kwargs.get('authentication_policy')
66+
if self.credential and not self.authentication_policy:
67+
self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)

0 commit comments

Comments
 (0)