Skip to content

Commit

Permalink
CodeGen from PR 14302 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Dev kubernetesconfiguration microsoft.kubernetes configuration 2021 05 01 preview (Azure#14302)

* Adds base for updating Microsoft.KubernetesConfiguration from version preview/2020-07-01-preview to version 2021-05-01-preview

* Updates readme

* Updates API version in new specs and examples

* Add Extensions Async API and other fixes (Azure#13709)

* Add Extensions Async API and other fixes

* Re-add missed out changes

* Fix validation errors, remove UpdateExtension.json

* Update Readme.md

* Add back files removed accidentally

* Revert accidental changes & fix readme.md

* Remove SourceControlConfig from this api version

* Fix Readme.md error for go package

* Fix Go readme issues

* Fix Go readme issues - revert accidental change

* Fix Go readme issues

* Add kubernetesconfiguration GA version to this version Tag for SDK

* Fix Operations api descriptions

* Fix spelling mistakes

* Update ApiVersionParameter reference in kubernetesconfiguration

* Fix review suggestions

* Add SourceControlConfiguration resourceType to this api-version

* Updated readme files for the added SourceControlConfiguration resource type

* Fix readme files to revert to previous + additions for new api-version

* Consolidated common definitions to avoid duplication errors

* Rename definitions folder - fix Avocado error

* Consolidated common definitions reference

* Fix definitions.json

* Fix go readme

* Revert "Add Extensions Async API and other fixes (Azure#13709)" (Azure#13972)

This reverts commit b78af6ebfe1391f2c73bc39da3c20c159806b1a0.

* Dev kubernetesconfiguration microsoft.kubernetes configuration 2021 05 01 preview (Azure#13992)

* Add Extensions Async API and other fixes

* Re-add missed out changes

* Fix validation errors, remove UpdateExtension.json

* Update Readme.md

* Add back files removed accidentally

* Revert accidental changes & fix readme.md

* Remove SourceControlConfig from this api version

* Fix Readme.md error for go package

* Fix Go readme issues

* Fix Go readme issues - revert accidental change

* Fix Go readme issues

* Add kubernetesconfiguration GA version to this version Tag for SDK

* Fix Operations api descriptions

* Fix spelling mistakes

* Update ApiVersionParameter reference in kubernetesconfiguration

* Fix review suggestions

* Add SourceControlConfiguration resourceType to this api-version

* Updated readme files for the added SourceControlConfiguration resource type

* Fix readme files to revert to previous + additions for new api-version

* Consolidated common definitions to avoid duplication errors

* Rename definitions folder - fix Avocado error

* Consolidated common definitions reference

* Fix definitions.json

* Fix go readme

* Remove extensions resource in the route of ListAsyncOperations at Cluster scope

* Remove extension parameter in the spec

* Remove extension parameter from route of ListAsycOperations

* Add Origin property to Available Operations response body

* Make Identity property nullable

* Add Get, List Extension Types (Azure#13562)

* Add Get, List Extension Types

* style check fixes

* - update spec
- rename and update example files
- fix validation errors

* fix examples

* - update readme.md
- generate example files with oav
- try to fix some new validation errors

* more validation fixes

* add ExtensionTypeVersion_List

* - update readme for SDKs
- update examples

* fix typo and linting

* rename ExtensionTypeVersions_List

* - address comments
- update list extension versions based on location

* fix list versions route

* fix tag and unused parameters in spec file

* fix autorest validatoin errors

* udpate readme

* update readme

* try to fix sdk validation warnings

* - prettier fix
- revert changes to types.json

* fix pageable missing itemName

Co-authored-by: Carlo Cardella <carloc@microsoft.com>
Co-authored-by: chunyu3 <chunyu@microsoft.com>
  • Loading branch information
3 people committed May 19, 2021
1 parent fc6a51d commit f4a88ae
Show file tree
Hide file tree
Showing 30 changed files with 4,112 additions and 295 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.4.2",
"use": "@autorest/python@5.6.6",
"commit": "4c386840e640f23e0a37a0c5d846b279bddbeb87",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/kubernetesconfiguration/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.6 --version=3.4.2",
"readme": "specification/kubernetesconfiguration/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SourceControlConfigurationClientConfiguration(Configuration):
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
"""

Expand All @@ -48,7 +48,7 @@ def __init__(

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2020-10-01-preview"
self.api_version = "2021-05-01-preview"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-kubernetesconfiguration/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"chosen_version": "2021-05-01-preview",
"total_api_version_list": ["2021-05-01-preview"],
"client": {
"name": "SourceControlConfigurationClient",
"filename": "_source_control_configuration_client",
"description": "KubernetesConfiguration Client.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": 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\": [\"SourceControlConfigurationClientConfiguration\"]}}, \"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\": [\"SourceControlConfigurationClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
},
"global_parameters": {
"sync": {
"credential": {
"signature": "credential, # type: \"TokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "The ID of the target subscription.",
"docstring_type": "str",
"required": true
}
},
"async": {
"credential": {
"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: str,",
"description": "The ID of the target subscription.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"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,
"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": {
"extensions": "ExtensionsOperations",
"operation_status": "OperationStatusOperations",
"cluster_extension_type": "ClusterExtensionTypeOperations",
"cluster_extension_types": "ClusterExtensionTypesOperations",
"extension_type_versions": "ExtensionTypeVersionsOperations",
"location_extension_types": "LocationExtensionTypesOperations",
"source_control_configurations": "SourceControlConfigurationsOperations",
"operations": "Operations"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,42 @@
from typing import Any, Optional

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

from ._configuration import SourceControlConfigurationClientConfiguration
from .operations import ExtensionsOperations
from .operations import OperationStatusOperations
from .operations import ClusterExtensionTypeOperations
from .operations import ClusterExtensionTypesOperations
from .operations import ExtensionTypeVersionsOperations
from .operations import LocationExtensionTypesOperations
from .operations import SourceControlConfigurationsOperations
from .operations import Operations
from . import models


class SourceControlConfigurationClient(object):
"""Use these APIs to create Source Control Configuration resources through ARM, for Kubernetes Clusters.
"""KubernetesConfiguration Client.
:ivar extensions: ExtensionsOperations operations
:vartype extensions: azure.mgmt.kubernetesconfiguration.operations.ExtensionsOperations
:ivar operation_status: OperationStatusOperations operations
:vartype operation_status: azure.mgmt.kubernetesconfiguration.operations.OperationStatusOperations
:ivar cluster_extension_type: ClusterExtensionTypeOperations operations
:vartype cluster_extension_type: azure.mgmt.kubernetesconfiguration.operations.ClusterExtensionTypeOperations
:ivar cluster_extension_types: ClusterExtensionTypesOperations operations
:vartype cluster_extension_types: azure.mgmt.kubernetesconfiguration.operations.ClusterExtensionTypesOperations
:ivar extension_type_versions: ExtensionTypeVersionsOperations operations
:vartype extension_type_versions: azure.mgmt.kubernetesconfiguration.operations.ExtensionTypeVersionsOperations
:ivar location_extension_types: LocationExtensionTypesOperations operations
:vartype location_extension_types: azure.mgmt.kubernetesconfiguration.operations.LocationExtensionTypesOperations
:ivar source_control_configurations: SourceControlConfigurationsOperations operations
:vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.operations.SourceControlConfigurationsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.kubernetesconfiguration.operations.Operations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str base_url: Service URL
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
Expand All @@ -56,11 +75,41 @@ def __init__(
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.extensions = ExtensionsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.operation_status = OperationStatusOperations(
self._client, self._config, self._serialize, self._deserialize)
self.cluster_extension_type = ClusterExtensionTypeOperations(
self._client, self._config, self._serialize, self._deserialize)
self.cluster_extension_types = ClusterExtensionTypesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.extension_type_versions = ExtensionTypeVersionsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.location_extension_types = LocationExtensionTypesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.source_control_configurations = SourceControlConfigurationsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(
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', min_length=1),
}
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 = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class SourceControlConfigurationClientConfiguration(Configuration):
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
"""

Expand All @@ -45,7 +45,7 @@ def __init__(

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2020-10-01-preview"
self.api_version = "2021-05-01-preview"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-kubernetesconfiguration/{}'.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 @@ -16,21 +17,39 @@
from azure.core.credentials_async import AsyncTokenCredential

from ._configuration import SourceControlConfigurationClientConfiguration
from .operations import ExtensionsOperations
from .operations import OperationStatusOperations
from .operations import ClusterExtensionTypeOperations
from .operations import ClusterExtensionTypesOperations
from .operations import ExtensionTypeVersionsOperations
from .operations import LocationExtensionTypesOperations
from .operations import SourceControlConfigurationsOperations
from .operations import Operations
from .. import models


class SourceControlConfigurationClient(object):
"""Use these APIs to create Source Control Configuration resources through ARM, for Kubernetes Clusters.
"""KubernetesConfiguration Client.
:ivar extensions: ExtensionsOperations operations
:vartype extensions: azure.mgmt.kubernetesconfiguration.aio.operations.ExtensionsOperations
:ivar operation_status: OperationStatusOperations operations
:vartype operation_status: azure.mgmt.kubernetesconfiguration.aio.operations.OperationStatusOperations
:ivar cluster_extension_type: ClusterExtensionTypeOperations operations
:vartype cluster_extension_type: azure.mgmt.kubernetesconfiguration.aio.operations.ClusterExtensionTypeOperations
:ivar cluster_extension_types: ClusterExtensionTypesOperations operations
:vartype cluster_extension_types: azure.mgmt.kubernetesconfiguration.aio.operations.ClusterExtensionTypesOperations
:ivar extension_type_versions: ExtensionTypeVersionsOperations operations
:vartype extension_type_versions: azure.mgmt.kubernetesconfiguration.aio.operations.ExtensionTypeVersionsOperations
:ivar location_extension_types: LocationExtensionTypesOperations operations
:vartype location_extension_types: azure.mgmt.kubernetesconfiguration.aio.operations.LocationExtensionTypesOperations
:ivar source_control_configurations: SourceControlConfigurationsOperations operations
:vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.aio.operations.SourceControlConfigurationsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.kubernetesconfiguration.aio.operations.Operations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str base_url: Service URL
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
Expand All @@ -53,11 +72,40 @@ def __init__(
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.extensions = ExtensionsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.operation_status = OperationStatusOperations(
self._client, self._config, self._serialize, self._deserialize)
self.cluster_extension_type = ClusterExtensionTypeOperations(
self._client, self._config, self._serialize, self._deserialize)
self.cluster_extension_types = ClusterExtensionTypesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.extension_type_versions = ExtensionTypeVersionsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.location_extension_types = LocationExtensionTypesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.source_control_configurations = SourceControlConfigurationsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(
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', min_length=1),
}
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
Loading

0 comments on commit f4a88ae

Please sign in to comment.