Skip to content

Commit

Permalink
CodeGen from PR 13860 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
[Service Fabric Managed Clusters] adding api version 2020-05-01 (Azure#13860)

* initial commit 2021-05-01 to compare with previous version 2021-01-01-preview

* update models

* update examples

* fix isStateless description

* add 2021-05-01 version to readme

* add x-ms-enum to diskType and add missing managedClsuterVersions paths

fix example names

add managed cluster version paths

add default error

* fix clusterversion by version and ClusterState descriptions

Co-authored-by: Alfredo Santamaria Gomez <alsantam@microsoft.com>
  • Loading branch information
SDKAuto and Alfredo Santamaria Gomez committed Apr 14, 2021
1 parent e55a470 commit 5e949eb
Show file tree
Hide file tree
Showing 30 changed files with 1,259 additions and 340 deletions.
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"autorest": "3.3.0",
"use": "@autorest/python@5.6.5",
"commit": "0ad2a66240354dc6deb9102049e8e9b52fcf81c5",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/servicefabricmanagedclusters/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.5 --version=3.3.0",
"readme": "specification/servicefabricmanagedclusters/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-01-01-preview"
self.api_version = "2021-05-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-servicefabricmanagedclusters/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chosen_version": "2021-01-01-preview",
"total_api_version_list": ["2021-01-01-preview"],
"chosen_version": "2021-05-01",
"total_api_version_list": ["2021-05-01"],
"client": {
"name": "ServiceFabricManagedClustersManagementClient",
"filename": "_service_fabric_managed_clusters_management_client",
Expand All @@ -9,7 +9,9 @@
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": true
"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\": [\"ServiceFabricManagedClustersManagementClientConfiguration\"]}}, \"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\": [\"ServiceFabricManagedClustersManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
},
"global_parameters": {
"sync": {
Expand All @@ -28,40 +30,81 @@
},
"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 customer subscription identifier.",
"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": {
"application_types": "ApplicationTypesOperations",
"application_type_versions": "ApplicationTypeVersionsOperations",
"applications": "ApplicationsOperations",
"services": "ServicesOperations",
"managed_clusters": "ManagedClustersOperations",
"managed_cluster_version": "ManagedClusterVersionOperations",
"operations": "Operations",
"node_types": "NodeTypesOperations"
},
"operation_mixins": {
},
"sync_imports": "None",
"async_imports": "None"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
from typing import Any, Optional

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

from ._configuration import ServiceFabricManagedClustersManagementClientConfiguration
from .operations import ApplicationTypesOperations
from .operations import ApplicationTypeVersionsOperations
from .operations import ApplicationsOperations
from .operations import ServicesOperations
from .operations import ManagedClustersOperations
from .operations import ManagedClusterVersionOperations
from .operations import Operations
from .operations import NodeTypesOperations
from . import models
Expand All @@ -41,6 +43,8 @@ class ServiceFabricManagedClustersManagementClient(object):
:vartype services: service_fabric_managed_clusters_management_client.operations.ServicesOperations
:ivar managed_clusters: ManagedClustersOperations operations
:vartype managed_clusters: service_fabric_managed_clusters_management_client.operations.ManagedClustersOperations
:ivar managed_cluster_version: ManagedClusterVersionOperations operations
:vartype managed_cluster_version: service_fabric_managed_clusters_management_client.operations.ManagedClusterVersionOperations
:ivar operations: Operations operations
:vartype operations: service_fabric_managed_clusters_management_client.operations.Operations
:ivar node_types: NodeTypesOperations operations
Expand Down Expand Up @@ -68,6 +72,7 @@ def __init__(

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.application_types = ApplicationTypesOperations(
Expand All @@ -80,11 +85,31 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.managed_clusters = ManagedClustersOperations(
self._client, self._config, self._serialize, self._deserialize)
self.managed_cluster_version = ManagedClusterVersionOperations(
self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)
self.node_types = NodeTypesOperations(
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'),
}
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
self._client.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.0.0b1"
VERSION = "0.1.0"
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2021-01-01-preview"
self.api_version = "2021-05-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-servicefabricmanagedclusters/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from typing import Any, Optional, TYPE_CHECKING

from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from msrest import Deserializer, Serializer

Expand All @@ -21,6 +22,7 @@
from .operations import ApplicationsOperations
from .operations import ServicesOperations
from .operations import ManagedClustersOperations
from .operations import ManagedClusterVersionOperations
from .operations import Operations
from .operations import NodeTypesOperations
from .. import models
Expand All @@ -39,6 +41,8 @@ class ServiceFabricManagedClustersManagementClient(object):
:vartype services: service_fabric_managed_clusters_management_client.aio.operations.ServicesOperations
:ivar managed_clusters: ManagedClustersOperations operations
:vartype managed_clusters: service_fabric_managed_clusters_management_client.aio.operations.ManagedClustersOperations
:ivar managed_cluster_version: ManagedClusterVersionOperations operations
:vartype managed_cluster_version: service_fabric_managed_clusters_management_client.aio.operations.ManagedClusterVersionOperations
:ivar operations: Operations operations
:vartype operations: service_fabric_managed_clusters_management_client.aio.operations.Operations
:ivar node_types: NodeTypesOperations operations
Expand All @@ -65,6 +69,7 @@ def __init__(

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.application_types = ApplicationTypesOperations(
Expand All @@ -77,11 +82,30 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.managed_clusters = ManagedClustersOperations(
self._client, self._config, self._serialize, self._deserialize)
self.managed_cluster_version = ManagedClusterVersionOperations(
self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)
self.node_types = NodeTypesOperations(
self._client, self._config, self._serialize, self._deserialize)

async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
"""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.AsyncHttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

async def close(self) -> None:
await self._client.close()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from ._applications_operations import ApplicationsOperations
from ._services_operations import ServicesOperations
from ._managed_clusters_operations import ManagedClustersOperations
from ._managed_cluster_version_operations import ManagedClusterVersionOperations
from ._operations import Operations
from ._node_types_operations import NodeTypesOperations

Expand All @@ -20,6 +21,7 @@
'ApplicationsOperations',
'ServicesOperations',
'ManagedClustersOperations',
'ManagedClusterVersionOperations',
'Operations',
'NodeTypesOperations',
]
Loading

0 comments on commit 5e949eb

Please sign in to comment.