Skip to content

Commit

Permalink
CodeGen from PR 17678 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
[Microsoft.KubernetesConfiguration] Release Stable Api-Version 2022-03-01 (Azure#17678)

* Adds base for updating Microsoft.KubernetesConfiguration from version preview/2022-01-01-preview to version 2022-03-01

* Updates readme

* Updates API version in new specs and examples

* Update fluxConfigurations and common file for dynamic rp provider

* Update readme for sdk generation

* Add kustomization name to object model

* Change property names for Flux and add statusUpdatedAt

* Add x-ms-identifiers
  • Loading branch information
SDKAuto committed Mar 8, 2022
1 parent fb70246 commit ef5f8c5
Show file tree
Hide file tree
Showing 216 changed files with 22,458 additions and 16,459 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"autorest": "3.4.5",
"autorest": "3.7.2",
"use": [
"@autorest/python@5.8.4",
"@autorest/[email protected].2"
"@autorest/python@5.12.0",
"@autorest/[email protected].3"
],
"commit": "a136560c0771653154bace4384bdf45e0edcbb14",
"commit": "989a7d0e47a71a77d9a8e56f2a3eee0d366b6909",
"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.8.4 --use=@autorest/[email protected].2 --version=3.4.5",
"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 --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/[email protected].3 --version=3.7.2",
"readme": "specification/kubernetesconfiguration/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy

from ._version import VERSION

Expand Down Expand Up @@ -68,4 +68,4 @@ def _configure(
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
if self.credential and not self.authentication_policy:
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from typing import Any, Optional

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

class _SDKClient(object):
def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -56,12 +55,15 @@ class SourceControlConfigurationClient(MultiApiClientMixin, _SDKClient):
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""

DEFAULT_API_VERSION = '2021-09-01'
DEFAULT_API_VERSION = '2022-03-01'
_PROFILE_TAG = "azure.mgmt.kubernetesconfiguration.SourceControlConfigurationClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
None: DEFAULT_API_VERSION,
'source_control_configurations': '2021-03-01',
'cluster_extension_type': '2022-01-01-preview',
'cluster_extension_types': '2022-01-01-preview',
'extension_type_versions': '2022-01-01-preview',
'location_extension_types': '2022-01-01-preview',
}},
_PROFILE_TAG + " latest"
)
Expand All @@ -71,12 +73,10 @@ def __init__(
credential, # type: "TokenCredential"
subscription_id, # type: str
api_version=None, # type: Optional[str]
base_url=None, # type: Optional[str]
base_url="https://management.azure.com", # type: str
profile=KnownProfiles.default, # type: KnownProfiles
**kwargs # type: Any
):
if not base_url:
base_url = 'https://management.azure.com'
self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
super(SourceControlConfigurationClient, self).__init__(
Expand All @@ -99,6 +99,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2021-09-01: :mod:`v2021_09_01.models<azure.mgmt.kubernetesconfiguration.v2021_09_01.models>`
* 2021-11-01-preview: :mod:`v2021_11_01_preview.models<azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models>`
* 2022-01-01-preview: :mod:`v2022_01_01_preview.models<azure.mgmt.kubernetesconfiguration.v2022_01_01_preview.models>`
* 2022-03-01: :mod:`v2022_03_01.models<azure.mgmt.kubernetesconfiguration.v2022_03_01.models>`
"""
if api_version == '2020-07-01-preview':
from .v2020_07_01_preview import models
Expand All @@ -121,6 +122,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2022-01-01-preview':
from .v2022_01_01_preview import models
return models
elif api_version == '2022-03-01':
from .v2022_03_01 import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
Expand Down Expand Up @@ -189,6 +193,7 @@ def extensions(self):
* 2021-09-01: :class:`ExtensionsOperations<azure.mgmt.kubernetesconfiguration.v2021_09_01.operations.ExtensionsOperations>`
* 2021-11-01-preview: :class:`ExtensionsOperations<azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.ExtensionsOperations>`
* 2022-01-01-preview: :class:`ExtensionsOperations<azure.mgmt.kubernetesconfiguration.v2022_01_01_preview.operations.ExtensionsOperations>`
* 2022-03-01: :class:`ExtensionsOperations<azure.mgmt.kubernetesconfiguration.v2022_03_01.operations.ExtensionsOperations>`
"""
api_version = self._get_api_version('extensions')
if api_version == '2020-07-01-preview':
Expand All @@ -201,6 +206,8 @@ def extensions(self):
from .v2021_11_01_preview.operations import ExtensionsOperations as OperationClass
elif api_version == '2022-01-01-preview':
from .v2022_01_01_preview.operations import ExtensionsOperations as OperationClass
elif api_version == '2022-03-01':
from .v2022_03_01.operations import ExtensionsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'extensions'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -211,12 +218,15 @@ def flux_config_operation_status(self):
* 2021-11-01-preview: :class:`FluxConfigOperationStatusOperations<azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.FluxConfigOperationStatusOperations>`
* 2022-01-01-preview: :class:`FluxConfigOperationStatusOperations<azure.mgmt.kubernetesconfiguration.v2022_01_01_preview.operations.FluxConfigOperationStatusOperations>`
* 2022-03-01: :class:`FluxConfigOperationStatusOperations<azure.mgmt.kubernetesconfiguration.v2022_03_01.operations.FluxConfigOperationStatusOperations>`
"""
api_version = self._get_api_version('flux_config_operation_status')
if api_version == '2021-11-01-preview':
from .v2021_11_01_preview.operations import FluxConfigOperationStatusOperations as OperationClass
elif api_version == '2022-01-01-preview':
from .v2022_01_01_preview.operations import FluxConfigOperationStatusOperations as OperationClass
elif api_version == '2022-03-01':
from .v2022_03_01.operations import FluxConfigOperationStatusOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'flux_config_operation_status'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -227,12 +237,15 @@ def flux_configurations(self):
* 2021-11-01-preview: :class:`FluxConfigurationsOperations<azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.FluxConfigurationsOperations>`
* 2022-01-01-preview: :class:`FluxConfigurationsOperations<azure.mgmt.kubernetesconfiguration.v2022_01_01_preview.operations.FluxConfigurationsOperations>`
* 2022-03-01: :class:`FluxConfigurationsOperations<azure.mgmt.kubernetesconfiguration.v2022_03_01.operations.FluxConfigurationsOperations>`
"""
api_version = self._get_api_version('flux_configurations')
if api_version == '2021-11-01-preview':
from .v2021_11_01_preview.operations import FluxConfigurationsOperations as OperationClass
elif api_version == '2022-01-01-preview':
from .v2022_01_01_preview.operations import FluxConfigurationsOperations as OperationClass
elif api_version == '2022-03-01':
from .v2022_03_01.operations import FluxConfigurationsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'flux_configurations'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand Down Expand Up @@ -264,6 +277,7 @@ def operation_status(self):
* 2021-09-01: :class:`OperationStatusOperations<azure.mgmt.kubernetesconfiguration.v2021_09_01.operations.OperationStatusOperations>`
* 2021-11-01-preview: :class:`OperationStatusOperations<azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.OperationStatusOperations>`
* 2022-01-01-preview: :class:`OperationStatusOperations<azure.mgmt.kubernetesconfiguration.v2022_01_01_preview.operations.OperationStatusOperations>`
* 2022-03-01: :class:`OperationStatusOperations<azure.mgmt.kubernetesconfiguration.v2022_03_01.operations.OperationStatusOperations>`
"""
api_version = self._get_api_version('operation_status')
if api_version == '2021-05-01-preview':
Expand All @@ -274,6 +288,8 @@ def operation_status(self):
from .v2021_11_01_preview.operations import OperationStatusOperations as OperationClass
elif api_version == '2022-01-01-preview':
from .v2022_01_01_preview.operations import OperationStatusOperations as OperationClass
elif api_version == '2022-03-01':
from .v2022_03_01.operations import OperationStatusOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'operation_status'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -289,6 +305,7 @@ def operations(self):
* 2021-09-01: :class:`Operations<azure.mgmt.kubernetesconfiguration.v2021_09_01.operations.Operations>`
* 2021-11-01-preview: :class:`Operations<azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.Operations>`
* 2022-01-01-preview: :class:`Operations<azure.mgmt.kubernetesconfiguration.v2022_01_01_preview.operations.Operations>`
* 2022-03-01: :class:`Operations<azure.mgmt.kubernetesconfiguration.v2022_03_01.operations.Operations>`
"""
api_version = self._get_api_version('operations')
if api_version == '2020-07-01-preview':
Expand All @@ -305,6 +322,8 @@ def operations(self):
from .v2021_11_01_preview.operations import Operations as OperationClass
elif api_version == '2022-01-01-preview':
from .v2022_01_01_preview.operations import Operations as OperationClass
elif api_version == '2022-03-01':
from .v2022_03_01.operations import Operations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -319,6 +338,7 @@ def source_control_configurations(self):
* 2021-05-01-preview: :class:`SourceControlConfigurationsOperations<azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.operations.SourceControlConfigurationsOperations>`
* 2021-11-01-preview: :class:`SourceControlConfigurationsOperations<azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.SourceControlConfigurationsOperations>`
* 2022-01-01-preview: :class:`SourceControlConfigurationsOperations<azure.mgmt.kubernetesconfiguration.v2022_01_01_preview.operations.SourceControlConfigurationsOperations>`
* 2022-03-01: :class:`SourceControlConfigurationsOperations<azure.mgmt.kubernetesconfiguration.v2022_03_01.operations.SourceControlConfigurationsOperations>`
"""
api_version = self._get_api_version('source_control_configurations')
if api_version == '2020-07-01-preview':
Expand All @@ -333,6 +353,8 @@ def source_control_configurations(self):
from .v2021_11_01_preview.operations import SourceControlConfigurationsOperations as OperationClass
elif api_version == '2022-01-01-preview':
from .v2022_01_01_preview.operations import SourceControlConfigurationsOperations as OperationClass
elif api_version == '2022-03-01':
from .v2022_03_01.operations import SourceControlConfigurationsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'source_control_configurations'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy

from .._version import VERSION

Expand Down Expand Up @@ -64,4 +64,4 @@ def _configure(
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
if self.credential and not self.authentication_policy:
self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
Loading

0 comments on commit ef5f8c5

Please sign in to comment.