From 8d6e2066cfd4fdbb0052bb91e90f30fe81d06693 Mon Sep 17 00:00:00 2001 From: Deeksha Sharma Date: Tue, 9 Nov 2021 09:31:36 -0800 Subject: [PATCH 01/20] initial commit for changes to add extension types commands --- .../v2021_09_01/aio/operations/__init__.py | 8 +++ .../azext_k8s_extension/_client_factory.py | 16 ++++++ .../azext_k8s_extension/_format.py | 30 +++++++++++ .../azext_k8s_extension/_help.py | 39 +++++++++++++++ .../azext_k8s_extension/_params.py | 30 +++++++++++ .../azext_k8s_extension/commands.py | 36 +++++++++++-- .../azext_k8s_extension/custom.py | 49 +++++++++++++++++- .../_source_control_configuration_client.py | 50 ++++++++++++++++--- 8 files changed, 248 insertions(+), 10 deletions(-) diff --git a/src/k8s-configuration/azext_k8s_configuration/vendored_sdks/v2021_09_01/aio/operations/__init__.py b/src/k8s-configuration/azext_k8s_configuration/vendored_sdks/v2021_09_01/aio/operations/__init__.py index 632ac4c1eeb..dfb058199f3 100644 --- a/src/k8s-configuration/azext_k8s_configuration/vendored_sdks/v2021_09_01/aio/operations/__init__.py +++ b/src/k8s-configuration/azext_k8s_configuration/vendored_sdks/v2021_09_01/aio/operations/__init__.py @@ -9,9 +9,17 @@ from ._extensions_operations import ExtensionsOperations from ._operation_status_operations import OperationStatusOperations from ._operations import Operations +from ._cluster_extension_type_operations import ClusterExtensionTypeOperations +from ._cluster_extension_types_operations import ClusterExtensionTypesOperations +from ._extension_type_versions_operations import ExtensionTypeVersionsOperations +from ._location_extension_types_operations import LocationExtensionTypesOperations __all__ = [ 'ExtensionsOperations', 'OperationStatusOperations', 'Operations', + 'ClusterExtensionTypeOperations', + 'ClusterExtensionTypesOperations', + 'ExtensionTypeVersionsOperations', + 'LocationExtensionTypesOperations', ] diff --git a/src/k8s-extension/azext_k8s_extension/_client_factory.py b/src/k8s-extension/azext_k8s_extension/_client_factory.py index 17bb875a38c..c4d465256f0 100644 --- a/src/k8s-extension/azext_k8s_extension/_client_factory.py +++ b/src/k8s-extension/azext_k8s_extension/_client_factory.py @@ -16,6 +16,22 @@ def cf_k8s_extension_operation(cli_ctx, _): return cf_k8s_extension(cli_ctx).extensions +def cf_k8s_cluster_extension_types_operation(cli_ctx, _): + return cf_k8s_extension(cli_ctx).cluster_extension_types + + +def cf_k8s_cluster_extension_type_operation(cli_ctx, _): + return cf_k8s_extension(cli_ctx).cluster_extension_type + + +def cf_k8s_location_extension_types_operation(cli_ctx, _): + return cf_k8s_extension(cli_ctx).location_extension_types + + +def cf_k8s_extension_type_versions_operation(cli_ctx, _): + return cf_k8s_extension(cli_ctx).extension_type_version + + def cf_resource_groups(cli_ctx, subscription_id=None): return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES, subscription_id=subscription_id).resource_groups diff --git a/src/k8s-extension/azext_k8s_extension/_format.py b/src/k8s-extension/azext_k8s_extension/_format.py index 5920f5380a7..f1511635704 100644 --- a/src/k8s-extension/azext_k8s_extension/_format.py +++ b/src/k8s-extension/azext_k8s_extension/_format.py @@ -22,3 +22,33 @@ def __get_table_row(result): ('provisioningState', result.get('provisioningState', '')), ('lastModifiedAt', result.get('systemData', {}).get('lastModifiedAt', '')), ]) + + +def k8s_extension_types_list_table_format(results): + return [__get_extension_type_table_row(result) for result in results] + + +def k8s_extension_type_show_table_format(result): + return __get_extension_type_table_row(result) + + +def __get_extension_type_table_row(result): + return OrderedDict([ + ('name', result['name']), + ('default_scope', result.get('default_scope', '')), + ('release_trains', result.get('release_trains', '')), + ('cluster_types', result.get('cluster_types', '')), + ('allow_multiple_instances', result.get('allow_multiple_instances', '')), + ('default_release_namespace', result.get('default_release_namespace', '')) + ]) + + +def k8s_extension_type_versions_list_table_format(results): + return [__get_extension_type_versions_table_row(result) for result in results] + + +def __get_extension_type_versions_table_row(result): + return OrderedDict([ + ('release_train', result['release_train']), + ('versions', result['versions']) + ]) diff --git a/src/k8s-extension/azext_k8s_extension/_help.py b/src/k8s-extension/azext_k8s_extension/_help.py index 2f2ed72945b..ab08c9aa2a6 100644 --- a/src/k8s-extension/azext_k8s_extension/_help.py +++ b/src/k8s-extension/azext_k8s_extension/_help.py @@ -71,3 +71,42 @@ --configuration-settings-file=config-settings-file \ --configuration-protected-settings-file=protected-settings-file """ + +helps[f'{consts.EXTENSION_NAME} extension-types list'] = f""" + type: command + short-summary: List Kubernetes Extension Types. + examples: + - name: List Kubernetes Extension Types + text: |- + az {consts.EXTENSION_NAME} extension-types list --resource-group my-resource-group \ +--cluster-name mycluster --cluster-type connectedClusters +""" + +helps[f'{consts.EXTENSION_NAME} extension-types list-by-location'] = f""" + type: command + short-summary: List available Kubernetes Extension Types in a specified region. + examples: + - name: List Kubernetes Extension Types by location + text: |- + az {consts.EXTENSION_NAME} extension-types list-by-location --location eastus2euap +""" + +helps[f'{consts.EXTENSION_NAME} extension-types show'] = f""" + type: command + short-summary: Show properties for a Kubernetes Extension Type. + examples: + - name: Show Kubernetes Extension Type + text: |- + az {consts.EXTENSION_NAME} extension-types show --resource-group my-resource-group \ +--cluster-name mycluster --cluster-type connectedClusters --extension-type cassandradatacenteroperator +""" + +helps[f'{consts.EXTENSION_NAME} extension-types versions list'] = f""" + type: command + short-summary: List available versions for a Kubernetes Extension Type. + examples: + - name: List versions for an Extension Type + text: |- + az {consts.EXTENSION_NAME} extension-types versions list --location eastus2euap \ +--extension-type cassandradatacenteroperator +""" diff --git a/src/k8s-extension/azext_k8s_extension/_params.py b/src/k8s-extension/azext_k8s_extension/_params.py index 8a08c9cebcb..100059d3c25 100644 --- a/src/k8s-extension/azext_k8s_extension/_params.py +++ b/src/k8s-extension/azext_k8s_extension/_params.py @@ -84,3 +84,33 @@ def load_arguments(self, _): help='Ignore confirmation prompts') c.argument('force', help='Specify whether to force delete the extension from the cluster.') + + with self.argument_context(f"{consts.EXTENSION_NAME} extension-types list") as c: + c.argument('cluster_name', + options_list=['--cluster-name', '-c'], + help='Name of the Kubernetes cluster') + c.argument('cluster_type', + arg_type=get_enum_type(['connectedClusters', 'managedClusters', 'appliances']), + options_list=['--cluster-type', '-t'], + help='Specify Arc clusters or AKS managed clusters or Arc appliances.') + + with self.argument_context(f"{consts.EXTENSION_NAME} extension-types list-by-location") as c: + c.argument('location', + validator=get_default_location_from_resource_group) + + with self.argument_context(f"{consts.EXTENSION_NAME} extension-types show") as c: + c.argument('extension_type', + help='Name of the extension type.') + c.argument('cluster_name', + options_list=['--cluster-name', '-c'], + help='Name of the Kubernetes cluster') + c.argument('cluster_type', + arg_type=get_enum_type(['connectedClusters', 'managedClusters', 'appliances']), + options_list=['--cluster-type', '-t'], + help='Specify Arc clusters or AKS managed clusters or Arc appliances.') + + with self.argument_context(f"{consts.EXTENSION_NAME} extension-types versions list") as c: + c.argument('extension_type', + help='Name of the extension type.') + c.argument('location', + validator=get_default_location_from_resource_group) diff --git a/src/k8s-extension/azext_k8s_extension/commands.py b/src/k8s-extension/azext_k8s_extension/commands.py index 5c01b393e9d..37e85e6836c 100644 --- a/src/k8s-extension/azext_k8s_extension/commands.py +++ b/src/k8s-extension/azext_k8s_extension/commands.py @@ -4,9 +4,9 @@ # -------------------------------------------------------------------------------------------- # pylint: disable=line-too-long -from azure.cli.core.commands import CliCommandType -from ._client_factory import (cf_k8s_extension, cf_k8s_extension_operation) -from ._format import k8s_extension_list_table_format, k8s_extension_show_table_format +from azure.cli.core.commands import CliCommandType, client_factory +from ._client_factory import (cf_k8s_extension, cf_k8s_extension_operation, cf_k8s_cluster_extension_types_operation, cf_k8s_cluster_extension_type_operation, cf_k8s_location_extension_types_operation, cf_k8s_extension_type_versions_operation) +from ._format import k8s_extension_list_table_format, k8s_extension_show_table_format, k8s_extension_types_list_table_format, k8s_extension_type_versions_list_table_format, k8s_extension_type_show_table_format from . import consts @@ -23,3 +23,33 @@ def load_command_table(self, _): g.custom_command('list', 'list_k8s_extension', table_transformer=k8s_extension_list_table_format) g.custom_show_command('show', 'show_k8s_extension', table_transformer=k8s_extension_show_table_format) g.custom_command('update', 'update_k8s_extension', supports_no_wait=True) + + # Subgroup - k8s-extension extension-types + k8s_cluster_extension_type_sdk = CliCommandType( + operations_tmpl=consts.EXTENSION_PACKAGE_NAME + '.vendored_sdks.operations._cluster_extension_type_operations#ClusterExtensionTypeOperations.{}', + client_factory=cf_k8s_cluster_extension_type_operation) + with self.command_group(consts.EXTENSION_NAME + " extension-types", k8s_cluster_extension_type_sdk, client_factory=cf_k8s_cluster_extension_type_operation, is_experimental=True) \ + as g: + g.custom_show_command('show', 'show_k8s_cluster_extension_type', table_transformer=k8s_extension_type_show_table_format) + + k8s_cluster_extension_types_sdk = CliCommandType( + operations_tmpl=consts.EXTENSION_PACKAGE_NAME + '.vendored_sdks.operations._cluster_extension_types_operations#ClusterExtensionTypesOperations.{}', + client_factory=cf_k8s_cluster_extension_types_operation) + with self.command_group(consts.EXTENSION_NAME + " extension-types", k8s_cluster_extension_types_sdk, client_factory=cf_k8s_cluster_extension_types_operation, is_experimental=True) \ + as g: + g.custom_command('list', 'list_k8s_cluster_extension_types', table_transformer=k8s_extension_types_list_table_format) + + k8s_location_extension_types_sdk = CliCommandType( + operations_tmpl=consts.EXTENSION_PACKAGE_NAME + '.vendored_sdks.operations._location_extension_types_operations#LocationExtensionTypesOperations.{}', + client_factory=cf_k8s_location_extension_types_operation) + with self.command_group(consts.EXTENSION_NAME + " extension-types", k8s_location_extension_types_sdk, client_factory=cf_k8s_location_extension_types_operation, is_experimental=True) \ + as g: + g.custom_command('list-by-location', 'list_k8s_location_extension_types', table_transformer=k8s_extension_types_list_table_format) + + # Sub-group - k8s-extension extension-types versions + k8s_extension_type_versions_sdk = CliCommandType( + operations_tmpl=consts.EXTENSION_PACKAGE_NAME + '.vendored_sdks.operations._extension_type_versions_operations#ExtensionTypeVersionsOperations.{}', + client_factory=cf_k8s_extension_type_versions_operation) + with self.command_group(consts.EXTENSION_NAME + " extension-types", k8s_extension_type_versions_sdk, client_factory=cf_k8s_extension_type_versions_operation, is_experimental=True) \ + as g: + g.custom_command('list-versions', 'list_k8s_extension_type_versions', table_transformer=k8s_extension_type_versions_list_table_format) diff --git a/src/k8s-extension/azext_k8s_extension/custom.py b/src/k8s-extension/azext_k8s_extension/custom.py index 9519c4b3a79..f68eaa5687a 100644 --- a/src/k8s-extension/azext_k8s_extension/custom.py +++ b/src/k8s-extension/azext_k8s_extension/custom.py @@ -340,7 +340,7 @@ def delete_k8s_extension( ) return None extension_class = ExtensionFactory(extension.extension_type.lower()) - + # If there is any custom delete logic, this will call the logic extension_class.Delete( cmd, client, resource_group_name, cluster_name, name, cluster_type, yes @@ -358,6 +358,53 @@ def delete_k8s_extension( ) +def list_k8s_extension_type_versions(client, location, extension_type): + """ List available extension type versions + """ + return client.list(location, extension_type) + + +def list_k8s_cluster_extension_types(client, resource_group_name, cluster_name, cluster_type): + """ List available extension types + """ + cluster_rp = __get_cluster_rp(cluster_type) + return client.list(resource_group_name, cluster_rp, cluster_name) + + +def list_k8s_location_extension_types(client, location): + """ List available extension types based on location + """ + return client.list(location) + + +def show_k8s_cluster_extension_type(client, resource_group_name, cluster_type, cluster_name, extension_type): + """Get an existing Extension Type. + """ + # Determine ClusterRP + cluster_rp = __get_cluster_rp(cluster_type) + + try: + extension_type = client.get(resource_group_name, + cluster_rp, cluster_type, cluster_name, extension_type) + return extension_type + except HttpResponseError as ex: + # Customize the error message for resources not found + if ex.response.status_code == 404: + # If Cluster not found + if ex.message.__contains__("(ResourceNotFound)"): + message = "{0} Verify that the cluster-type is correct and the resource exists.".format( + ex.message) + # If Configuration not found + elif ex.message.__contains__("Operation returned an invalid status code 'Not Found'"): + message = "(ExtensionNotFound) The Resource {0}/{1}/{2}/Microsoft.KubernetesConfiguration/" \ + "extensions/{3} could not be found!".format( + cluster_rp, cluster_type, cluster_name, extension_type) + else: + message = ex.message + raise ResourceNotFoundError(message) from ex + raise ex + + def __create_identity(cmd, resource_group_name, cluster_name, cluster_type): subscription_id = get_subscription_id(cmd.cli_ctx) resources = cf_resources(cmd.cli_ctx, subscription_id) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/_source_control_configuration_client.py index a75870fe68b..2b4c12a5bd0 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/_source_control_configuration_client.py @@ -23,6 +23,17 @@ 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 Operations +from .operations import ClusterExtensionTypeOperations +from .operations import ClusterExtensionTypesOperations +from .operations import ExtensionTypeVersionsOperations +from .operations import LocationExtensionTypesOperations +from . import models class _SDKClient(object): def __init__(self, *args, **kwargs): @@ -77,6 +88,10 @@ def __init__( profile=KnownProfiles.default, # type: KnownProfiles **kwargs # type: Any ): + # type: (...) -> None + 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__( @@ -188,12 +203,35 @@ def extension_type_versions(self): def extensions(self): """Instance depends on the API version: - * 2020-07-01-preview: :class:`ExtensionsOperations` - * 2021-05-01-preview: :class:`ExtensionsOperations` - * 2021-09-01: :class:`ExtensionsOperations` - * 2021-11-01-preview: :class:`ExtensionsOperations` - * 2022-01-01-preview: :class:`ExtensionsOperations` - * 2022-03-01: :class:`ExtensionsOperations` + 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.extensions = ExtensionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operation_status = OperationStatusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + 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_version = ExtensionTypeVersionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.location_extension_types = LocationExtensionTypesOperations( + 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 """ api_version = self._get_api_version('extensions') if api_version == '2020-07-01-preview': From 1ee22f51f7c7a5eaf303e2506abd5e5fd69addc2 Mon Sep 17 00:00:00 2001 From: Deeksha Sharma Date: Tue, 9 Nov 2021 10:43:05 -0800 Subject: [PATCH 02/20] updating the history and readme files --- src/k8s-extension/HISTORY.rst | 4 +++ src/k8s-extension/README.rst | 33 +++++++++++++++++++ .../azext_k8s_extension/_params.py | 4 +-- 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/k8s-extension/HISTORY.rst b/src/k8s-extension/HISTORY.rst index b9a5a22c41d..7a7504950d8 100644 --- a/src/k8s-extension/HISTORY.rst +++ b/src/k8s-extension/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +1.2.4 +++++++++++++++++++ +* Support Extensions Types list, list by location, show, and list versions in preview + 1.2.3 ++++++++++++++++++ * Fix warning message returned on PATCH diff --git a/src/k8s-extension/README.rst b/src/k8s-extension/README.rst index 6f51a26fd9f..ddce911fd82 100644 --- a/src/k8s-extension/README.rst +++ b/src/k8s-extension/README.rst @@ -4,6 +4,9 @@ Microsoft Azure CLI 'k8s-extension' Extension This package is for the 'k8s-extension' extension. i.e. 'az k8s-extension' +This package includes the 'extension-types' subgroup. +i.e. 'az k8s-extension extension-types' + ### How to use ### Install this extension using the below CLI command ``` @@ -71,3 +74,33 @@ az k8s-extension update \ --configuration-settings-file configSettingsFile \ --configuration-protected-settings-file protectedSettingsFile ``` + +##### List available extension types of a cluster +``` +az k8s-extension extension-types list \ + --resource-group groupName \ + --cluster-name clusterName \ + --cluster-type clusterType +``` + +##### List available extension types by location +``` +az k8s-extension extension-types list-by-location \ + --location location +``` + +##### Show an extension types of a cluster +``` +az k8s-extension extension-types show \ + --resource-group groupName \ + --cluster-name clusterName \ + --cluster-type clusterType \ + --name extensionName +``` + +##### List all versions of an extension type by release train +``` +az k8s-extension extension-types list-versions \ + --location location \ + --name extensionName +``` diff --git a/src/k8s-extension/azext_k8s_extension/_params.py b/src/k8s-extension/azext_k8s_extension/_params.py index 100059d3c25..c8088a09c8f 100644 --- a/src/k8s-extension/azext_k8s_extension/_params.py +++ b/src/k8s-extension/azext_k8s_extension/_params.py @@ -99,7 +99,7 @@ def load_arguments(self, _): validator=get_default_location_from_resource_group) with self.argument_context(f"{consts.EXTENSION_NAME} extension-types show") as c: - c.argument('extension_type', + c.argument('name', help='Name of the extension type.') c.argument('cluster_name', options_list=['--cluster-name', '-c'], @@ -110,7 +110,7 @@ def load_arguments(self, _): help='Specify Arc clusters or AKS managed clusters or Arc appliances.') with self.argument_context(f"{consts.EXTENSION_NAME} extension-types versions list") as c: - c.argument('extension_type', + c.argument('name', help='Name of the extension type.') c.argument('location', validator=get_default_location_from_resource_group) From 3e4ec16ee05afede40183862889532dccaa223a8 Mon Sep 17 00:00:00 2001 From: Deeksha Sharma Date: Wed, 10 Nov 2021 16:46:49 -0800 Subject: [PATCH 03/20] updating to the latest vendored sdk --- .../v2021_09_01/aio/operations/__init__.py | 6 +- .../azext_k8s_extension/commands.py | 2 +- .../_source_control_configuration_client.py | 113 +- .../vendored_sdks/_version.py | 4 + .../_source_control_configuration_client.py | 78 + .../vendored_sdks/models.py | 5 + .../v2020_07_01_preview/__init__.py | 8 + .../v2020_07_01_preview/_configuration.py | 29 + .../_source_control_configuration_client.py | 79 + .../v2020_07_01_preview/aio/__init__.py | 3 + .../v2020_07_01_preview/aio/_configuration.py | 15 + .../_source_control_configuration_client.py | 72 + .../aio/operations/_extensions_operations.py | 242 +++ .../aio/operations/_operations.py | 54 + ...ource_control_configurations_operations.py | 238 +++ .../v2020_07_01_preview/models/__init__.py | 47 + .../v2020_07_01_preview/models/_models.py | 817 ++++++++ .../v2020_07_01_preview/models/_models_py3.py | 252 +++ ...urce_control_configuration_client_enums.py | 60 + .../operations/_extensions_operations.py | 300 +++ .../operations/_operations.py | 66 + ...ource_control_configurations_operations.py | 499 ++--- .../v2020_10_01_preview/__init__.py | 8 + .../v2020_10_01_preview/_configuration.py | 29 + .../_source_control_configuration_client.py | 74 + .../v2020_10_01_preview/aio/__init__.py | 3 + .../v2020_10_01_preview/aio/_configuration.py | 15 + .../_source_control_configuration_client.py | 67 + .../aio/operations/_operations.py | 54 + ...ource_control_configurations_operations.py | 238 +++ .../v2020_10_01_preview/models/__init__.py | 31 + .../v2020_10_01_preview/models/_models.py | 506 +++++ .../v2020_10_01_preview/models/_models_py3.py | 139 ++ ...urce_control_configuration_client_enums.py | 48 + .../operations/_operations.py | 66 + ...ource_control_configurations_operations.py | 296 +++ .../vendored_sdks/v2021_03_01/__init__.py | 8 + .../v2021_03_01/_configuration.py | 29 + .../_source_control_configuration_client.py | 73 + .../vendored_sdks/v2021_03_01/aio/__init__.py | 3 + .../v2021_03_01/aio/_configuration.py | 15 + .../_source_control_configuration_client.py | 66 + .../v2021_03_01/aio/operations/_operations.py | 54 + ...ource_control_configurations_operations.py | 231 +++ .../v2021_03_01/models/__init__.py | 31 + .../v2021_03_01/models/_models.py | 495 +++++ .../v2021_03_01/models/_models_py3.py | 142 ++ ...urce_control_configuration_client_enums.py | 52 + .../v2021_03_01/operations/_operations.py | 66 + ...ource_control_configurations_operations.py | 289 +++ .../v2021_05_01_preview/__init__.py | 8 + .../v2021_05_01_preview/_configuration.py | 29 + .../_source_control_configuration_client.py | 103 ++ .../v2021_05_01_preview/aio/__init__.py | 3 + .../v2021_05_01_preview/aio/_configuration.py | 15 + .../_source_control_configuration_client.py | 96 + .../_cluster_extension_type_operations.py | 47 +- .../_cluster_extension_types_operations.py | 64 +- .../_extension_type_versions_operations.py | 64 +- .../aio/operations/_extensions_operations.py | 269 +++ .../_location_extension_types_operations.py | 58 +- .../_operation_status_operations.py | 108 ++ .../aio/operations/_operations.py | 54 + ...ource_control_configurations_operations.py | 238 +++ .../v2021_05_01_preview/models/__init__.py | 61 + .../v2021_05_01_preview/models/_models.py | 1056 +++++++++++ .../v2021_05_01_preview/models/_models_py3.py | 304 +++ ...urce_control_configuration_client_enums.py | 68 + .../_cluster_extension_type_operations.py | 115 +- .../_cluster_extension_types_operations.py | 123 +- .../_extension_type_versions_operations.py | 119 +- .../operations/_extensions_operations.py | 341 ++++ .../_location_extension_types_operations.py | 109 +- .../_operation_status_operations.py | 135 ++ .../operations/_operations.py | 66 + ...ource_control_configurations_operations.py | 296 +++ .../vendored_sdks/v2021_09_01/__init__.py | 8 + .../v2021_09_01/_configuration.py | 29 + .../_source_control_configuration_client.py | 76 + .../vendored_sdks/v2021_09_01/aio/__init__.py | 3 + .../v2021_09_01/aio/_configuration.py | 15 + .../_source_control_configuration_client.py | 69 + .../aio/operations/_extensions_operations.py | 358 ++-- .../_operation_status_operations.py | 114 +- .../v2021_09_01/aio/operations/_operations.py | 54 + .../v2021_09_01/models/__init__.py | 63 +- .../v2021_09_01/models/_models.py | 739 ++++++++ .../v2021_09_01/models/_models_py3.py | 349 +--- ...urce_control_configuration_client_enums.py | 29 +- .../operations/_extensions_operations.py | 719 +++----- .../_operation_status_operations.py | 233 +-- .../v2021_09_01/operations/_operations.py | 91 +- .../v2021_11_01_preview/__init__.py | 8 + .../v2021_11_01_preview/_configuration.py | 29 + .../_source_control_configuration_client.py | 113 ++ .../v2021_11_01_preview/aio/__init__.py | 3 + .../v2021_11_01_preview/aio/_configuration.py | 15 + .../_source_control_configuration_client.py | 106 ++ .../_cluster_extension_type_operations.py | 53 + .../_cluster_extension_types_operations.py | 65 + .../_extension_type_versions_operations.py | 60 + .../aio/operations/_extensions_operations.py | 364 ++++ ...flux_config_operation_status_operations.py | 54 + .../_flux_configurations_operations.py | 374 ++++ .../_location_extension_types_operations.py | 58 + .../_operation_status_operations.py | 106 ++ .../aio/operations/_operations.py | 54 + ...ource_control_configurations_operations.py | 238 +++ .../v2021_11_01_preview/models/__init__.py | 87 + .../v2021_11_01_preview/models/_models.py | 1639 +++++++++++++++++ .../v2021_11_01_preview/models/_models_py3.py | 545 ++++++ ...urce_control_configuration_client_enums.py | 80 + .../_cluster_extension_type_operations.py | 70 + .../_cluster_extension_types_operations.py | 81 + .../_extension_type_versions_operations.py | 74 + .../operations/_extensions_operations.py | 458 +++++ ...flux_config_operation_status_operations.py | 72 + .../_flux_configurations_operations.py | 467 +++++ .../_location_extension_types_operations.py | 71 + .../_operation_status_operations.py | 133 ++ .../operations/_operations.py | 66 + ...ource_control_configurations_operations.py | 296 +++ 122 files changed, 16905 insertions(+), 1949 deletions(-) create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_models.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_models.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_models.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_models.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_models.py diff --git a/src/k8s-configuration/azext_k8s_configuration/vendored_sdks/v2021_09_01/aio/operations/__init__.py b/src/k8s-configuration/azext_k8s_configuration/vendored_sdks/v2021_09_01/aio/operations/__init__.py index dfb058199f3..5f4504b206d 100644 --- a/src/k8s-configuration/azext_k8s_configuration/vendored_sdks/v2021_09_01/aio/operations/__init__.py +++ b/src/k8s-configuration/azext_k8s_configuration/vendored_sdks/v2021_09_01/aio/operations/__init__.py @@ -8,18 +8,20 @@ from ._extensions_operations import ExtensionsOperations from ._operation_status_operations import OperationStatusOperations -from ._operations import Operations from ._cluster_extension_type_operations import ClusterExtensionTypeOperations from ._cluster_extension_types_operations import ClusterExtensionTypesOperations from ._extension_type_versions_operations import ExtensionTypeVersionsOperations from ._location_extension_types_operations import LocationExtensionTypesOperations +from ._source_control_configurations_operations import SourceControlConfigurationsOperations +from ._operations import Operations __all__ = [ 'ExtensionsOperations', 'OperationStatusOperations', - 'Operations', 'ClusterExtensionTypeOperations', 'ClusterExtensionTypesOperations', 'ExtensionTypeVersionsOperations', 'LocationExtensionTypesOperations', + 'SourceControlConfigurationsOperations', + 'Operations', ] diff --git a/src/k8s-extension/azext_k8s_extension/commands.py b/src/k8s-extension/azext_k8s_extension/commands.py index 37e85e6836c..b8cd84a0f68 100644 --- a/src/k8s-extension/azext_k8s_extension/commands.py +++ b/src/k8s-extension/azext_k8s_extension/commands.py @@ -28,7 +28,7 @@ def load_command_table(self, _): k8s_cluster_extension_type_sdk = CliCommandType( operations_tmpl=consts.EXTENSION_PACKAGE_NAME + '.vendored_sdks.operations._cluster_extension_type_operations#ClusterExtensionTypeOperations.{}', client_factory=cf_k8s_cluster_extension_type_operation) - with self.command_group(consts.EXTENSION_NAME + " extension-types", k8s_cluster_extension_type_sdk, client_factory=cf_k8s_cluster_extension_type_operation, is_experimental=True) \ + with self.command_group(consts.EXTENSION_NAME + " extension-types", k8s_cluster_extension_type_sdk, client_factory=cf_k8s_cluster_extension_type_operation) \ as g: g.custom_show_command('show', 'show_k8s_cluster_extension_type', table_transformer=k8s_extension_type_show_table_format) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/_source_control_configuration_client.py index 2b4c12a5bd0..7bb8d92893a 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/_source_control_configuration_client.py @@ -25,6 +25,7 @@ from azure.core.credentials import TokenCredential from azure.core.pipeline.transport import HttpRequest, HttpResponse +<<<<<<< HEAD from ._configuration import SourceControlConfigurationClientConfiguration from .operations import ExtensionsOperations from .operations import OperationStatusOperations @@ -35,6 +36,8 @@ from .operations import LocationExtensionTypesOperations from . import models +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) class _SDKClient(object): def __init__(self, *args, **kwargs): """This is a fake class to support current implemetation of MultiApiClientMixin." @@ -66,15 +69,23 @@ class SourceControlConfigurationClient(MultiApiClientMixin, _SDKClient): :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ +<<<<<<< HEAD DEFAULT_API_VERSION = '2022-03-01' +======= + DEFAULT_API_VERSION = '2021-09-01' +>>>>>>> 331f997c (updating to the latest vendored sdk) _PROFILE_TAG = "azure.mgmt.kubernetesconfiguration.SourceControlConfigurationClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { None: DEFAULT_API_VERSION, +<<<<<<< HEAD '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', +======= + 'source_control_configurations': '2021-03-01', +>>>>>>> 331f997c (updating to the latest vendored sdk) }}, _PROFILE_TAG + " latest" ) @@ -84,14 +95,16 @@ def __init__( credential, # type: "TokenCredential" subscription_id, # type: str api_version=None, # type: Optional[str] +<<<<<<< HEAD base_url="https://management.azure.com", # type: str +======= + base_url=None, # type: Optional[str] +>>>>>>> 331f997c (updating to the latest vendored sdk) profile=KnownProfiles.default, # type: KnownProfiles **kwargs # type: Any ): - # type: (...) -> None 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__( @@ -113,8 +126,11 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2021-05-01-preview: :mod:`v2021_05_01_preview.models` * 2021-09-01: :mod:`v2021_09_01.models` * 2021-11-01-preview: :mod:`v2021_11_01_preview.models` +<<<<<<< HEAD * 2022-01-01-preview: :mod:`v2022_01_01_preview.models` * 2022-03-01: :mod:`v2022_03_01.models` +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) """ if api_version == '2020-07-01-preview': from .v2020_07_01_preview import models @@ -134,12 +150,15 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-11-01-preview': from .v2021_11_01_preview import models return models +<<<<<<< HEAD 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 +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) raise ValueError("API version {} is not available".format(api_version)) @property @@ -148,15 +167,21 @@ def cluster_extension_type(self): * 2021-05-01-preview: :class:`ClusterExtensionTypeOperations` * 2021-11-01-preview: :class:`ClusterExtensionTypeOperations` +<<<<<<< HEAD * 2022-01-01-preview: :class:`ClusterExtensionTypeOperations` +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) """ api_version = self._get_api_version('cluster_extension_type') if api_version == '2021-05-01-preview': from .v2021_05_01_preview.operations import ClusterExtensionTypeOperations as OperationClass elif api_version == '2021-11-01-preview': from .v2021_11_01_preview.operations import ClusterExtensionTypeOperations as OperationClass +<<<<<<< HEAD elif api_version == '2022-01-01-preview': from .v2022_01_01_preview.operations import ClusterExtensionTypeOperations as OperationClass +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) else: raise ValueError("API version {} does not have operation group 'cluster_extension_type'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -167,15 +192,21 @@ def cluster_extension_types(self): * 2021-05-01-preview: :class:`ClusterExtensionTypesOperations` * 2021-11-01-preview: :class:`ClusterExtensionTypesOperations` +<<<<<<< HEAD * 2022-01-01-preview: :class:`ClusterExtensionTypesOperations` +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) """ api_version = self._get_api_version('cluster_extension_types') if api_version == '2021-05-01-preview': from .v2021_05_01_preview.operations import ClusterExtensionTypesOperations as OperationClass elif api_version == '2021-11-01-preview': from .v2021_11_01_preview.operations import ClusterExtensionTypesOperations as OperationClass +<<<<<<< HEAD elif api_version == '2022-01-01-preview': from .v2022_01_01_preview.operations import ClusterExtensionTypesOperations as OperationClass +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) else: raise ValueError("API version {} does not have operation group 'cluster_extension_types'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -186,15 +217,21 @@ def extension_type_versions(self): * 2021-05-01-preview: :class:`ExtensionTypeVersionsOperations` * 2021-11-01-preview: :class:`ExtensionTypeVersionsOperations` +<<<<<<< HEAD * 2022-01-01-preview: :class:`ExtensionTypeVersionsOperations` +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) """ api_version = self._get_api_version('extension_type_versions') if api_version == '2021-05-01-preview': from .v2021_05_01_preview.operations import ExtensionTypeVersionsOperations as OperationClass elif api_version == '2021-11-01-preview': from .v2021_11_01_preview.operations import ExtensionTypeVersionsOperations as OperationClass +<<<<<<< HEAD elif api_version == '2022-01-01-preview': from .v2022_01_01_preview.operations import ExtensionTypeVersionsOperations as OperationClass +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) else: raise ValueError("API version {} does not have operation group 'extension_type_versions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -203,35 +240,10 @@ def extension_type_versions(self): def extensions(self): """Instance depends on the API version: - 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.extensions = ExtensionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operation_status = OperationStatusOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - 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_version = ExtensionTypeVersionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.location_extension_types = LocationExtensionTypesOperations( - 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 + * 2020-07-01-preview: :class:`ExtensionsOperations` + * 2021-05-01-preview: :class:`ExtensionsOperations` + * 2021-09-01: :class:`ExtensionsOperations` + * 2021-11-01-preview: :class:`ExtensionsOperations` """ api_version = self._get_api_version('extensions') if api_version == '2020-07-01-preview': @@ -242,10 +254,13 @@ def _send_request(self, http_request, **kwargs): from .v2021_09_01.operations import ExtensionsOperations as OperationClass elif api_version == '2021-11-01-preview': from .v2021_11_01_preview.operations import ExtensionsOperations as OperationClass +<<<<<<< HEAD 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 +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) 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))) @@ -255,16 +270,22 @@ def flux_config_operation_status(self): """Instance depends on the API version: * 2021-11-01-preview: :class:`FluxConfigOperationStatusOperations` +<<<<<<< HEAD * 2022-01-01-preview: :class:`FluxConfigOperationStatusOperations` * 2022-03-01: :class:`FluxConfigOperationStatusOperations` +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) """ 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 +<<<<<<< HEAD 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 +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) 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))) @@ -274,16 +295,22 @@ def flux_configurations(self): """Instance depends on the API version: * 2021-11-01-preview: :class:`FluxConfigurationsOperations` +<<<<<<< HEAD * 2022-01-01-preview: :class:`FluxConfigurationsOperations` * 2022-03-01: :class:`FluxConfigurationsOperations` +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) """ 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 +<<<<<<< HEAD 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 +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) 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))) @@ -294,15 +321,21 @@ def location_extension_types(self): * 2021-05-01-preview: :class:`LocationExtensionTypesOperations` * 2021-11-01-preview: :class:`LocationExtensionTypesOperations` +<<<<<<< HEAD * 2022-01-01-preview: :class:`LocationExtensionTypesOperations` +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) """ api_version = self._get_api_version('location_extension_types') if api_version == '2021-05-01-preview': from .v2021_05_01_preview.operations import LocationExtensionTypesOperations as OperationClass elif api_version == '2021-11-01-preview': from .v2021_11_01_preview.operations import LocationExtensionTypesOperations as OperationClass +<<<<<<< HEAD elif api_version == '2022-01-01-preview': from .v2022_01_01_preview.operations import LocationExtensionTypesOperations as OperationClass +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) else: raise ValueError("API version {} does not have operation group 'location_extension_types'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -314,8 +347,11 @@ def operation_status(self): * 2021-05-01-preview: :class:`OperationStatusOperations` * 2021-09-01: :class:`OperationStatusOperations` * 2021-11-01-preview: :class:`OperationStatusOperations` +<<<<<<< HEAD * 2022-01-01-preview: :class:`OperationStatusOperations` * 2022-03-01: :class:`OperationStatusOperations` +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) """ api_version = self._get_api_version('operation_status') if api_version == '2021-05-01-preview': @@ -324,10 +360,13 @@ def operation_status(self): from .v2021_09_01.operations import OperationStatusOperations as OperationClass elif api_version == '2021-11-01-preview': from .v2021_11_01_preview.operations import OperationStatusOperations as OperationClass +<<<<<<< HEAD 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 +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) 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))) @@ -342,8 +381,11 @@ def operations(self): * 2021-05-01-preview: :class:`Operations` * 2021-09-01: :class:`Operations` * 2021-11-01-preview: :class:`Operations` +<<<<<<< HEAD * 2022-01-01-preview: :class:`Operations` * 2022-03-01: :class:`Operations` +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) """ api_version = self._get_api_version('operations') if api_version == '2020-07-01-preview': @@ -358,10 +400,13 @@ def operations(self): from .v2021_09_01.operations import Operations as OperationClass elif api_version == '2021-11-01-preview': from .v2021_11_01_preview.operations import Operations as OperationClass +<<<<<<< HEAD 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 +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) 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))) @@ -375,8 +420,11 @@ def source_control_configurations(self): * 2021-03-01: :class:`SourceControlConfigurationsOperations` * 2021-05-01-preview: :class:`SourceControlConfigurationsOperations` * 2021-11-01-preview: :class:`SourceControlConfigurationsOperations` +<<<<<<< HEAD * 2022-01-01-preview: :class:`SourceControlConfigurationsOperations` * 2022-03-01: :class:`SourceControlConfigurationsOperations` +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) """ api_version = self._get_api_version('source_control_configurations') if api_version == '2020-07-01-preview': @@ -389,10 +437,13 @@ def source_control_configurations(self): from .v2021_05_01_preview.operations import SourceControlConfigurationsOperations as OperationClass elif api_version == '2021-11-01-preview': from .v2021_11_01_preview.operations import SourceControlConfigurationsOperations as OperationClass +<<<<<<< HEAD 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 +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) 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))) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/_version.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/_version.py index c47f66669f1..a0e6f8fad0e 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/_version.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/_version.py @@ -6,4 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD VERSION = "1.0.0" +======= +VERSION = "1.0.0b1" +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/aio/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/aio/_source_control_configuration_client.py index ed320e3b24c..801336a166f 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/aio/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/aio/_source_control_configuration_client.py @@ -54,15 +54,23 @@ class SourceControlConfigurationClient(MultiApiClientMixin, _SDKClient): :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ +<<<<<<< HEAD DEFAULT_API_VERSION = '2022-03-01' +======= + DEFAULT_API_VERSION = '2021-09-01' +>>>>>>> 331f997c (updating to the latest vendored sdk) _PROFILE_TAG = "azure.mgmt.kubernetesconfiguration.SourceControlConfigurationClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { None: DEFAULT_API_VERSION, +<<<<<<< HEAD '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', +======= + 'source_control_configurations': '2021-03-01', +>>>>>>> 331f997c (updating to the latest vendored sdk) }}, _PROFILE_TAG + " latest" ) @@ -72,7 +80,11 @@ def __init__( credential: "AsyncTokenCredential", subscription_id: str, api_version: Optional[str] = None, +<<<<<<< HEAD base_url: str = "https://management.azure.com", +======= + base_url: Optional[str] = None, +>>>>>>> 331f997c (updating to the latest vendored sdk) profile: KnownProfiles = KnownProfiles.default, **kwargs # type: Any ) -> None: @@ -97,8 +109,11 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2021-05-01-preview: :mod:`v2021_05_01_preview.models` * 2021-09-01: :mod:`v2021_09_01.models` * 2021-11-01-preview: :mod:`v2021_11_01_preview.models` +<<<<<<< HEAD * 2022-01-01-preview: :mod:`v2022_01_01_preview.models` * 2022-03-01: :mod:`v2022_03_01.models` +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) """ if api_version == '2020-07-01-preview': from ..v2020_07_01_preview import models @@ -118,12 +133,15 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-11-01-preview': from ..v2021_11_01_preview import models return models +<<<<<<< HEAD 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 +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) raise ValueError("API version {} is not available".format(api_version)) @property @@ -132,15 +150,21 @@ def cluster_extension_type(self): * 2021-05-01-preview: :class:`ClusterExtensionTypeOperations` * 2021-11-01-preview: :class:`ClusterExtensionTypeOperations` +<<<<<<< HEAD * 2022-01-01-preview: :class:`ClusterExtensionTypeOperations` +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) """ api_version = self._get_api_version('cluster_extension_type') if api_version == '2021-05-01-preview': from ..v2021_05_01_preview.aio.operations import ClusterExtensionTypeOperations as OperationClass elif api_version == '2021-11-01-preview': from ..v2021_11_01_preview.aio.operations import ClusterExtensionTypeOperations as OperationClass +<<<<<<< HEAD elif api_version == '2022-01-01-preview': from ..v2022_01_01_preview.aio.operations import ClusterExtensionTypeOperations as OperationClass +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) else: raise ValueError("API version {} does not have operation group 'cluster_extension_type'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -151,15 +175,21 @@ def cluster_extension_types(self): * 2021-05-01-preview: :class:`ClusterExtensionTypesOperations` * 2021-11-01-preview: :class:`ClusterExtensionTypesOperations` +<<<<<<< HEAD * 2022-01-01-preview: :class:`ClusterExtensionTypesOperations` +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) """ api_version = self._get_api_version('cluster_extension_types') if api_version == '2021-05-01-preview': from ..v2021_05_01_preview.aio.operations import ClusterExtensionTypesOperations as OperationClass elif api_version == '2021-11-01-preview': from ..v2021_11_01_preview.aio.operations import ClusterExtensionTypesOperations as OperationClass +<<<<<<< HEAD elif api_version == '2022-01-01-preview': from ..v2022_01_01_preview.aio.operations import ClusterExtensionTypesOperations as OperationClass +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) else: raise ValueError("API version {} does not have operation group 'cluster_extension_types'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -170,15 +200,21 @@ def extension_type_versions(self): * 2021-05-01-preview: :class:`ExtensionTypeVersionsOperations` * 2021-11-01-preview: :class:`ExtensionTypeVersionsOperations` +<<<<<<< HEAD * 2022-01-01-preview: :class:`ExtensionTypeVersionsOperations` +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) """ api_version = self._get_api_version('extension_type_versions') if api_version == '2021-05-01-preview': from ..v2021_05_01_preview.aio.operations import ExtensionTypeVersionsOperations as OperationClass elif api_version == '2021-11-01-preview': from ..v2021_11_01_preview.aio.operations import ExtensionTypeVersionsOperations as OperationClass +<<<<<<< HEAD elif api_version == '2022-01-01-preview': from ..v2022_01_01_preview.aio.operations import ExtensionTypeVersionsOperations as OperationClass +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) else: raise ValueError("API version {} does not have operation group 'extension_type_versions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -191,8 +227,11 @@ def extensions(self): * 2021-05-01-preview: :class:`ExtensionsOperations` * 2021-09-01: :class:`ExtensionsOperations` * 2021-11-01-preview: :class:`ExtensionsOperations` +<<<<<<< HEAD * 2022-01-01-preview: :class:`ExtensionsOperations` * 2022-03-01: :class:`ExtensionsOperations` +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) """ api_version = self._get_api_version('extensions') if api_version == '2020-07-01-preview': @@ -203,10 +242,13 @@ def extensions(self): from ..v2021_09_01.aio.operations import ExtensionsOperations as OperationClass elif api_version == '2021-11-01-preview': from ..v2021_11_01_preview.aio.operations import ExtensionsOperations as OperationClass +<<<<<<< HEAD elif api_version == '2022-01-01-preview': from ..v2022_01_01_preview.aio.operations import ExtensionsOperations as OperationClass elif api_version == '2022-03-01': from ..v2022_03_01.aio.operations import ExtensionsOperations as OperationClass +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) 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))) @@ -216,16 +258,22 @@ def flux_config_operation_status(self): """Instance depends on the API version: * 2021-11-01-preview: :class:`FluxConfigOperationStatusOperations` +<<<<<<< HEAD * 2022-01-01-preview: :class:`FluxConfigOperationStatusOperations` * 2022-03-01: :class:`FluxConfigOperationStatusOperations` +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) """ api_version = self._get_api_version('flux_config_operation_status') if api_version == '2021-11-01-preview': from ..v2021_11_01_preview.aio.operations import FluxConfigOperationStatusOperations as OperationClass +<<<<<<< HEAD elif api_version == '2022-01-01-preview': from ..v2022_01_01_preview.aio.operations import FluxConfigOperationStatusOperations as OperationClass elif api_version == '2022-03-01': from ..v2022_03_01.aio.operations import FluxConfigOperationStatusOperations as OperationClass +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) 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))) @@ -235,16 +283,22 @@ def flux_configurations(self): """Instance depends on the API version: * 2021-11-01-preview: :class:`FluxConfigurationsOperations` +<<<<<<< HEAD * 2022-01-01-preview: :class:`FluxConfigurationsOperations` * 2022-03-01: :class:`FluxConfigurationsOperations` +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) """ api_version = self._get_api_version('flux_configurations') if api_version == '2021-11-01-preview': from ..v2021_11_01_preview.aio.operations import FluxConfigurationsOperations as OperationClass +<<<<<<< HEAD elif api_version == '2022-01-01-preview': from ..v2022_01_01_preview.aio.operations import FluxConfigurationsOperations as OperationClass elif api_version == '2022-03-01': from ..v2022_03_01.aio.operations import FluxConfigurationsOperations as OperationClass +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) 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))) @@ -255,15 +309,21 @@ def location_extension_types(self): * 2021-05-01-preview: :class:`LocationExtensionTypesOperations` * 2021-11-01-preview: :class:`LocationExtensionTypesOperations` +<<<<<<< HEAD * 2022-01-01-preview: :class:`LocationExtensionTypesOperations` +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) """ api_version = self._get_api_version('location_extension_types') if api_version == '2021-05-01-preview': from ..v2021_05_01_preview.aio.operations import LocationExtensionTypesOperations as OperationClass elif api_version == '2021-11-01-preview': from ..v2021_11_01_preview.aio.operations import LocationExtensionTypesOperations as OperationClass +<<<<<<< HEAD elif api_version == '2022-01-01-preview': from ..v2022_01_01_preview.aio.operations import LocationExtensionTypesOperations as OperationClass +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) else: raise ValueError("API version {} does not have operation group 'location_extension_types'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -275,8 +335,11 @@ def operation_status(self): * 2021-05-01-preview: :class:`OperationStatusOperations` * 2021-09-01: :class:`OperationStatusOperations` * 2021-11-01-preview: :class:`OperationStatusOperations` +<<<<<<< HEAD * 2022-01-01-preview: :class:`OperationStatusOperations` * 2022-03-01: :class:`OperationStatusOperations` +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) """ api_version = self._get_api_version('operation_status') if api_version == '2021-05-01-preview': @@ -285,10 +348,13 @@ def operation_status(self): from ..v2021_09_01.aio.operations import OperationStatusOperations as OperationClass elif api_version == '2021-11-01-preview': from ..v2021_11_01_preview.aio.operations import OperationStatusOperations as OperationClass +<<<<<<< HEAD elif api_version == '2022-01-01-preview': from ..v2022_01_01_preview.aio.operations import OperationStatusOperations as OperationClass elif api_version == '2022-03-01': from ..v2022_03_01.aio.operations import OperationStatusOperations as OperationClass +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) 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))) @@ -303,8 +369,11 @@ def operations(self): * 2021-05-01-preview: :class:`Operations` * 2021-09-01: :class:`Operations` * 2021-11-01-preview: :class:`Operations` +<<<<<<< HEAD * 2022-01-01-preview: :class:`Operations` * 2022-03-01: :class:`Operations` +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) """ api_version = self._get_api_version('operations') if api_version == '2020-07-01-preview': @@ -319,10 +388,13 @@ def operations(self): from ..v2021_09_01.aio.operations import Operations as OperationClass elif api_version == '2021-11-01-preview': from ..v2021_11_01_preview.aio.operations import Operations as OperationClass +<<<<<<< HEAD elif api_version == '2022-01-01-preview': from ..v2022_01_01_preview.aio.operations import Operations as OperationClass elif api_version == '2022-03-01': from ..v2022_03_01.aio.operations import Operations as OperationClass +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) 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))) @@ -336,8 +408,11 @@ def source_control_configurations(self): * 2021-03-01: :class:`SourceControlConfigurationsOperations` * 2021-05-01-preview: :class:`SourceControlConfigurationsOperations` * 2021-11-01-preview: :class:`SourceControlConfigurationsOperations` +<<<<<<< HEAD * 2022-01-01-preview: :class:`SourceControlConfigurationsOperations` * 2022-03-01: :class:`SourceControlConfigurationsOperations` +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) """ api_version = self._get_api_version('source_control_configurations') if api_version == '2020-07-01-preview': @@ -350,10 +425,13 @@ def source_control_configurations(self): from ..v2021_05_01_preview.aio.operations import SourceControlConfigurationsOperations as OperationClass elif api_version == '2021-11-01-preview': from ..v2021_11_01_preview.aio.operations import SourceControlConfigurationsOperations as OperationClass +<<<<<<< HEAD elif api_version == '2022-01-01-preview': from ..v2022_01_01_preview.aio.operations import SourceControlConfigurationsOperations as OperationClass elif api_version == '2022-03-01': from ..v2022_03_01.aio.operations import SourceControlConfigurationsOperations as OperationClass +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) 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))) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/models.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/models.py index c9c8d2ae160..7da6cb48cc7 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/models.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/models.py @@ -4,5 +4,10 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- +<<<<<<< HEAD from .v2022_01_01_preview.models import * from .v2022_03_01.models import * +======= +from .v2021_03_01.models import * +from .v2021_09_01.models import * +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/__init__.py index e9096303633..fc12f19c5a1 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/__init__.py @@ -12,7 +12,15 @@ __version__ = VERSION __all__ = ['SourceControlConfigurationClient'] +<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() +======= +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/_configuration.py index a175e772c24..834fd38a3f4 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/_configuration.py @@ -6,16 +6,29 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +======= +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy +>>>>>>> 331f997c (updating to the latest vendored sdk) from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports +<<<<<<< HEAD +======= + from typing import Any + +>>>>>>> 331f997c (updating to the latest vendored sdk) from azure.core.credentials import TokenCredential @@ -33,15 +46,27 @@ class SourceControlConfigurationClientConfiguration(Configuration): def __init__( self, +<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, **kwargs: Any ) -> None: super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +======= + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None +>>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") +<<<<<<< HEAD +======= + super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -65,4 +90,8 @@ 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: +<<<<<<< HEAD self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) +======= + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/_source_control_configuration_client.py index 4a2066e60af..da56fb362c1 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/_source_control_configuration_client.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from copy import deepcopy from typing import Any, Optional, TYPE_CHECKING @@ -42,20 +43,69 @@ class SourceControlConfigurationClient: :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. +======= +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + 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 SourceControlConfigurationsOperations +from .operations import Operations +from .operations import ExtensionsOperations +from . import models + + +class SourceControlConfigurationClient(object): + """KubernetesConfiguration Client. + + :ivar source_control_configurations: SourceControlConfigurationsOperations operations + :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.operations.SourceControlConfigurationsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.operations.Operations + :ivar extensions: ExtensionsOperations operations + :vartype extensions: azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.operations.ExtensionsOperations + :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). + :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. +>>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, +<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) +======= + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) +<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.source_control_configurations = SourceControlConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -88,6 +138,35 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) +======= + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.source_control_configurations = SourceControlConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.extensions = ExtensionsOperations( + 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 +>>>>>>> 331f997c (updating to the latest vendored sdk) def close(self): # type: () -> None diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/__init__.py index 5f583276b4e..5951024da8e 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/__init__.py @@ -8,8 +8,11 @@ from ._source_control_configuration_client import SourceControlConfigurationClient __all__ = ['SourceControlConfigurationClient'] +<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/_configuration.py index 5d42c644d80..46e00988c3e 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/_configuration.py @@ -10,7 +10,11 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +<<<<<<< HEAD from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy +======= +from azure.mgmt.core.policies import ARMHttpLoggingPolicy +>>>>>>> 331f997c (updating to the latest vendored sdk) from .._version import VERSION @@ -37,11 +41,18 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: +<<<<<<< HEAD super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") +<<<<<<< HEAD +======= + super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -64,4 +75,8 @@ 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: +<<<<<<< HEAD self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) +======= + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/_source_control_configuration_client.py index 786354552c0..90ea8a10908 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/_source_control_configuration_client.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from copy import deepcopy from typing import Any, Awaitable, Optional, TYPE_CHECKING @@ -17,10 +18,19 @@ from ._configuration import SourceControlConfigurationClientConfiguration from .operations import ExtensionsOperations, Operations, SourceControlConfigurationsOperations +======= +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 + +>>>>>>> 331f997c (updating to the latest vendored sdk) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential +<<<<<<< HEAD class SourceControlConfigurationClient: """KubernetesConfiguration Client. @@ -42,20 +52,54 @@ class SourceControlConfigurationClient: :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. +======= +from ._configuration import SourceControlConfigurationClientConfiguration +from .operations import SourceControlConfigurationsOperations +from .operations import Operations +from .operations import ExtensionsOperations +from .. import models + + +class SourceControlConfigurationClient(object): + """KubernetesConfiguration Client. + + :ivar source_control_configurations: SourceControlConfigurationsOperations operations + :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.aio.operations.SourceControlConfigurationsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.aio.operations.Operations + :ivar extensions: ExtensionsOperations operations + :vartype extensions: azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.aio.operations.ExtensionsOperations + :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). + :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. +>>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, +<<<<<<< HEAD base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) +======= + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) +<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.source_control_configurations = SourceControlConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -88,6 +132,34 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) +======= + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.source_control_configurations = SourceControlConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.extensions = ExtensionsOperations( + 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 +>>>>>>> 331f997c (updating to the latest vendored sdk) async def close(self) -> None: await self._client.close() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_extensions_operations.py index 2cb12620a0e..699ace6936f 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_extensions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_extensions_operations.py @@ -5,13 +5,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -21,6 +25,13 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._extensions_operations import build_create_request, build_delete_request, build_get_request, build_list_request, build_update_request +======= +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +>>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +57,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace_async +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) async def create( self, resource_group_name: str, @@ -66,15 +80,23 @@ async def create( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_instance_name: Name of an instance of the Extension. :type extension_instance_name: str :param extension_instance: Properties necessary to Create an Extension Instance. +<<<<<<< HEAD :type extension_instance: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstance +======= + :type extension_instance: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstance +>>>>>>> 331f997c (updating to the latest vendored sdk) :keyword callable cls: A custom type or function that will be passed the direct response :return: ExtensionInstance, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstance @@ -85,6 +107,7 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -104,12 +127,47 @@ async def create( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2020-07-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionInstanceName': self._serialize.url("extension_instance_name", extension_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(extension_instance, 'ExtensionInstance') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExtensionInstance', pipeline_response) @@ -118,11 +176,16 @@ async def create( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore @distributed_trace_async +======= + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -141,8 +204,12 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_instance_name: Name of an instance of the Extension. @@ -157,6 +224,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -171,12 +239,42 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2020-07-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionInstanceName': self._serialize.url("extension_instance_name", extension_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExtensionInstance', pipeline_response) @@ -185,11 +283,16 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore @distributed_trace_async +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) async def update( self, resource_group_name: str, @@ -209,15 +312,23 @@ async def update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_instance_name: Name of an instance of the Extension. :type extension_instance_name: str :param extension_instance: Properties to Update in the Extension Instance. +<<<<<<< HEAD :type extension_instance: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstanceUpdate +======= + :type extension_instance: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstanceUpdate +>>>>>>> 331f997c (updating to the latest vendored sdk) :keyword callable cls: A custom type or function that will be passed the direct response :return: ExtensionInstance, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstance @@ -228,6 +339,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -247,12 +359,47 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2020-07-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionInstanceName': self._serialize.url("extension_instance_name", extension_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(extension_instance, 'ExtensionInstanceUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExtensionInstance', pipeline_response) @@ -261,11 +408,16 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore @distributed_trace_async +======= + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) async def delete( self, resource_group_name: str, @@ -285,8 +437,12 @@ async def delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_instance_name: Name of an instance of the Extension. @@ -301,6 +457,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_delete_request( @@ -315,12 +472,42 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2020-07-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionInstanceName': self._serialize.url("extension_instance_name", extension_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -328,8 +515,11 @@ async def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore +<<<<<<< HEAD @distributed_trace +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -347,6 +537,7 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -356,6 +547,14 @@ def list( cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstancesList] +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExtensionInstancesList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstancesList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionInstancesList"] @@ -363,6 +562,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -394,6 +594,40 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionInstancesList", pipeline_response) +======= + api_version = "2020-07-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ExtensionInstancesList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -406,13 +640,21 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_operations.py index 15d34648a9c..5c444b474e1 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_operations.py @@ -5,13 +5,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -21,6 +25,13 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operations import build_list_request +======= +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +>>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +57,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, **kwargs: Any @@ -54,10 +68,15 @@ def list( """List all the available operations the KubernetesConfiguration resource provider supports. :keyword callable cls: A custom type or function that will be passed the direct response +<<<<<<< HEAD :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceProviderOperationList] +======= + :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceProviderOperationList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -65,6 +84,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -86,6 +106,32 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) +======= + api_version = "2020-07-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,13 +144,21 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_source_control_configurations_operations.py index 540d16d33ae..6bdf2775f7a 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_source_control_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_source_control_configurations_operations.py @@ -5,24 +5,36 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +======= +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +>>>>>>> 331f997c (updating to the latest vendored sdk) from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +<<<<<<< HEAD from ..._vendor import _convert_request from ...operations._source_control_configurations_operations import build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request +======= + +>>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +60,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace_async +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -67,16 +82,24 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) +<<<<<<< HEAD :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration +======= + :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -84,6 +107,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -98,12 +122,42 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2020-07-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) @@ -112,11 +166,16 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @distributed_trace_async +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) async def create_or_update( self, resource_group_name: str, @@ -136,19 +195,30 @@ async def create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. +<<<<<<< HEAD :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration +======= + :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -156,6 +226,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -175,12 +246,47 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2020-07-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -193,10 +299,15 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore +======= + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) async def _delete_initial( self, resource_group_name: str, @@ -211,6 +322,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_delete_request_initial( @@ -225,20 +337,54 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2020-07-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore +<<<<<<< HEAD @distributed_trace_async +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_delete( self, resource_group_name: str, @@ -258,14 +404,19 @@ async def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. +<<<<<<< HEAD :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -277,6 +428,17 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] +======= + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -293,14 +455,33 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) +<<<<<<< HEAD kwargs.pop('error_map', None) +======= + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) +>>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) +<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -312,10 +493,15 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @distributed_trace +======= + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -333,6 +519,7 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -342,6 +529,14 @@ def list( cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfigurationList] +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SourceControlConfigurationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfigurationList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfigurationList"] @@ -349,6 +544,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -380,6 +576,40 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("SourceControlConfigurationList", pipeline_response) +======= + api_version = "2020-07-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SourceControlConfigurationList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -392,13 +622,21 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/__init__.py index 70c78dcb2d4..75b7bcc2ae9 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/__init__.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from ._models_py3 import ComplianceStatus from ._models_py3 import ConfigurationIdentity from ._models_py3 import ErrorDefinition @@ -28,6 +29,52 @@ from ._models_py3 import SourceControlConfigurationList from ._models_py3 import SystemData +======= +try: + from ._models_py3 import ComplianceStatus + from ._models_py3 import ConfigurationIdentity + from ._models_py3 import ErrorDefinition + from ._models_py3 import ErrorResponse + from ._models_py3 import ExtensionInstance + from ._models_py3 import ExtensionInstanceUpdate + from ._models_py3 import ExtensionInstancesList + from ._models_py3 import ExtensionStatus + from ._models_py3 import HelmOperatorProperties + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import ResourceProviderOperation + from ._models_py3 import ResourceProviderOperationDisplay + from ._models_py3 import ResourceProviderOperationList + from ._models_py3 import Result + from ._models_py3 import Scope + from ._models_py3 import ScopeCluster + from ._models_py3 import ScopeNamespace + from ._models_py3 import SourceControlConfiguration + from ._models_py3 import SourceControlConfigurationList + from ._models_py3 import SystemData +except (SyntaxError, ImportError): + from ._models import ComplianceStatus # type: ignore + from ._models import ConfigurationIdentity # type: ignore + from ._models import ErrorDefinition # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import ExtensionInstance # type: ignore + from ._models import ExtensionInstanceUpdate # type: ignore + from ._models import ExtensionInstancesList # type: ignore + from ._models import ExtensionStatus # type: ignore + from ._models import HelmOperatorProperties # type: ignore + from ._models import ProxyResource # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceProviderOperation # type: ignore + from ._models import ResourceProviderOperationDisplay # type: ignore + from ._models import ResourceProviderOperationList # type: ignore + from ._models import Result # type: ignore + from ._models import Scope # type: ignore + from ._models import ScopeCluster # type: ignore + from ._models import ScopeNamespace # type: ignore + from ._models import SourceControlConfiguration # type: ignore + from ._models import SourceControlConfigurationList # type: ignore + from ._models import SystemData # type: ignore +>>>>>>> 331f997c (updating to the latest vendored sdk) from ._source_control_configuration_client_enums import ( ComplianceStateType, diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_models.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_models.py new file mode 100644 index 00000000000..ef31b453ddc --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_models.py @@ -0,0 +1,817 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class ComplianceStatus(msrest.serialization.Model): + """Compliance Status details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar compliance_state: The compliance state of the configuration. Possible values include: + "Pending", "Compliant", "Noncompliant", "Installed", "Failed". + :vartype compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ComplianceStateType + :param last_config_applied: Datetime the configuration was last applied. + :type last_config_applied: ~datetime.datetime + :param message: Message from when the configuration was applied. + :type message: str + :param message_level: Level of the message. Possible values include: "Error", "Warning", + "Information". + :type message_level: str or + ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.MessageLevelType + """ + + _validation = { + 'compliance_state': {'readonly': True}, + } + + _attribute_map = { + 'compliance_state': {'key': 'complianceState', 'type': 'str'}, + 'last_config_applied': {'key': 'lastConfigApplied', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'message_level': {'key': 'messageLevel', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ComplianceStatus, self).__init__(**kwargs) + self.compliance_state = None + self.last_config_applied = kwargs.get('last_config_applied', None) + self.message = kwargs.get('message', None) + self.message_level = kwargs.get('message_level', None) + + +class ConfigurationIdentity(msrest.serialization.Model): + """Identity for the managed cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of the system assigned identity which is used by the + configuration. + :vartype principal_id: str + :ivar tenant_id: The tenant id of the system assigned identity which is used by the + configuration. + :vartype tenant_id: str + :param type: The type of identity used for the configuration. Type 'SystemAssigned' will use an + implicitly created identity. Type 'None' will not use Managed Identity for the configuration. + Possible values include: "SystemAssigned", "None". + :type type: str or + ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConfigurationIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + + +class ErrorDefinition(msrest.serialization.Model): + """Error definition. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Service specific error code which serves as the substatus for the HTTP + error code. + :type code: str + :param message: Required. Description of the error. + :type message: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDefinition, self).__init__(**kwargs) + self.code = kwargs['code'] + self.message = kwargs['message'] + + +class ErrorResponse(msrest.serialization.Model): + """Error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Error definition. + :vartype error: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ErrorDefinition + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinition'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = None + + +class Resource(msrest.serialization.Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = kwargs.get('system_data', None) + + +class ProxyResource(Resource): + """ARM proxy resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class ExtensionInstance(ProxyResource): + """The Extension Instance object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData + :param extension_type: Type of the Extension, of which this resource is an instance of. It + must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the + Extension publisher. + :type extension_type: str + :param auto_upgrade_minor_version: Flag to note if this instance participates in auto upgrade + of minor version, or not. + :type auto_upgrade_minor_version: bool + :param release_train: ReleaseTrain this extension instance participates in for auto-upgrade + (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :type release_train: str + :param version: Version of the extension for this extension instance, if it is 'pinned' to a + specific version. autoUpgradeMinorVersion must be 'false'. + :type version: str + :param scope: Scope at which the extension instance is installed. + :type scope: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Scope + :param configuration_settings: Configuration settings, as name-value pairs for configuring this + instance of the extension. + :type configuration_settings: dict[str, str] + :param configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this instance of the extension. + :type configuration_protected_settings: dict[str, str] + :ivar install_state: Status of installation of this instance of the extension. Possible values + include: "Pending", "Installed", "Failed". + :vartype install_state: str or + ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.InstallStateType + :param statuses: Status from this instance of the extension. + :type statuses: + list[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionStatus] + :ivar creation_time: DateLiteral (per ISO8601) noting the time the resource was created by the + client (user). + :vartype creation_time: str + :ivar last_modified_time: DateLiteral (per ISO8601) noting the time the resource was modified + by the client (user). + :vartype last_modified_time: str + :ivar last_status_time: DateLiteral (per ISO8601) noting the time of last status from the + agent. + :vartype last_status_time: str + :ivar error_info: Error information from the Agent - e.g. errors during installation. + :vartype error_info: + ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ErrorDefinition + :param identity: The identity of the configuration. + :type identity: + ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ConfigurationIdentity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'install_state': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'last_status_time': {'readonly': True}, + 'error_info': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'extension_type': {'key': 'properties.extensionType', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'release_train': {'key': 'properties.releaseTrain', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'Scope'}, + 'configuration_settings': {'key': 'properties.configurationSettings', 'type': '{str}'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, + 'install_state': {'key': 'properties.installState', 'type': 'str'}, + 'statuses': {'key': 'properties.statuses', 'type': '[ExtensionStatus]'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'str'}, + 'last_status_time': {'key': 'properties.lastStatusTime', 'type': 'str'}, + 'error_info': {'key': 'properties.errorInfo', 'type': 'ErrorDefinition'}, + 'identity': {'key': 'properties.identity', 'type': 'ConfigurationIdentity'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionInstance, self).__init__(**kwargs) + self.extension_type = kwargs.get('extension_type', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.release_train = kwargs.get('release_train', "Stable") + self.version = kwargs.get('version', None) + self.scope = kwargs.get('scope', None) + self.configuration_settings = kwargs.get('configuration_settings', None) + self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) + self.install_state = None + self.statuses = kwargs.get('statuses', None) + self.creation_time = None + self.last_modified_time = None + self.last_status_time = None + self.error_info = None + self.identity = kwargs.get('identity', None) + + +class ExtensionInstancesList(msrest.serialization.Model): + """Result of the request to list Extension Instances. It contains a list of ExtensionInstance objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Extension Instances within a Kubernetes cluster. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstance] + :ivar next_link: URL to get the next set of extension instance objects, if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExtensionInstance]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionInstancesList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ExtensionInstanceUpdate(msrest.serialization.Model): + """Update Extension Instance request object. + + :param auto_upgrade_minor_version: Flag to note if this instance participates in Extension + Lifecycle Management or not. + :type auto_upgrade_minor_version: bool + :param release_train: ReleaseTrain this extension instance participates in for auto-upgrade + (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :type release_train: str + :param version: Version number of extension, to 'pin' to a specific version. + autoUpgradeMinorVersion must be 'false'. + :type version: str + """ + + _attribute_map = { + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'release_train': {'key': 'properties.releaseTrain', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionInstanceUpdate, self).__init__(**kwargs) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) + self.release_train = kwargs.get('release_train', "Stable") + self.version = kwargs.get('version', None) + + +class ExtensionStatus(msrest.serialization.Model): + """Status from this instance of the extension. + + :param code: Status code provided by the Extension. + :type code: str + :param display_status: Short description of status of this instance of the extension. + :type display_status: str + :param level: Level of the status. Possible values include: "Error", "Warning", "Information". + Default value: "Information". + :type level: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.LevelType + :param message: Detailed message of the status from the Extension instance. + :type message: str + :param time: DateLiteral (per ISO8601) noting the time of installation status. + :type time: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionStatus, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.display_status = kwargs.get('display_status', None) + self.level = kwargs.get('level', "Information") + self.message = kwargs.get('message', None) + self.time = kwargs.get('time', None) + + +class HelmOperatorProperties(msrest.serialization.Model): + """Properties for Helm operator. + + :param chart_version: Version of the operator Helm chart. + :type chart_version: str + :param chart_values: Values override for the operator Helm chart. + :type chart_values: str + """ + + _attribute_map = { + 'chart_version': {'key': 'chartVersion', 'type': 'str'}, + 'chart_values': {'key': 'chartValues', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HelmOperatorProperties, self).__init__(**kwargs) + self.chart_version = kwargs.get('chart_version', None) + self.chart_values = kwargs.get('chart_values', None) + + +class ResourceProviderOperation(msrest.serialization.Model): + """Supported operation of this resource provider. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: Operation name, in format of {provider}/{resource}/{operation}. + :type name: str + :param display: Display metadata associated with the operation. + :type display: + ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceProviderOperationDisplay + :ivar is_data_action: The flag that indicates whether the operation applies to data plane. + :vartype is_data_action: bool + """ + + _validation = { + 'is_data_action': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.is_data_action = None + + +class ResourceProviderOperationDisplay(msrest.serialization.Model): + """Display metadata associated with the operation. + + :param provider: Resource provider: Microsoft KubernetesConfiguration. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class ResourceProviderOperationList(msrest.serialization.Model): + """Result of the request to list operations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: List of operations supported by this resource provider. + :type value: + list[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceProviderOperation] + :ivar next_link: URL to the next set of results, if any. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperationList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class Result(msrest.serialization.Model): + """Sample result definition. + + :param sample_property: Sample property of type string. + :type sample_property: str + """ + + _attribute_map = { + 'sample_property': {'key': 'sampleProperty', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Result, self).__init__(**kwargs) + self.sample_property = kwargs.get('sample_property', None) + + +class Scope(msrest.serialization.Model): + """Scope of the extensionInstance. It can be either Cluster or Namespace; but not both. + + :param cluster: Specifies that the scope of the extensionInstance is Cluster. + :type cluster: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ScopeCluster + :param namespace: Specifies that the scope of the extensionInstance is Namespace. + :type namespace: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ScopeNamespace + """ + + _attribute_map = { + 'cluster': {'key': 'cluster', 'type': 'ScopeCluster'}, + 'namespace': {'key': 'namespace', 'type': 'ScopeNamespace'}, + } + + def __init__( + self, + **kwargs + ): + super(Scope, self).__init__(**kwargs) + self.cluster = kwargs.get('cluster', None) + self.namespace = kwargs.get('namespace', None) + + +class ScopeCluster(msrest.serialization.Model): + """Specifies that the scope of the extensionInstance is Cluster. + + :param release_namespace: Namespace where the extension Release must be placed, for a Cluster + scoped extensionInstance. If this namespace does not exist, it will be created. + :type release_namespace: str + """ + + _attribute_map = { + 'release_namespace': {'key': 'releaseNamespace', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ScopeCluster, self).__init__(**kwargs) + self.release_namespace = kwargs.get('release_namespace', None) + + +class ScopeNamespace(msrest.serialization.Model): + """Specifies that the scope of the extensionInstance is Namespace. + + :param target_namespace: Namespace where the extensionInstance will be created for an Namespace + scoped extensionInstance. If this namespace does not exist, it will be created. + :type target_namespace: str + """ + + _attribute_map = { + 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ScopeNamespace, self).__init__(**kwargs) + self.target_namespace = kwargs.get('target_namespace', None) + + +class SourceControlConfiguration(ProxyResource): + """The SourceControl Configuration object returned in Get & Put response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData + :param repository_url: Url of the SourceControl Repository. + :type repository_url: str + :param operator_namespace: The namespace to which this operator is installed to. Maximum of 253 + lower case alphanumeric characters, hyphen and period only. + :type operator_namespace: str + :param operator_instance_name: Instance name of the operator - identifying the specific + configuration. + :type operator_instance_name: str + :param operator_type: Type of the operator. Possible values include: "Flux". + :type operator_type: str or + ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.OperatorType + :param operator_params: Any Parameters for the Operator instance in string format. + :type operator_params: str + :param configuration_protected_settings: Name-value pairs of protected configuration settings + for the configuration. + :type configuration_protected_settings: dict[str, str] + :param operator_scope: Scope at which the operator will be installed. Possible values include: + "cluster", "namespace". Default value: "cluster". + :type operator_scope: str or + ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.OperatorScopeType + :ivar repository_public_key: Public Key associated with this SourceControl configuration + (either generated within the cluster or provided by the user). + :vartype repository_public_key: str + :param ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys + required to access private Git instances. + :type ssh_known_hosts_contents: str + :param enable_helm_operator: Option to enable Helm Operator for this git configuration. + :type enable_helm_operator: bool + :param helm_operator_properties: Properties for Helm operator. + :type helm_operator_properties: + ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.HelmOperatorProperties + :ivar provisioning_state: The provisioning state of the resource provider. Possible values + include: "Accepted", "Deleting", "Running", "Succeeded", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ProvisioningStateType + :ivar compliance_status: Compliance Status of the Configuration. + :vartype compliance_status: + ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ComplianceStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'repository_public_key': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'compliance_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'operator_namespace': {'key': 'properties.operatorNamespace', 'type': 'str'}, + 'operator_instance_name': {'key': 'properties.operatorInstanceName', 'type': 'str'}, + 'operator_type': {'key': 'properties.operatorType', 'type': 'str'}, + 'operator_params': {'key': 'properties.operatorParams', 'type': 'str'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, + 'operator_scope': {'key': 'properties.operatorScope', 'type': 'str'}, + 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, + 'ssh_known_hosts_contents': {'key': 'properties.sshKnownHostsContents', 'type': 'str'}, + 'enable_helm_operator': {'key': 'properties.enableHelmOperator', 'type': 'bool'}, + 'helm_operator_properties': {'key': 'properties.helmOperatorProperties', 'type': 'HelmOperatorProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'compliance_status': {'key': 'properties.complianceStatus', 'type': 'ComplianceStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlConfiguration, self).__init__(**kwargs) + self.repository_url = kwargs.get('repository_url', None) + self.operator_namespace = kwargs.get('operator_namespace', "default") + self.operator_instance_name = kwargs.get('operator_instance_name', None) + self.operator_type = kwargs.get('operator_type', None) + self.operator_params = kwargs.get('operator_params', None) + self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) + self.operator_scope = kwargs.get('operator_scope', "cluster") + self.repository_public_key = None + self.ssh_known_hosts_contents = kwargs.get('ssh_known_hosts_contents', None) + self.enable_helm_operator = kwargs.get('enable_helm_operator', None) + self.helm_operator_properties = kwargs.get('helm_operator_properties', None) + self.provisioning_state = None + self.compliance_status = None + + +class SourceControlConfigurationList(msrest.serialization.Model): + """Result of the request to list Source Control Configurations. It contains a list of SourceControlConfiguration objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Source Control Configurations within a Kubernetes cluster. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration] + :ivar next_link: URL to get the next set of configuration objects, if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SourceControlConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlConfigurationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SystemData(msrest.serialization.Model): + """Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_by: A string identifier for the identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource: user, application, + managedIdentity, key. + :vartype created_by_type: str + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: A string identifier for the identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource: user, + application, managedIdentity, key. + :vartype last_modified_by_type: str + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _validation = { + 'created_by': {'readonly': True}, + 'created_by_type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + 'last_modified_by_type': {'readonly': True}, + 'last_modified_at': {'readonly': True}, + } + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = None + self.created_by_type = None + self.created_at = None + self.last_modified_by = None + self.last_modified_by_type = None + self.last_modified_at = None diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_models_py3.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_models_py3.py index d28c93715ed..17a02903590 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_models_py3.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_models_py3.py @@ -24,6 +24,7 @@ class ComplianceStatus(msrest.serialization.Model): "Pending", "Compliant", "Noncompliant", "Installed", "Failed". :vartype compliance_state: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ComplianceStateType +<<<<<<< HEAD :ivar last_config_applied: Datetime the configuration was last applied. :vartype last_config_applied: ~datetime.datetime :ivar message: Message from when the configuration was applied. @@ -31,6 +32,15 @@ class ComplianceStatus(msrest.serialization.Model): :ivar message_level: Level of the message. Possible values include: "Error", "Warning", "Information". :vartype message_level: str or +======= + :param last_config_applied: Datetime the configuration was last applied. + :type last_config_applied: ~datetime.datetime + :param message: Message from when the configuration was applied. + :type message: str + :param message_level: Level of the message. Possible values include: "Error", "Warning", + "Information". + :type message_level: str or +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.MessageLevelType """ @@ -53,6 +63,7 @@ def __init__( message_level: Optional[Union[str, "MessageLevelType"]] = None, **kwargs ): +<<<<<<< HEAD """ :keyword last_config_applied: Datetime the configuration was last applied. :paramtype last_config_applied: ~datetime.datetime @@ -63,6 +74,8 @@ def __init__( :paramtype message_level: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.MessageLevelType """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ComplianceStatus, self).__init__(**kwargs) self.compliance_state = None self.last_config_applied = last_config_applied @@ -81,10 +94,17 @@ class ConfigurationIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant id of the system assigned identity which is used by the configuration. :vartype tenant_id: str +<<<<<<< HEAD :ivar type: The type of identity used for the configuration. Type 'SystemAssigned' will use an implicitly created identity. Type 'None' will not use Managed Identity for the configuration. Possible values include: "SystemAssigned", "None". :vartype type: str or +======= + :param type: The type of identity used for the configuration. Type 'SystemAssigned' will use an + implicitly created identity. Type 'None' will not use Managed Identity for the configuration. + Possible values include: "SystemAssigned", "None". + :type type: str or +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceIdentityType """ @@ -105,6 +125,7 @@ def __init__( type: Optional[Union[str, "ResourceIdentityType"]] = None, **kwargs ): +<<<<<<< HEAD """ :keyword type: The type of identity used for the configuration. Type 'SystemAssigned' will use an implicitly created identity. Type 'None' will not use Managed Identity for the @@ -112,6 +133,8 @@ def __init__( :paramtype type: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceIdentityType """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ConfigurationIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -123,11 +146,19 @@ class ErrorDefinition(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. +<<<<<<< HEAD :ivar code: Required. Service specific error code which serves as the substatus for the HTTP error code. :vartype code: str :ivar message: Required. Description of the error. :vartype message: str +======= + :param code: Required. Service specific error code which serves as the substatus for the HTTP + error code. + :type code: str + :param message: Required. Description of the error. + :type message: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -147,6 +178,7 @@ def __init__( message: str, **kwargs ): +<<<<<<< HEAD """ :keyword code: Required. Service specific error code which serves as the substatus for the HTTP error code. @@ -154,6 +186,8 @@ def __init__( :keyword message: Required. Description of the error. :paramtype message: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorDefinition, self).__init__(**kwargs) self.code = code self.message = message @@ -180,8 +214,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorResponse, self).__init__(**kwargs) self.error = None @@ -197,9 +234,15 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str +<<<<<<< HEAD :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData +======= + :param system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -221,12 +264,15 @@ def __init__( system_data: Optional["SystemData"] = None, **kwargs ): +<<<<<<< HEAD """ :keyword system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :paramtype system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -245,9 +291,15 @@ class ProxyResource(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str +<<<<<<< HEAD :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData +======= + :param system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -269,12 +321,15 @@ def __init__( system_data: Optional["SystemData"] = None, **kwargs ): +<<<<<<< HEAD """ :keyword system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :paramtype system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ProxyResource, self).__init__(system_data=system_data, **kwargs) @@ -289,6 +344,7 @@ class ExtensionInstance(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str +<<<<<<< HEAD :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData @@ -313,12 +369,43 @@ class ExtensionInstance(ProxyResource): :ivar configuration_protected_settings: Configuration settings that are sensitive, as name-value pairs for configuring this instance of the extension. :vartype configuration_protected_settings: dict[str, str] +======= + :param system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData + :param extension_type: Type of the Extension, of which this resource is an instance of. It + must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the + Extension publisher. + :type extension_type: str + :param auto_upgrade_minor_version: Flag to note if this instance participates in auto upgrade + of minor version, or not. + :type auto_upgrade_minor_version: bool + :param release_train: ReleaseTrain this extension instance participates in for auto-upgrade + (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :type release_train: str + :param version: Version of the extension for this extension instance, if it is 'pinned' to a + specific version. autoUpgradeMinorVersion must be 'false'. + :type version: str + :param scope: Scope at which the extension instance is installed. + :type scope: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Scope + :param configuration_settings: Configuration settings, as name-value pairs for configuring this + instance of the extension. + :type configuration_settings: dict[str, str] + :param configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this instance of the extension. + :type configuration_protected_settings: dict[str, str] +>>>>>>> 331f997c (updating to the latest vendored sdk) :ivar install_state: Status of installation of this instance of the extension. Possible values include: "Pending", "Installed", "Failed". :vartype install_state: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.InstallStateType +<<<<<<< HEAD :ivar statuses: Status from this instance of the extension. :vartype statuses: +======= + :param statuses: Status from this instance of the extension. + :type statuses: +>>>>>>> 331f997c (updating to the latest vendored sdk) list[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionStatus] :ivar creation_time: DateLiteral (per ISO8601) noting the time the resource was created by the client (user). @@ -332,8 +419,13 @@ class ExtensionInstance(ProxyResource): :ivar error_info: Error information from the Agent - e.g. errors during installation. :vartype error_info: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ErrorDefinition +<<<<<<< HEAD :ivar identity: The identity of the configuration. :vartype identity: +======= + :param identity: The identity of the configuration. + :type identity: +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ConfigurationIdentity """ @@ -384,6 +476,7 @@ def __init__( identity: Optional["ConfigurationIdentity"] = None, **kwargs ): +<<<<<<< HEAD """ :keyword system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. @@ -417,6 +510,8 @@ def __init__( :paramtype identity: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ConfigurationIdentity """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionInstance, self).__init__(system_data=system_data, **kwargs) self.extension_type = extension_type self.auto_upgrade_minor_version = auto_upgrade_minor_version @@ -460,8 +555,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionInstancesList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -470,6 +568,7 @@ def __init__( class ExtensionInstanceUpdate(msrest.serialization.Model): """Update Extension Instance request object. +<<<<<<< HEAD :ivar auto_upgrade_minor_version: Flag to note if this instance participates in Extension Lifecycle Management or not. :vartype auto_upgrade_minor_version: bool @@ -479,6 +578,17 @@ class ExtensionInstanceUpdate(msrest.serialization.Model): :ivar version: Version number of extension, to 'pin' to a specific version. autoUpgradeMinorVersion must be 'false'. :vartype version: str +======= + :param auto_upgrade_minor_version: Flag to note if this instance participates in Extension + Lifecycle Management or not. + :type auto_upgrade_minor_version: bool + :param release_train: ReleaseTrain this extension instance participates in for auto-upgrade + (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :type release_train: str + :param version: Version number of extension, to 'pin' to a specific version. + autoUpgradeMinorVersion must be 'false'. + :type version: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -495,6 +605,7 @@ def __init__( version: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword auto_upgrade_minor_version: Flag to note if this instance participates in Extension Lifecycle Management or not. @@ -506,6 +617,8 @@ def __init__( autoUpgradeMinorVersion must be 'false'. :paramtype version: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionInstanceUpdate, self).__init__(**kwargs) self.auto_upgrade_minor_version = auto_upgrade_minor_version self.release_train = release_train @@ -515,6 +628,7 @@ def __init__( class ExtensionStatus(msrest.serialization.Model): """Status from this instance of the extension. +<<<<<<< HEAD :ivar code: Status code provided by the Extension. :vartype code: str :ivar display_status: Short description of status of this instance of the extension. @@ -526,6 +640,19 @@ class ExtensionStatus(msrest.serialization.Model): :vartype message: str :ivar time: DateLiteral (per ISO8601) noting the time of installation status. :vartype time: str +======= + :param code: Status code provided by the Extension. + :type code: str + :param display_status: Short description of status of this instance of the extension. + :type display_status: str + :param level: Level of the status. Possible values include: "Error", "Warning", "Information". + Default value: "Information". + :type level: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.LevelType + :param message: Detailed message of the status from the Extension instance. + :type message: str + :param time: DateLiteral (per ISO8601) noting the time of installation status. + :type time: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -546,6 +673,7 @@ def __init__( time: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword code: Status code provided by the Extension. :paramtype code: str @@ -560,6 +688,8 @@ def __init__( :keyword time: DateLiteral (per ISO8601) noting the time of installation status. :paramtype time: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionStatus, self).__init__(**kwargs) self.code = code self.display_status = display_status @@ -571,10 +701,17 @@ def __init__( class HelmOperatorProperties(msrest.serialization.Model): """Properties for Helm operator. +<<<<<<< HEAD :ivar chart_version: Version of the operator Helm chart. :vartype chart_version: str :ivar chart_values: Values override for the operator Helm chart. :vartype chart_values: str +======= + :param chart_version: Version of the operator Helm chart. + :type chart_version: str + :param chart_values: Values override for the operator Helm chart. + :type chart_values: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -589,12 +726,15 @@ def __init__( chart_values: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword chart_version: Version of the operator Helm chart. :paramtype chart_version: str :keyword chart_values: Values override for the operator Helm chart. :paramtype chart_values: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(HelmOperatorProperties, self).__init__(**kwargs) self.chart_version = chart_version self.chart_values = chart_values @@ -605,10 +745,17 @@ class ResourceProviderOperation(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. +<<<<<<< HEAD :ivar name: Operation name, in format of {provider}/{resource}/{operation}. :vartype name: str :ivar display: Display metadata associated with the operation. :vartype display: +======= + :param name: Operation name, in format of {provider}/{resource}/{operation}. + :type name: str + :param display: Display metadata associated with the operation. + :type display: +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceProviderOperationDisplay :ivar is_data_action: The flag that indicates whether the operation applies to data plane. :vartype is_data_action: bool @@ -631,6 +778,7 @@ def __init__( display: Optional["ResourceProviderOperationDisplay"] = None, **kwargs ): +<<<<<<< HEAD """ :keyword name: Operation name, in format of {provider}/{resource}/{operation}. :paramtype name: str @@ -638,6 +786,8 @@ def __init__( :paramtype display: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceProviderOperationDisplay """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperation, self).__init__(**kwargs) self.name = name self.display = display @@ -647,6 +797,7 @@ def __init__( class ResourceProviderOperationDisplay(msrest.serialization.Model): """Display metadata associated with the operation. +<<<<<<< HEAD :ivar provider: Resource provider: Microsoft KubernetesConfiguration. :vartype provider: str :ivar resource: Resource on which the operation is performed. @@ -655,6 +806,16 @@ class ResourceProviderOperationDisplay(msrest.serialization.Model): :vartype operation: str :ivar description: Description of this operation. :vartype description: str +======= + :param provider: Resource provider: Microsoft KubernetesConfiguration. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this operation. + :type description: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -673,6 +834,7 @@ def __init__( description: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword provider: Resource provider: Microsoft KubernetesConfiguration. :paramtype provider: str @@ -683,6 +845,8 @@ def __init__( :keyword description: Description of this operation. :paramtype description: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperationDisplay, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -695,8 +859,13 @@ class ResourceProviderOperationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. +<<<<<<< HEAD :ivar value: List of operations supported by this resource provider. :vartype value: +======= + :param value: List of operations supported by this resource provider. + :type value: +>>>>>>> 331f997c (updating to the latest vendored sdk) list[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceProviderOperation] :ivar next_link: URL to the next set of results, if any. :vartype next_link: str @@ -717,11 +886,14 @@ def __init__( value: Optional[List["ResourceProviderOperation"]] = None, **kwargs ): +<<<<<<< HEAD """ :keyword value: List of operations supported by this resource provider. :paramtype value: list[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceProviderOperation] """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperationList, self).__init__(**kwargs) self.value = value self.next_link = None @@ -730,8 +902,13 @@ def __init__( class Result(msrest.serialization.Model): """Sample result definition. +<<<<<<< HEAD :ivar sample_property: Sample property of type string. :vartype sample_property: str +======= + :param sample_property: Sample property of type string. + :type sample_property: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -744,10 +921,13 @@ def __init__( sample_property: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword sample_property: Sample property of type string. :paramtype sample_property: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(Result, self).__init__(**kwargs) self.sample_property = sample_property @@ -755,11 +935,18 @@ def __init__( class Scope(msrest.serialization.Model): """Scope of the extensionInstance. It can be either Cluster or Namespace; but not both. +<<<<<<< HEAD :ivar cluster: Specifies that the scope of the extensionInstance is Cluster. :vartype cluster: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ScopeCluster :ivar namespace: Specifies that the scope of the extensionInstance is Namespace. :vartype namespace: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ScopeNamespace +======= + :param cluster: Specifies that the scope of the extensionInstance is Cluster. + :type cluster: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ScopeCluster + :param namespace: Specifies that the scope of the extensionInstance is Namespace. + :type namespace: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ScopeNamespace +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -774,6 +961,7 @@ def __init__( namespace: Optional["ScopeNamespace"] = None, **kwargs ): +<<<<<<< HEAD """ :keyword cluster: Specifies that the scope of the extensionInstance is Cluster. :paramtype cluster: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ScopeCluster @@ -781,6 +969,8 @@ def __init__( :paramtype namespace: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ScopeNamespace """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(Scope, self).__init__(**kwargs) self.cluster = cluster self.namespace = namespace @@ -789,9 +979,15 @@ def __init__( class ScopeCluster(msrest.serialization.Model): """Specifies that the scope of the extensionInstance is Cluster. +<<<<<<< HEAD :ivar release_namespace: Namespace where the extension Release must be placed, for a Cluster scoped extensionInstance. If this namespace does not exist, it will be created. :vartype release_namespace: str +======= + :param release_namespace: Namespace where the extension Release must be placed, for a Cluster + scoped extensionInstance. If this namespace does not exist, it will be created. + :type release_namespace: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -804,11 +1000,14 @@ def __init__( release_namespace: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword release_namespace: Namespace where the extension Release must be placed, for a Cluster scoped extensionInstance. If this namespace does not exist, it will be created. :paramtype release_namespace: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ScopeCluster, self).__init__(**kwargs) self.release_namespace = release_namespace @@ -816,9 +1015,15 @@ def __init__( class ScopeNamespace(msrest.serialization.Model): """Specifies that the scope of the extensionInstance is Namespace. +<<<<<<< HEAD :ivar target_namespace: Namespace where the extensionInstance will be created for an Namespace scoped extensionInstance. If this namespace does not exist, it will be created. :vartype target_namespace: str +======= + :param target_namespace: Namespace where the extensionInstance will be created for an Namespace + scoped extensionInstance. If this namespace does not exist, it will be created. + :type target_namespace: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -831,11 +1036,14 @@ def __init__( target_namespace: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword target_namespace: Namespace where the extensionInstance will be created for an Namespace scoped extensionInstance. If this namespace does not exist, it will be created. :paramtype target_namespace: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ScopeNamespace, self).__init__(**kwargs) self.target_namespace = target_namespace @@ -851,6 +1059,7 @@ class SourceControlConfiguration(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str +<<<<<<< HEAD :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData @@ -873,10 +1082,35 @@ class SourceControlConfiguration(ProxyResource): :ivar operator_scope: Scope at which the operator will be installed. Possible values include: "cluster", "namespace". Default value: "cluster". :vartype operator_scope: str or +======= + :param system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData + :param repository_url: Url of the SourceControl Repository. + :type repository_url: str + :param operator_namespace: The namespace to which this operator is installed to. Maximum of 253 + lower case alphanumeric characters, hyphen and period only. + :type operator_namespace: str + :param operator_instance_name: Instance name of the operator - identifying the specific + configuration. + :type operator_instance_name: str + :param operator_type: Type of the operator. Possible values include: "Flux". + :type operator_type: str or + ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.OperatorType + :param operator_params: Any Parameters for the Operator instance in string format. + :type operator_params: str + :param configuration_protected_settings: Name-value pairs of protected configuration settings + for the configuration. + :type configuration_protected_settings: dict[str, str] + :param operator_scope: Scope at which the operator will be installed. Possible values include: + "cluster", "namespace". Default value: "cluster". + :type operator_scope: str or +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.OperatorScopeType :ivar repository_public_key: Public Key associated with this SourceControl configuration (either generated within the cluster or provided by the user). :vartype repository_public_key: str +<<<<<<< HEAD :ivar ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys required to access private Git instances. :vartype ssh_known_hosts_contents: str @@ -884,6 +1118,15 @@ class SourceControlConfiguration(ProxyResource): :vartype enable_helm_operator: bool :ivar helm_operator_properties: Properties for Helm operator. :vartype helm_operator_properties: +======= + :param ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys + required to access private Git instances. + :type ssh_known_hosts_contents: str + :param enable_helm_operator: Option to enable Helm Operator for this git configuration. + :type enable_helm_operator: bool + :param helm_operator_properties: Properties for Helm operator. + :type helm_operator_properties: +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.HelmOperatorProperties :ivar provisioning_state: The provisioning state of the resource provider. Possible values include: "Accepted", "Deleting", "Running", "Succeeded", "Failed". @@ -939,6 +1182,7 @@ def __init__( helm_operator_properties: Optional["HelmOperatorProperties"] = None, **kwargs ): +<<<<<<< HEAD """ :keyword system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. @@ -973,6 +1217,8 @@ def __init__( :paramtype helm_operator_properties: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.HelmOperatorProperties """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(SourceControlConfiguration, self).__init__(system_data=system_data, **kwargs) self.repository_url = repository_url self.operator_namespace = operator_namespace @@ -1015,8 +1261,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(SourceControlConfigurationList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -1065,8 +1314,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(SystemData, self).__init__(**kwargs) self.created_by = None self.created_by_type = None diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_source_control_configuration_client_enums.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_source_control_configuration_client_enums.py index bae6382fbce..0f07aea7fd9 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_source_control_configuration_client_enums.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_source_control_configuration_client_enums.py @@ -6,12 +6,36 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from enum import Enum from six import with_metaclass from azure.core import CaseInsensitiveEnumMeta class ComplianceStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class ComplianceStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """The compliance state of the configuration. """ @@ -21,17 +45,29 @@ class ComplianceStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): INSTALLED = "Installed" FAILED = "Failed" +<<<<<<< HEAD class Enum0(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class Enum0(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) MICROSOFT_CONTAINER_SERVICE = "Microsoft.ContainerService" MICROSOFT_KUBERNETES = "Microsoft.Kubernetes" +<<<<<<< HEAD class Enum1(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class Enum1(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) MANAGED_CLUSTERS = "managedClusters" CONNECTED_CLUSTERS = "connectedClusters" +<<<<<<< HEAD class InstallStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class InstallStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Status of installation of this instance of the extension. """ @@ -39,7 +75,11 @@ class InstallStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): INSTALLED = "Installed" FAILED = "Failed" +<<<<<<< HEAD class LevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class LevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Level of the status. """ @@ -47,7 +87,11 @@ class LevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): WARNING = "Warning" INFORMATION = "Information" +<<<<<<< HEAD class MessageLevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class MessageLevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Level of the message. """ @@ -55,20 +99,32 @@ class MessageLevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): WARNING = "Warning" INFORMATION = "Information" +<<<<<<< HEAD class OperatorScopeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class OperatorScopeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Scope at which the operator will be installed. """ CLUSTER = "cluster" NAMESPACE = "namespace" +<<<<<<< HEAD class OperatorType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class OperatorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Type of the operator """ FLUX = "Flux" +<<<<<<< HEAD class ProvisioningStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class ProvisioningStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """The provisioning state of the resource provider. """ @@ -78,7 +134,11 @@ class ProvisioningStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): SUCCEEDED = "Succeeded" FAILED = "Failed" +<<<<<<< HEAD class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """The type of identity used for the configuration. Type 'SystemAssigned' will use an implicitly created identity. Type 'None' will not use Managed Identity for the configuration. """ diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_extensions_operations.py index f0a15e102ca..744e72b5f15 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_extensions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_extensions_operations.py @@ -5,13 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +======= +from typing import TYPE_CHECKING +>>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -246,6 +251,19 @@ def build_list_request( headers=header_parameters, **kwargs ) +======= +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +>>>>>>> 331f997c (updating to the latest vendored sdk) class ExtensionsOperations(object): """ExtensionsOperations operations. @@ -269,6 +287,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace def create( self, @@ -280,6 +299,19 @@ def create( extension_instance: "_models.ExtensionInstance", **kwargs: Any ) -> "_models.ExtensionInstance": +======= + def create( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_instance_name, # type: str + extension_instance, # type: "_models.ExtensionInstance" + **kwargs # type: Any + ): + # type: (...) -> "_models.ExtensionInstance" +>>>>>>> 331f997c (updating to the latest vendored sdk) """Create a new Kubernetes Cluster Extension Instance. :param resource_group_name: The name of the resource group. @@ -289,15 +321,23 @@ def create( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_instance_name: Name of an instance of the Extension. :type extension_instance_name: str :param extension_instance: Properties necessary to Create an Extension Instance. +<<<<<<< HEAD :type extension_instance: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstance +======= + :type extension_instance: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstance +>>>>>>> 331f997c (updating to the latest vendored sdk) :keyword callable cls: A custom type or function that will be passed the direct response :return: ExtensionInstance, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstance @@ -308,6 +348,7 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -327,12 +368,47 @@ def create( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2020-07-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionInstanceName': self._serialize.url("extension_instance_name", extension_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(extension_instance, 'ExtensionInstance') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExtensionInstance', pipeline_response) @@ -341,6 +417,7 @@ def create( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore @@ -355,6 +432,20 @@ def get( extension_instance_name: str, **kwargs: Any ) -> "_models.ExtensionInstance": +======= + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_instance_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ExtensionInstance" +>>>>>>> 331f997c (updating to the latest vendored sdk) """Gets details of the Kubernetes Cluster Extension Instance. :param resource_group_name: The name of the resource group. @@ -364,8 +455,12 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_instance_name: Name of an instance of the Extension. @@ -380,6 +475,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -394,12 +490,42 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2020-07-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionInstanceName': self._serialize.url("extension_instance_name", extension_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExtensionInstance', pipeline_response) @@ -408,6 +534,7 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore @@ -423,6 +550,21 @@ def update( extension_instance: "_models.ExtensionInstanceUpdate", **kwargs: Any ) -> "_models.ExtensionInstance": +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_instance_name, # type: str + extension_instance, # type: "_models.ExtensionInstanceUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.ExtensionInstance" +>>>>>>> 331f997c (updating to the latest vendored sdk) """Update an existing Kubernetes Cluster Extension Instance. :param resource_group_name: The name of the resource group. @@ -432,15 +574,23 @@ def update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_instance_name: Name of an instance of the Extension. :type extension_instance_name: str :param extension_instance: Properties to Update in the Extension Instance. +<<<<<<< HEAD :type extension_instance: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstanceUpdate +======= + :type extension_instance: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstanceUpdate +>>>>>>> 331f997c (updating to the latest vendored sdk) :keyword callable cls: A custom type or function that will be passed the direct response :return: ExtensionInstance, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstance @@ -451,6 +601,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -470,12 +621,47 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2020-07-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionInstanceName': self._serialize.url("extension_instance_name", extension_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(extension_instance, 'ExtensionInstanceUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExtensionInstance', pipeline_response) @@ -484,6 +670,7 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore @@ -498,6 +685,20 @@ def delete( extension_instance_name: str, **kwargs: Any ) -> None: +======= + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_instance_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None +>>>>>>> 331f997c (updating to the latest vendored sdk) """Delete a Kubernetes Cluster Extension Instance. This will cause the Agent to Uninstall the extension instance from the cluster. @@ -508,8 +709,12 @@ def delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_instance_name: Name of an instance of the Extension. @@ -524,6 +729,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_delete_request( @@ -538,12 +744,42 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2020-07-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionInstanceName': self._serialize.url("extension_instance_name", extension_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -551,6 +787,7 @@ def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore +<<<<<<< HEAD @distributed_trace def list( @@ -561,6 +798,17 @@ def list( cluster_name: str, **kwargs: Any ) -> Iterable["_models.ExtensionInstancesList"]: +======= + def list( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ExtensionInstancesList"] +>>>>>>> 331f997c (updating to the latest vendored sdk) """List all Source Control Configurations. :param resource_group_name: The name of the resource group. @@ -570,6 +818,7 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -579,6 +828,14 @@ def list( cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstancesList] +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExtensionInstancesList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstancesList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionInstancesList"] @@ -586,6 +843,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -617,6 +875,40 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionInstancesList", pipeline_response) +======= + api_version = "2020-07-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ExtensionInstancesList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -629,13 +921,21 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_operations.py index 3e405e2ae48..01d15c71bd0 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_operations.py @@ -5,13 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +======= +from typing import TYPE_CHECKING +>>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -49,6 +54,19 @@ def build_list_request( headers=header_parameters, **kwargs ) +======= +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +>>>>>>> 331f997c (updating to the latest vendored sdk) class Operations(object): """Operations operations. @@ -72,6 +90,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace def list( self, @@ -84,6 +103,18 @@ def list( cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceProviderOperationList] +======= + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceProviderOperationList"] + """List all the available operations the KubernetesConfiguration resource provider supports. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceProviderOperationList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -91,6 +122,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -112,6 +144,32 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) +======= + api_version = "2020-07-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,13 +182,21 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_source_control_configurations_operations.py index 3a863680448..d192efa6d03 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_source_control_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_source_control_configurations_operations.py @@ -5,199 +5,25 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models -from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - -def build_get_request( - subscription_id: str, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - source_control_configuration_name: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-07-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), - "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), - "sourceControlConfigurationName": _SERIALIZER.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id: str, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - source_control_configuration_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any -) -> HttpRequest: - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2020-07-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), - "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), - "sourceControlConfigurationName": _SERIALIZER.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - json=json, - content=content, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id: str, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - source_control_configuration_name: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-07-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), - "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), - "sourceControlConfigurationName": _SERIALIZER.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_list_request( - subscription_id: str, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-07-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), - "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class SourceControlConfigurationsOperations(object): """SourceControlConfigurationsOperations operations. @@ -221,16 +47,16 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config - @distributed_trace def get( self, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - source_control_configuration_name: str, - **kwargs: Any - ) -> "_models.SourceControlConfiguration": + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + source_control_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SourceControlConfiguration" """Gets details of the Source Control Configuration. :param resource_group_name: The name of the resource group. @@ -240,16 +66,14 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or - ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) - :rtype: - ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration + :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -257,26 +81,36 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - source_control_configuration_name=source_control_configuration_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) @@ -285,21 +119,19 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - - @distributed_trace def create_or_update( self, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - source_control_configuration_name: str, - source_control_configuration: "_models.SourceControlConfiguration", - **kwargs: Any - ) -> "_models.SourceControlConfiguration": + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + source_control_configuration_name, # type: str + source_control_configuration, # type: "_models.SourceControlConfiguration" + **kwargs # type: Any + ): + # type: (...) -> "_models.SourceControlConfiguration" """Create a new Kubernetes Source Control Configuration. :param resource_group_name: The name of the resource group. @@ -309,19 +141,16 @@ def create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or - ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. - :type source_control_configuration: - ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration + :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) - :rtype: - ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration + :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -329,31 +158,41 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - source_control_configuration_name=source_control_configuration_name, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -366,61 +205,70 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - def _delete_initial( self, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - source_control_configuration_name: str, - **kwargs: Any - ) -> None: + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + source_control_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - source_control_configuration_name=source_control_configuration_name, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - - @distributed_trace def begin_delete( self, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - source_control_configuration_name: str, - **kwargs: Any - ) -> LROPoller[None]: + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + source_control_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from the source repo. @@ -431,25 +279,22 @@ def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or - ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -466,14 +311,24 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -485,18 +340,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - @distributed_trace def list( self, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - **kwargs: Any - ) -> Iterable["_models.SourceControlConfigurationList"]: + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SourceControlConfigurationList"] """List all Source Control Configurations. :param resource_group_name: The name of the resource group. @@ -506,15 +360,12 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or - ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SourceControlConfigurationList or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfigurationList] + :return: An iterator like instance of either SourceControlConfigurationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfigurationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfigurationList"] @@ -522,37 +373,38 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-07-01-preview" + accept = "application/json" + def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): - deserialized = self._deserialize("SourceControlConfigurationList", pipeline_response) + deserialized = self._deserialize('SourceControlConfigurationList', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -565,13 +417,12 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/__init__.py index e9096303633..fc12f19c5a1 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/__init__.py @@ -12,7 +12,15 @@ __version__ = VERSION __all__ = ['SourceControlConfigurationClient'] +<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() +======= +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/_configuration.py index 7167f9bec31..088f791fd39 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/_configuration.py @@ -6,16 +6,29 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +======= +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy +>>>>>>> 331f997c (updating to the latest vendored sdk) from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports +<<<<<<< HEAD +======= + from typing import Any + +>>>>>>> 331f997c (updating to the latest vendored sdk) from azure.core.credentials import TokenCredential @@ -33,15 +46,27 @@ class SourceControlConfigurationClientConfiguration(Configuration): def __init__( self, +<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, **kwargs: Any ) -> None: super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +======= + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None +>>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") +<<<<<<< HEAD +======= + super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -65,4 +90,8 @@ 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: +<<<<<<< HEAD self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) +======= + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/_source_control_configuration_client.py index 435ce16a3a2..814be3d847b 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/_source_control_configuration_client.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from copy import deepcopy from typing import Any, Optional, TYPE_CHECKING @@ -39,20 +40,66 @@ class SourceControlConfigurationClient: :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. +======= +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + 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 SourceControlConfigurationsOperations +from .operations import Operations +from . import models + + +class SourceControlConfigurationClient(object): + """KubernetesConfiguration Client. + + :ivar source_control_configurations: SourceControlConfigurationsOperations operations + :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.operations.SourceControlConfigurationsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.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). + :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. +>>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, +<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) +======= + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) +<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.source_control_configurations = SourceControlConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -84,6 +131,33 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) +======= + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + 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'), + } + 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 +>>>>>>> 331f997c (updating to the latest vendored sdk) def close(self): # type: () -> None diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/__init__.py index 5f583276b4e..5951024da8e 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/__init__.py @@ -8,8 +8,11 @@ from ._source_control_configuration_client import SourceControlConfigurationClient __all__ = ['SourceControlConfigurationClient'] +<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/_configuration.py index 2ea6b77035b..6852289c2e3 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/_configuration.py @@ -10,7 +10,11 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +<<<<<<< HEAD from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy +======= +from azure.mgmt.core.policies import ARMHttpLoggingPolicy +>>>>>>> 331f997c (updating to the latest vendored sdk) from .._version import VERSION @@ -37,11 +41,18 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: +<<<<<<< HEAD super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") +<<<<<<< HEAD +======= + super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -64,4 +75,8 @@ 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: +<<<<<<< HEAD self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) +======= + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/_source_control_configuration_client.py index 24c6800aa80..a5b1e5c640b 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/_source_control_configuration_client.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from copy import deepcopy from typing import Any, Awaitable, Optional, TYPE_CHECKING @@ -17,10 +18,19 @@ from ._configuration import SourceControlConfigurationClientConfiguration from .operations import Operations, SourceControlConfigurationsOperations +======= +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 + +>>>>>>> 331f997c (updating to the latest vendored sdk) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential +<<<<<<< HEAD class SourceControlConfigurationClient: """KubernetesConfiguration Client. @@ -39,20 +49,51 @@ class SourceControlConfigurationClient: :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. +======= +from ._configuration import SourceControlConfigurationClientConfiguration +from .operations import SourceControlConfigurationsOperations +from .operations import Operations +from .. import models + + +class SourceControlConfigurationClient(object): + """KubernetesConfiguration Client. + + :ivar source_control_configurations: SourceControlConfigurationsOperations operations + :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.aio.operations.SourceControlConfigurationsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.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). + :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. +>>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, +<<<<<<< HEAD base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) +======= + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) +<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.source_control_configurations = SourceControlConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -84,6 +125,32 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) +======= + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + 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'), + } + 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 +>>>>>>> 331f997c (updating to the latest vendored sdk) async def close(self) -> None: await self._client.close() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/operations/_operations.py index d10b2c945f2..957c662360d 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/operations/_operations.py @@ -5,13 +5,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -21,6 +25,13 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operations import build_list_request +======= +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +>>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +57,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, **kwargs: Any @@ -54,10 +68,15 @@ def list( """List all the available operations the KubernetesConfiguration resource provider supports. :keyword callable cls: A custom type or function that will be passed the direct response +<<<<<<< HEAD :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ResourceProviderOperationList] +======= + :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ResourceProviderOperationList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -65,6 +84,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -86,6 +106,32 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) +======= + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,13 +144,21 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/operations/_source_control_configurations_operations.py index 1ff137c7cc0..b71798c1df5 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/operations/_source_control_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/operations/_source_control_configurations_operations.py @@ -5,24 +5,36 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +======= +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +>>>>>>> 331f997c (updating to the latest vendored sdk) from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +<<<<<<< HEAD from ..._vendor import _convert_request from ...operations._source_control_configurations_operations import build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request +======= + +>>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +60,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace_async +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -67,16 +82,24 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) +<<<<<<< HEAD :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration +======= + :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -84,6 +107,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -98,12 +122,42 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) @@ -112,11 +166,16 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @distributed_trace_async +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) async def create_or_update( self, resource_group_name: str, @@ -136,19 +195,30 @@ async def create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. +<<<<<<< HEAD :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration +======= + :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -156,6 +226,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -175,12 +246,47 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -193,10 +299,15 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore +======= + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) async def _delete_initial( self, resource_group_name: str, @@ -211,6 +322,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_delete_request_initial( @@ -225,20 +337,54 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore +<<<<<<< HEAD @distributed_trace_async +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_delete( self, resource_group_name: str, @@ -258,14 +404,19 @@ async def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. +<<<<<<< HEAD :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -277,6 +428,17 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] +======= + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -293,14 +455,33 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) +<<<<<<< HEAD kwargs.pop('error_map', None) +======= + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) +>>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) +<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -312,10 +493,15 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @distributed_trace +======= + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -333,6 +519,7 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -342,6 +529,14 @@ def list( cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfigurationList] +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SourceControlConfigurationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfigurationList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfigurationList"] @@ -349,6 +544,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -380,6 +576,40 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("SourceControlConfigurationList", pipeline_response) +======= + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SourceControlConfigurationList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -392,13 +622,21 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/__init__.py index f851a5fd806..19fac6841ff 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/__init__.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from ._models_py3 import ComplianceStatus from ._models_py3 import ErrorDefinition from ._models_py3 import ErrorResponse @@ -20,6 +21,36 @@ from ._models_py3 import SourceControlConfigurationList from ._models_py3 import SystemData +======= +try: + from ._models_py3 import ComplianceStatus + from ._models_py3 import ErrorDefinition + from ._models_py3 import ErrorResponse + from ._models_py3 import HelmOperatorProperties + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import ResourceProviderOperation + from ._models_py3 import ResourceProviderOperationDisplay + from ._models_py3 import ResourceProviderOperationList + from ._models_py3 import Result + from ._models_py3 import SourceControlConfiguration + from ._models_py3 import SourceControlConfigurationList + from ._models_py3 import SystemData +except (SyntaxError, ImportError): + from ._models import ComplianceStatus # type: ignore + from ._models import ErrorDefinition # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import HelmOperatorProperties # type: ignore + from ._models import ProxyResource # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceProviderOperation # type: ignore + from ._models import ResourceProviderOperationDisplay # type: ignore + from ._models import ResourceProviderOperationList # type: ignore + from ._models import Result # type: ignore + from ._models import SourceControlConfiguration # type: ignore + from ._models import SourceControlConfigurationList # type: ignore + from ._models import SystemData # type: ignore +>>>>>>> 331f997c (updating to the latest vendored sdk) from ._source_control_configuration_client_enums import ( ComplianceStateType, diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_models.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_models.py new file mode 100644 index 00000000000..12ebfd16f6d --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_models.py @@ -0,0 +1,506 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class ComplianceStatus(msrest.serialization.Model): + """Compliance Status details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar compliance_state: The compliance state of the configuration. Possible values include: + "Pending", "Compliant", "Noncompliant", "Installed", "Failed". + :vartype compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ComplianceStateType + :param last_config_applied: Datetime the configuration was last applied. + :type last_config_applied: ~datetime.datetime + :param message: Message from when the configuration was applied. + :type message: str + :param message_level: Level of the message. Possible values include: "Error", "Warning", + "Information". + :type message_level: str or + ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.MessageLevelType + """ + + _validation = { + 'compliance_state': {'readonly': True}, + } + + _attribute_map = { + 'compliance_state': {'key': 'complianceState', 'type': 'str'}, + 'last_config_applied': {'key': 'lastConfigApplied', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'message_level': {'key': 'messageLevel', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ComplianceStatus, self).__init__(**kwargs) + self.compliance_state = None + self.last_config_applied = kwargs.get('last_config_applied', None) + self.message = kwargs.get('message', None) + self.message_level = kwargs.get('message_level', None) + + +class ErrorDefinition(msrest.serialization.Model): + """Error definition. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Service specific error code which serves as the substatus for the HTTP + error code. + :type code: str + :param message: Required. Description of the error. + :type message: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDefinition, self).__init__(**kwargs) + self.code = kwargs['code'] + self.message = kwargs['message'] + + +class ErrorResponse(msrest.serialization.Model): + """Error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Error definition. + :vartype error: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ErrorDefinition + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinition'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = None + + +class HelmOperatorProperties(msrest.serialization.Model): + """Properties for Helm operator. + + :param chart_version: Version of the operator Helm chart. + :type chart_version: str + :param chart_values: Values override for the operator Helm chart. + :type chart_values: str + """ + + _attribute_map = { + 'chart_version': {'key': 'chartVersion', 'type': 'str'}, + 'chart_values': {'key': 'chartValues', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HelmOperatorProperties, self).__init__(**kwargs) + self.chart_version = kwargs.get('chart_version', None) + self.chart_values = kwargs.get('chart_values', None) + + +class Resource(msrest.serialization.Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = kwargs.get('system_data', None) + + +class ProxyResource(Resource): + """ARM proxy resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class ResourceProviderOperation(msrest.serialization.Model): + """Supported operation of this resource provider. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: Operation name, in format of {provider}/{resource}/{operation}. + :type name: str + :param display: Display metadata associated with the operation. + :type display: + ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ResourceProviderOperationDisplay + :ivar is_data_action: The flag that indicates whether the operation applies to data plane. + :vartype is_data_action: bool + """ + + _validation = { + 'is_data_action': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.is_data_action = None + + +class ResourceProviderOperationDisplay(msrest.serialization.Model): + """Display metadata associated with the operation. + + :param provider: Resource provider: Microsoft KubernetesConfiguration. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class ResourceProviderOperationList(msrest.serialization.Model): + """Result of the request to list operations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: List of operations supported by this resource provider. + :type value: + list[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ResourceProviderOperation] + :ivar next_link: URL to the next set of results, if any. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperationList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class Result(msrest.serialization.Model): + """Sample result definition. + + :param sample_property: Sample property of type string. + :type sample_property: str + """ + + _attribute_map = { + 'sample_property': {'key': 'sampleProperty', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Result, self).__init__(**kwargs) + self.sample_property = kwargs.get('sample_property', None) + + +class SourceControlConfiguration(ProxyResource): + """The SourceControl Configuration object returned in Get & Put response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SystemData + :param repository_url: Url of the SourceControl Repository. + :type repository_url: str + :param operator_namespace: The namespace to which this operator is installed to. Maximum of 253 + lower case alphanumeric characters, hyphen and period only. + :type operator_namespace: str + :param operator_instance_name: Instance name of the operator - identifying the specific + configuration. + :type operator_instance_name: str + :param operator_type: Type of the operator. Possible values include: "Flux". + :type operator_type: str or + ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.OperatorType + :param operator_params: Any Parameters for the Operator instance in string format. + :type operator_params: str + :param configuration_protected_settings: Name-value pairs of protected configuration settings + for the configuration. + :type configuration_protected_settings: dict[str, str] + :param operator_scope: Scope at which the operator will be installed. Possible values include: + "cluster", "namespace". Default value: "cluster". + :type operator_scope: str or + ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.OperatorScopeType + :ivar repository_public_key: Public Key associated with this SourceControl configuration + (either generated within the cluster or provided by the user). + :vartype repository_public_key: str + :param ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys + required to access private Git instances. + :type ssh_known_hosts_contents: str + :param enable_helm_operator: Option to enable Helm Operator for this git configuration. + :type enable_helm_operator: bool + :param helm_operator_properties: Properties for Helm operator. + :type helm_operator_properties: + ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.HelmOperatorProperties + :ivar provisioning_state: The provisioning state of the resource provider. Possible values + include: "Accepted", "Deleting", "Running", "Succeeded", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ProvisioningStateType + :ivar compliance_status: Compliance Status of the Configuration. + :vartype compliance_status: + ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ComplianceStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'repository_public_key': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'compliance_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'operator_namespace': {'key': 'properties.operatorNamespace', 'type': 'str'}, + 'operator_instance_name': {'key': 'properties.operatorInstanceName', 'type': 'str'}, + 'operator_type': {'key': 'properties.operatorType', 'type': 'str'}, + 'operator_params': {'key': 'properties.operatorParams', 'type': 'str'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, + 'operator_scope': {'key': 'properties.operatorScope', 'type': 'str'}, + 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, + 'ssh_known_hosts_contents': {'key': 'properties.sshKnownHostsContents', 'type': 'str'}, + 'enable_helm_operator': {'key': 'properties.enableHelmOperator', 'type': 'bool'}, + 'helm_operator_properties': {'key': 'properties.helmOperatorProperties', 'type': 'HelmOperatorProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'compliance_status': {'key': 'properties.complianceStatus', 'type': 'ComplianceStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlConfiguration, self).__init__(**kwargs) + self.repository_url = kwargs.get('repository_url', None) + self.operator_namespace = kwargs.get('operator_namespace', "default") + self.operator_instance_name = kwargs.get('operator_instance_name', None) + self.operator_type = kwargs.get('operator_type', None) + self.operator_params = kwargs.get('operator_params', None) + self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) + self.operator_scope = kwargs.get('operator_scope', "cluster") + self.repository_public_key = None + self.ssh_known_hosts_contents = kwargs.get('ssh_known_hosts_contents', None) + self.enable_helm_operator = kwargs.get('enable_helm_operator', None) + self.helm_operator_properties = kwargs.get('helm_operator_properties', None) + self.provisioning_state = None + self.compliance_status = None + + +class SourceControlConfigurationList(msrest.serialization.Model): + """Result of the request to list Source Control Configurations. It contains a list of SourceControlConfiguration objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Source Control Configurations within a Kubernetes cluster. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration] + :ivar next_link: URL to get the next set of configuration objects, if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SourceControlConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlConfigurationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SystemData(msrest.serialization.Model): + """Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_by: A string identifier for the identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource: user, application, + managedIdentity, key. + :vartype created_by_type: str + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: A string identifier for the identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource: user, + application, managedIdentity, key. + :vartype last_modified_by_type: str + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _validation = { + 'created_by': {'readonly': True}, + 'created_by_type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'last_modified_by': {'readonly': True}, + 'last_modified_by_type': {'readonly': True}, + 'last_modified_at': {'readonly': True}, + } + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = None + self.created_by_type = None + self.created_at = None + self.last_modified_by = None + self.last_modified_by_type = None + self.last_modified_at = None diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_models_py3.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_models_py3.py index b3ea2a3dcc4..dedf54b286c 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_models_py3.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_models_py3.py @@ -24,6 +24,7 @@ class ComplianceStatus(msrest.serialization.Model): "Pending", "Compliant", "Noncompliant", "Installed", "Failed". :vartype compliance_state: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ComplianceStateType +<<<<<<< HEAD :ivar last_config_applied: Datetime the configuration was last applied. :vartype last_config_applied: ~datetime.datetime :ivar message: Message from when the configuration was applied. @@ -31,6 +32,15 @@ class ComplianceStatus(msrest.serialization.Model): :ivar message_level: Level of the message. Possible values include: "Error", "Warning", "Information". :vartype message_level: str or +======= + :param last_config_applied: Datetime the configuration was last applied. + :type last_config_applied: ~datetime.datetime + :param message: Message from when the configuration was applied. + :type message: str + :param message_level: Level of the message. Possible values include: "Error", "Warning", + "Information". + :type message_level: str or +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.MessageLevelType """ @@ -53,6 +63,7 @@ def __init__( message_level: Optional[Union[str, "MessageLevelType"]] = None, **kwargs ): +<<<<<<< HEAD """ :keyword last_config_applied: Datetime the configuration was last applied. :paramtype last_config_applied: ~datetime.datetime @@ -63,6 +74,8 @@ def __init__( :paramtype message_level: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.MessageLevelType """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ComplianceStatus, self).__init__(**kwargs) self.compliance_state = None self.last_config_applied = last_config_applied @@ -75,11 +88,19 @@ class ErrorDefinition(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. +<<<<<<< HEAD :ivar code: Required. Service specific error code which serves as the substatus for the HTTP error code. :vartype code: str :ivar message: Required. Description of the error. :vartype message: str +======= + :param code: Required. Service specific error code which serves as the substatus for the HTTP + error code. + :type code: str + :param message: Required. Description of the error. + :type message: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -99,6 +120,7 @@ def __init__( message: str, **kwargs ): +<<<<<<< HEAD """ :keyword code: Required. Service specific error code which serves as the substatus for the HTTP error code. @@ -106,6 +128,8 @@ def __init__( :keyword message: Required. Description of the error. :paramtype message: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorDefinition, self).__init__(**kwargs) self.code = code self.message = message @@ -132,8 +156,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorResponse, self).__init__(**kwargs) self.error = None @@ -141,10 +168,17 @@ def __init__( class HelmOperatorProperties(msrest.serialization.Model): """Properties for Helm operator. +<<<<<<< HEAD :ivar chart_version: Version of the operator Helm chart. :vartype chart_version: str :ivar chart_values: Values override for the operator Helm chart. :vartype chart_values: str +======= + :param chart_version: Version of the operator Helm chart. + :type chart_version: str + :param chart_values: Values override for the operator Helm chart. + :type chart_values: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -159,12 +193,15 @@ def __init__( chart_values: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword chart_version: Version of the operator Helm chart. :paramtype chart_version: str :keyword chart_values: Values override for the operator Helm chart. :paramtype chart_values: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(HelmOperatorProperties, self).__init__(**kwargs) self.chart_version = chart_version self.chart_values = chart_values @@ -181,9 +218,15 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str +<<<<<<< HEAD :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SystemData +======= + :param system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SystemData +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -205,12 +248,15 @@ def __init__( system_data: Optional["SystemData"] = None, **kwargs ): +<<<<<<< HEAD """ :keyword system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :paramtype system_data: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SystemData """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -229,9 +275,15 @@ class ProxyResource(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str +<<<<<<< HEAD :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SystemData +======= + :param system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SystemData +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -253,12 +305,15 @@ def __init__( system_data: Optional["SystemData"] = None, **kwargs ): +<<<<<<< HEAD """ :keyword system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :paramtype system_data: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SystemData """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ProxyResource, self).__init__(system_data=system_data, **kwargs) @@ -267,10 +322,17 @@ class ResourceProviderOperation(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. +<<<<<<< HEAD :ivar name: Operation name, in format of {provider}/{resource}/{operation}. :vartype name: str :ivar display: Display metadata associated with the operation. :vartype display: +======= + :param name: Operation name, in format of {provider}/{resource}/{operation}. + :type name: str + :param display: Display metadata associated with the operation. + :type display: +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ResourceProviderOperationDisplay :ivar is_data_action: The flag that indicates whether the operation applies to data plane. :vartype is_data_action: bool @@ -293,6 +355,7 @@ def __init__( display: Optional["ResourceProviderOperationDisplay"] = None, **kwargs ): +<<<<<<< HEAD """ :keyword name: Operation name, in format of {provider}/{resource}/{operation}. :paramtype name: str @@ -300,6 +363,8 @@ def __init__( :paramtype display: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ResourceProviderOperationDisplay """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperation, self).__init__(**kwargs) self.name = name self.display = display @@ -309,6 +374,7 @@ def __init__( class ResourceProviderOperationDisplay(msrest.serialization.Model): """Display metadata associated with the operation. +<<<<<<< HEAD :ivar provider: Resource provider: Microsoft KubernetesConfiguration. :vartype provider: str :ivar resource: Resource on which the operation is performed. @@ -317,6 +383,16 @@ class ResourceProviderOperationDisplay(msrest.serialization.Model): :vartype operation: str :ivar description: Description of this operation. :vartype description: str +======= + :param provider: Resource provider: Microsoft KubernetesConfiguration. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this operation. + :type description: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -335,6 +411,7 @@ def __init__( description: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword provider: Resource provider: Microsoft KubernetesConfiguration. :paramtype provider: str @@ -345,6 +422,8 @@ def __init__( :keyword description: Description of this operation. :paramtype description: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperationDisplay, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -357,8 +436,13 @@ class ResourceProviderOperationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. +<<<<<<< HEAD :ivar value: List of operations supported by this resource provider. :vartype value: +======= + :param value: List of operations supported by this resource provider. + :type value: +>>>>>>> 331f997c (updating to the latest vendored sdk) list[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ResourceProviderOperation] :ivar next_link: URL to the next set of results, if any. :vartype next_link: str @@ -379,11 +463,14 @@ def __init__( value: Optional[List["ResourceProviderOperation"]] = None, **kwargs ): +<<<<<<< HEAD """ :keyword value: List of operations supported by this resource provider. :paramtype value: list[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ResourceProviderOperation] """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperationList, self).__init__(**kwargs) self.value = value self.next_link = None @@ -392,8 +479,13 @@ def __init__( class Result(msrest.serialization.Model): """Sample result definition. +<<<<<<< HEAD :ivar sample_property: Sample property of type string. :vartype sample_property: str +======= + :param sample_property: Sample property of type string. + :type sample_property: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -406,10 +498,13 @@ def __init__( sample_property: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword sample_property: Sample property of type string. :paramtype sample_property: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(Result, self).__init__(**kwargs) self.sample_property = sample_property @@ -425,6 +520,7 @@ class SourceControlConfiguration(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str +<<<<<<< HEAD :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SystemData @@ -447,10 +543,35 @@ class SourceControlConfiguration(ProxyResource): :ivar operator_scope: Scope at which the operator will be installed. Possible values include: "cluster", "namespace". Default value: "cluster". :vartype operator_scope: str or +======= + :param system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SystemData + :param repository_url: Url of the SourceControl Repository. + :type repository_url: str + :param operator_namespace: The namespace to which this operator is installed to. Maximum of 253 + lower case alphanumeric characters, hyphen and period only. + :type operator_namespace: str + :param operator_instance_name: Instance name of the operator - identifying the specific + configuration. + :type operator_instance_name: str + :param operator_type: Type of the operator. Possible values include: "Flux". + :type operator_type: str or + ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.OperatorType + :param operator_params: Any Parameters for the Operator instance in string format. + :type operator_params: str + :param configuration_protected_settings: Name-value pairs of protected configuration settings + for the configuration. + :type configuration_protected_settings: dict[str, str] + :param operator_scope: Scope at which the operator will be installed. Possible values include: + "cluster", "namespace". Default value: "cluster". + :type operator_scope: str or +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.OperatorScopeType :ivar repository_public_key: Public Key associated with this SourceControl configuration (either generated within the cluster or provided by the user). :vartype repository_public_key: str +<<<<<<< HEAD :ivar ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys required to access private Git instances. :vartype ssh_known_hosts_contents: str @@ -458,6 +579,15 @@ class SourceControlConfiguration(ProxyResource): :vartype enable_helm_operator: bool :ivar helm_operator_properties: Properties for Helm operator. :vartype helm_operator_properties: +======= + :param ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys + required to access private Git instances. + :type ssh_known_hosts_contents: str + :param enable_helm_operator: Option to enable Helm Operator for this git configuration. + :type enable_helm_operator: bool + :param helm_operator_properties: Properties for Helm operator. + :type helm_operator_properties: +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.HelmOperatorProperties :ivar provisioning_state: The provisioning state of the resource provider. Possible values include: "Accepted", "Deleting", "Running", "Succeeded", "Failed". @@ -513,6 +643,7 @@ def __init__( helm_operator_properties: Optional["HelmOperatorProperties"] = None, **kwargs ): +<<<<<<< HEAD """ :keyword system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. @@ -547,6 +678,8 @@ def __init__( :paramtype helm_operator_properties: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.HelmOperatorProperties """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(SourceControlConfiguration, self).__init__(system_data=system_data, **kwargs) self.repository_url = repository_url self.operator_namespace = operator_namespace @@ -589,8 +722,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(SourceControlConfigurationList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -639,8 +775,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(SystemData, self).__init__(**kwargs) self.created_by = None self.created_by_type = None diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_source_control_configuration_client_enums.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_source_control_configuration_client_enums.py index f15af9df3a0..48b2b93d6d8 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_source_control_configuration_client_enums.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_source_control_configuration_client_enums.py @@ -6,12 +6,36 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from enum import Enum from six import with_metaclass from azure.core import CaseInsensitiveEnumMeta class ComplianceStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class ComplianceStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """The compliance state of the configuration. """ @@ -21,17 +45,29 @@ class ComplianceStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): INSTALLED = "Installed" FAILED = "Failed" +<<<<<<< HEAD class Enum0(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class Enum0(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) MICROSOFT_CONTAINER_SERVICE = "Microsoft.ContainerService" MICROSOFT_KUBERNETES = "Microsoft.Kubernetes" +<<<<<<< HEAD class Enum1(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class Enum1(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) MANAGED_CLUSTERS = "managedClusters" CONNECTED_CLUSTERS = "connectedClusters" +<<<<<<< HEAD class MessageLevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class MessageLevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Level of the message. """ @@ -39,20 +75,32 @@ class MessageLevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): WARNING = "Warning" INFORMATION = "Information" +<<<<<<< HEAD class OperatorScopeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class OperatorScopeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Scope at which the operator will be installed. """ CLUSTER = "cluster" NAMESPACE = "namespace" +<<<<<<< HEAD class OperatorType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class OperatorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Type of the operator """ FLUX = "Flux" +<<<<<<< HEAD class ProvisioningStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class ProvisioningStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """The provisioning state of the resource provider. """ diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/operations/_operations.py index 04f675b2f5e..bec332a7d13 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/operations/_operations.py @@ -5,13 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +======= +from typing import TYPE_CHECKING +>>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -49,6 +54,19 @@ def build_list_request( headers=header_parameters, **kwargs ) +======= +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +>>>>>>> 331f997c (updating to the latest vendored sdk) class Operations(object): """Operations operations. @@ -72,6 +90,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace def list( self, @@ -84,6 +103,18 @@ def list( cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ResourceProviderOperationList] +======= + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceProviderOperationList"] + """List all the available operations the KubernetesConfiguration resource provider supports. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ResourceProviderOperationList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -91,6 +122,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -112,6 +144,32 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) +======= + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,13 +182,21 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/operations/_source_control_configurations_operations.py index 8eebc483790..5593b374bff 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/operations/_source_control_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/operations/_source_control_configurations_operations.py @@ -5,13 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +======= +from typing import TYPE_CHECKING +>>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest @@ -198,6 +203,21 @@ def build_list_request( headers=header_parameters, **kwargs ) +======= +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +>>>>>>> 331f997c (updating to the latest vendored sdk) class SourceControlConfigurationsOperations(object): """SourceControlConfigurationsOperations operations. @@ -221,6 +241,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace def get( self, @@ -231,6 +252,18 @@ def get( source_control_configuration_name: str, **kwargs: Any ) -> "_models.SourceControlConfiguration": +======= + def get( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + source_control_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SourceControlConfiguration" +>>>>>>> 331f997c (updating to the latest vendored sdk) """Gets details of the Source Control Configuration. :param resource_group_name: The name of the resource group. @@ -240,16 +273,24 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) +<<<<<<< HEAD :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration +======= + :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -257,6 +298,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -271,12 +313,42 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) @@ -285,6 +357,7 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -300,6 +373,21 @@ def create_or_update( source_control_configuration: "_models.SourceControlConfiguration", **kwargs: Any ) -> "_models.SourceControlConfiguration": +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + source_control_configuration_name, # type: str + source_control_configuration, # type: "_models.SourceControlConfiguration" + **kwargs # type: Any + ): + # type: (...) -> "_models.SourceControlConfiguration" +>>>>>>> 331f997c (updating to the latest vendored sdk) """Create a new Kubernetes Source Control Configuration. :param resource_group_name: The name of the resource group. @@ -309,19 +397,30 @@ def create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. +<<<<<<< HEAD :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration +======= + :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -329,6 +428,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -348,12 +448,47 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2020-10-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -366,6 +501,7 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -379,11 +515,26 @@ def _delete_initial( source_control_configuration_name: str, **kwargs: Any ) -> None: +======= + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + source_control_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_delete_request_initial( @@ -398,18 +549,50 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2020-10-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore +<<<<<<< HEAD @distributed_trace def begin_delete( @@ -421,6 +604,18 @@ def begin_delete( source_control_configuration_name: str, **kwargs: Any ) -> LROPoller[None]: +======= + def begin_delete( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + source_control_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] +>>>>>>> 331f997c (updating to the latest vendored sdk) """This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from the source repo. @@ -431,14 +626,19 @@ def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. +<<<<<<< HEAD :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -450,6 +650,17 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] +======= + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -466,14 +677,33 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) +<<<<<<< HEAD kwargs.pop('error_map', None) +======= + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) +>>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) +<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -485,6 +715,7 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -497,6 +728,19 @@ def list( cluster_name: str, **kwargs: Any ) -> Iterable["_models.SourceControlConfigurationList"]: +======= + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SourceControlConfigurationList"] +>>>>>>> 331f997c (updating to the latest vendored sdk) """List all Source Control Configurations. :param resource_group_name: The name of the resource group. @@ -506,6 +750,7 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -515,6 +760,14 @@ def list( cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfigurationList] +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SourceControlConfigurationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfigurationList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfigurationList"] @@ -522,6 +775,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -553,6 +807,40 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("SourceControlConfigurationList", pipeline_response) +======= + api_version = "2020-10-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SourceControlConfigurationList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -565,13 +853,21 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/__init__.py index e9096303633..fc12f19c5a1 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/__init__.py @@ -12,7 +12,15 @@ __version__ = VERSION __all__ = ['SourceControlConfigurationClient'] +<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() +======= +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/_configuration.py index d1e0dc4fffe..c438a8ccff7 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/_configuration.py @@ -6,16 +6,29 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +======= +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy +>>>>>>> 331f997c (updating to the latest vendored sdk) from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports +<<<<<<< HEAD +======= + from typing import Any + +>>>>>>> 331f997c (updating to the latest vendored sdk) from azure.core.credentials import TokenCredential @@ -33,15 +46,27 @@ class SourceControlConfigurationClientConfiguration(Configuration): def __init__( self, +<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, **kwargs: Any ) -> None: super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +======= + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None +>>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") +<<<<<<< HEAD +======= + super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -65,4 +90,8 @@ 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: +<<<<<<< HEAD self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) +======= + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/_source_control_configuration_client.py index d88edd7b180..d67db32db0a 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/_source_control_configuration_client.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from copy import deepcopy from typing import Any, Optional, TYPE_CHECKING @@ -27,10 +28,36 @@ class SourceControlConfigurationClient: :ivar source_control_configurations: SourceControlConfigurationsOperations operations :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2021_03_01.operations.SourceControlConfigurationsOperations +======= +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + 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 SourceControlConfigurationsOperations +from .operations import Operations +from . import models + + +class SourceControlConfigurationClient(object): + """KubernetesConfiguration Client. + + :ivar source_control_configurations: SourceControlConfigurationsOperations operations + :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2021_03_01.operations.SourceControlConfigurationsOperations +>>>>>>> 331f997c (updating to the latest vendored sdk) :ivar operations: Operations operations :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_03_01.operations.Operations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential +<<<<<<< HEAD :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). :type subscription_id: str @@ -38,20 +65,39 @@ class SourceControlConfigurationClient: :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. +======= + :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :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. +>>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, +<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) +======= + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) +<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.source_control_configurations = SourceControlConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -83,6 +129,33 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) +======= + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + 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'), + } + 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 +>>>>>>> 331f997c (updating to the latest vendored sdk) def close(self): # type: () -> None diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/__init__.py index 5f583276b4e..5951024da8e 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/__init__.py @@ -8,8 +8,11 @@ from ._source_control_configuration_client import SourceControlConfigurationClient __all__ = ['SourceControlConfigurationClient'] +<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/_configuration.py index 6e8d28ce1ac..abec5d981db 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/_configuration.py @@ -10,7 +10,11 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +<<<<<<< HEAD from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy +======= +from azure.mgmt.core.policies import ARMHttpLoggingPolicy +>>>>>>> 331f997c (updating to the latest vendored sdk) from .._version import VERSION @@ -37,11 +41,18 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: +<<<<<<< HEAD super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") +<<<<<<< HEAD +======= + super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -64,4 +75,8 @@ 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: +<<<<<<< HEAD self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) +======= + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/_source_control_configuration_client.py index ebbe4381c95..550afee6397 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/_source_control_configuration_client.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from copy import deepcopy from typing import Any, Awaitable, Optional, TYPE_CHECKING @@ -17,20 +18,43 @@ from ._configuration import SourceControlConfigurationClientConfiguration from .operations import Operations, SourceControlConfigurationsOperations +======= +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 + +>>>>>>> 331f997c (updating to the latest vendored sdk) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential +<<<<<<< HEAD class SourceControlConfigurationClient: """KubernetesConfiguration Client. :ivar source_control_configurations: SourceControlConfigurationsOperations operations :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2021_03_01.aio.operations.SourceControlConfigurationsOperations +======= +from ._configuration import SourceControlConfigurationClientConfiguration +from .operations import SourceControlConfigurationsOperations +from .operations import Operations +from .. import models + + +class SourceControlConfigurationClient(object): + """KubernetesConfiguration Client. + + :ivar source_control_configurations: SourceControlConfigurationsOperations operations + :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2021_03_01.aio.operations.SourceControlConfigurationsOperations +>>>>>>> 331f997c (updating to the latest vendored sdk) :ivar operations: Operations operations :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_03_01.aio.operations.Operations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential +<<<<<<< HEAD :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). :type subscription_id: str @@ -38,20 +62,36 @@ class SourceControlConfigurationClient: :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. +======= + :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :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. +>>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, +<<<<<<< HEAD base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) +======= + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) +<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.source_control_configurations = SourceControlConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -83,6 +123,32 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) +======= + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + 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'), + } + 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 +>>>>>>> 331f997c (updating to the latest vendored sdk) async def close(self) -> None: await self._client.close() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/operations/_operations.py index ced61c24199..e831c28485c 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/operations/_operations.py @@ -5,13 +5,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -21,6 +25,13 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operations import build_list_request +======= +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +>>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +57,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, **kwargs: Any @@ -54,10 +68,15 @@ def list( """List all the available operations the KubernetesConfiguration resource provider supports. :keyword callable cls: A custom type or function that will be passed the direct response +<<<<<<< HEAD :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ResourceProviderOperationList] +======= + :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ResourceProviderOperationList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -65,6 +84,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -86,6 +106,32 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) +======= + api_version = "2021-03-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,13 +144,21 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/operations/_source_control_configurations_operations.py index 8ca4a2f361a..a24f403d844 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/operations/_source_control_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/operations/_source_control_configurations_operations.py @@ -5,24 +5,36 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +======= +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +>>>>>>> 331f997c (updating to the latest vendored sdk) from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +<<<<<<< HEAD from ..._vendor import _convert_request from ...operations._source_control_configurations_operations import build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request +======= + +>>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +60,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace_async +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -67,8 +82,12 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. @@ -83,6 +102,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -97,12 +117,42 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-03-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) @@ -111,11 +161,16 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @distributed_trace_async +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) async def create_or_update( self, resource_group_name: str, @@ -135,15 +190,23 @@ async def create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. +<<<<<<< HEAD :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SourceControlConfiguration +======= + :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SourceControlConfiguration +>>>>>>> 331f997c (updating to the latest vendored sdk) :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SourceControlConfiguration @@ -154,6 +217,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -173,12 +237,47 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-03-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -191,10 +290,15 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore +======= + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) async def _delete_initial( self, resource_group_name: str, @@ -209,6 +313,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_delete_request_initial( @@ -223,20 +328,54 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-03-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore +<<<<<<< HEAD @distributed_trace_async +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_delete( self, resource_group_name: str, @@ -256,14 +395,19 @@ async def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. +<<<<<<< HEAD :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -275,6 +419,17 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] +======= + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -291,14 +446,33 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) +<<<<<<< HEAD + kwargs.pop('error_map', None) +======= + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) +>>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) +<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -310,10 +484,15 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @distributed_trace +======= + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -331,6 +510,7 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -340,6 +520,14 @@ def list( cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SourceControlConfigurationList] +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SourceControlConfigurationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SourceControlConfigurationList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfigurationList"] @@ -347,6 +535,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -378,6 +567,40 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("SourceControlConfigurationList", pipeline_response) +======= + api_version = "2021-03-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SourceControlConfigurationList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -390,13 +613,21 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/__init__.py index ec901c15835..d86f79d26e0 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/__init__.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from ._models_py3 import ComplianceStatus from ._models_py3 import ErrorDefinition from ._models_py3 import ErrorResponse @@ -20,6 +21,36 @@ from ._models_py3 import SourceControlConfigurationList from ._models_py3 import SystemData +======= +try: + from ._models_py3 import ComplianceStatus + from ._models_py3 import ErrorDefinition + from ._models_py3 import ErrorResponse + from ._models_py3 import HelmOperatorProperties + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import ResourceProviderOperation + from ._models_py3 import ResourceProviderOperationDisplay + from ._models_py3 import ResourceProviderOperationList + from ._models_py3 import Result + from ._models_py3 import SourceControlConfiguration + from ._models_py3 import SourceControlConfigurationList + from ._models_py3 import SystemData +except (SyntaxError, ImportError): + from ._models import ComplianceStatus # type: ignore + from ._models import ErrorDefinition # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import HelmOperatorProperties # type: ignore + from ._models import ProxyResource # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceProviderOperation # type: ignore + from ._models import ResourceProviderOperationDisplay # type: ignore + from ._models import ResourceProviderOperationList # type: ignore + from ._models import Result # type: ignore + from ._models import SourceControlConfiguration # type: ignore + from ._models import SourceControlConfigurationList # type: ignore + from ._models import SystemData # type: ignore +>>>>>>> 331f997c (updating to the latest vendored sdk) from ._source_control_configuration_client_enums import ( ComplianceStateType, diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_models.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_models.py new file mode 100644 index 00000000000..00bd900ea10 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_models.py @@ -0,0 +1,495 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class ComplianceStatus(msrest.serialization.Model): + """Compliance Status details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar compliance_state: The compliance state of the configuration. Possible values include: + "Pending", "Compliant", "Noncompliant", "Installed", "Failed". + :vartype compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ComplianceStateType + :param last_config_applied: Datetime the configuration was last applied. + :type last_config_applied: ~datetime.datetime + :param message: Message from when the configuration was applied. + :type message: str + :param message_level: Level of the message. Possible values include: "Error", "Warning", + "Information". + :type message_level: str or + ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.MessageLevelType + """ + + _validation = { + 'compliance_state': {'readonly': True}, + } + + _attribute_map = { + 'compliance_state': {'key': 'complianceState', 'type': 'str'}, + 'last_config_applied': {'key': 'lastConfigApplied', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'message_level': {'key': 'messageLevel', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ComplianceStatus, self).__init__(**kwargs) + self.compliance_state = None + self.last_config_applied = kwargs.get('last_config_applied', None) + self.message = kwargs.get('message', None) + self.message_level = kwargs.get('message_level', None) + + +class ErrorDefinition(msrest.serialization.Model): + """Error definition. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Service specific error code which serves as the substatus for the HTTP + error code. + :type code: str + :param message: Required. Description of the error. + :type message: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDefinition, self).__init__(**kwargs) + self.code = kwargs['code'] + self.message = kwargs['message'] + + +class ErrorResponse(msrest.serialization.Model): + """Error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Error definition. + :vartype error: ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ErrorDefinition + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinition'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = None + + +class HelmOperatorProperties(msrest.serialization.Model): + """Properties for Helm operator. + + :param chart_version: Version of the operator Helm chart. + :type chart_version: str + :param chart_values: Values override for the operator Helm chart. + :type chart_values: str + """ + + _attribute_map = { + 'chart_version': {'key': 'chartVersion', 'type': 'str'}, + 'chart_values': {'key': 'chartValues', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HelmOperatorProperties, self).__init__(**kwargs) + self.chart_version = kwargs.get('chart_version', None) + self.chart_values = kwargs.get('chart_values', None) + + +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class ResourceProviderOperation(msrest.serialization.Model): + """Supported operation of this resource provider. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: Operation name, in format of {provider}/{resource}/{operation}. + :type name: str + :param display: Display metadata associated with the operation. + :type display: + ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ResourceProviderOperationDisplay + :ivar is_data_action: The flag that indicates whether the operation applies to data plane. + :vartype is_data_action: bool + """ + + _validation = { + 'is_data_action': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.is_data_action = None + + +class ResourceProviderOperationDisplay(msrest.serialization.Model): + """Display metadata associated with the operation. + + :param provider: Resource provider: Microsoft KubernetesConfiguration. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class ResourceProviderOperationList(msrest.serialization.Model): + """Result of the request to list operations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: List of operations supported by this resource provider. + :type value: + list[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ResourceProviderOperation] + :ivar next_link: URL to the next set of results, if any. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperationList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class Result(msrest.serialization.Model): + """Sample result definition. + + :param sample_property: Sample property of type string. + :type sample_property: str + """ + + _attribute_map = { + 'sample_property': {'key': 'sampleProperty', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Result, self).__init__(**kwargs) + self.sample_property = kwargs.get('sample_property', None) + + +class SourceControlConfiguration(ProxyResource): + """The SourceControl Configuration object returned in Get & Put response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SystemData + :param repository_url: Url of the SourceControl Repository. + :type repository_url: str + :param operator_namespace: The namespace to which this operator is installed to. Maximum of 253 + lower case alphanumeric characters, hyphen and period only. + :type operator_namespace: str + :param operator_instance_name: Instance name of the operator - identifying the specific + configuration. + :type operator_instance_name: str + :param operator_type: Type of the operator. Possible values include: "Flux". + :type operator_type: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.OperatorType + :param operator_params: Any Parameters for the Operator instance in string format. + :type operator_params: str + :param configuration_protected_settings: Name-value pairs of protected configuration settings + for the configuration. + :type configuration_protected_settings: dict[str, str] + :param operator_scope: Scope at which the operator will be installed. Possible values include: + "cluster", "namespace". Default value: "cluster". + :type operator_scope: str or + ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.OperatorScopeType + :ivar repository_public_key: Public Key associated with this SourceControl configuration + (either generated within the cluster or provided by the user). + :vartype repository_public_key: str + :param ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys + required to access private Git instances. + :type ssh_known_hosts_contents: str + :param enable_helm_operator: Option to enable Helm Operator for this git configuration. + :type enable_helm_operator: bool + :param helm_operator_properties: Properties for Helm operator. + :type helm_operator_properties: + ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.HelmOperatorProperties + :ivar provisioning_state: The provisioning state of the resource provider. Possible values + include: "Accepted", "Deleting", "Running", "Succeeded", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ProvisioningStateType + :ivar compliance_status: Compliance Status of the Configuration. + :vartype compliance_status: + ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ComplianceStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'repository_public_key': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'compliance_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'operator_namespace': {'key': 'properties.operatorNamespace', 'type': 'str'}, + 'operator_instance_name': {'key': 'properties.operatorInstanceName', 'type': 'str'}, + 'operator_type': {'key': 'properties.operatorType', 'type': 'str'}, + 'operator_params': {'key': 'properties.operatorParams', 'type': 'str'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, + 'operator_scope': {'key': 'properties.operatorScope', 'type': 'str'}, + 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, + 'ssh_known_hosts_contents': {'key': 'properties.sshKnownHostsContents', 'type': 'str'}, + 'enable_helm_operator': {'key': 'properties.enableHelmOperator', 'type': 'bool'}, + 'helm_operator_properties': {'key': 'properties.helmOperatorProperties', 'type': 'HelmOperatorProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'compliance_status': {'key': 'properties.complianceStatus', 'type': 'ComplianceStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlConfiguration, self).__init__(**kwargs) + self.system_data = None + self.repository_url = kwargs.get('repository_url', None) + self.operator_namespace = kwargs.get('operator_namespace', "default") + self.operator_instance_name = kwargs.get('operator_instance_name', None) + self.operator_type = kwargs.get('operator_type', None) + self.operator_params = kwargs.get('operator_params', None) + self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) + self.operator_scope = kwargs.get('operator_scope', "cluster") + self.repository_public_key = None + self.ssh_known_hosts_contents = kwargs.get('ssh_known_hosts_contents', None) + self.enable_helm_operator = kwargs.get('enable_helm_operator', None) + self.helm_operator_properties = kwargs.get('helm_operator_properties', None) + self.provisioning_state = None + self.compliance_status = None + + +class SourceControlConfigurationList(msrest.serialization.Model): + """Result of the request to list Source Control Configurations. It contains a list of SourceControlConfiguration objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Source Control Configurations within a Kubernetes cluster. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SourceControlConfiguration] + :ivar next_link: URL to get the next set of configuration objects, if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SourceControlConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlConfigurationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_models_py3.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_models_py3.py index fb21995b82b..4f62c3a00f4 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_models_py3.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_models_py3.py @@ -24,6 +24,7 @@ class ComplianceStatus(msrest.serialization.Model): "Pending", "Compliant", "Noncompliant", "Installed", "Failed". :vartype compliance_state: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ComplianceStateType +<<<<<<< HEAD :ivar last_config_applied: Datetime the configuration was last applied. :vartype last_config_applied: ~datetime.datetime :ivar message: Message from when the configuration was applied. @@ -31,6 +32,15 @@ class ComplianceStatus(msrest.serialization.Model): :ivar message_level: Level of the message. Possible values include: "Error", "Warning", "Information". :vartype message_level: str or +======= + :param last_config_applied: Datetime the configuration was last applied. + :type last_config_applied: ~datetime.datetime + :param message: Message from when the configuration was applied. + :type message: str + :param message_level: Level of the message. Possible values include: "Error", "Warning", + "Information". + :type message_level: str or +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.MessageLevelType """ @@ -53,6 +63,7 @@ def __init__( message_level: Optional[Union[str, "MessageLevelType"]] = None, **kwargs ): +<<<<<<< HEAD """ :keyword last_config_applied: Datetime the configuration was last applied. :paramtype last_config_applied: ~datetime.datetime @@ -63,6 +74,8 @@ def __init__( :paramtype message_level: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.MessageLevelType """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ComplianceStatus, self).__init__(**kwargs) self.compliance_state = None self.last_config_applied = last_config_applied @@ -75,11 +88,19 @@ class ErrorDefinition(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. +<<<<<<< HEAD :ivar code: Required. Service specific error code which serves as the substatus for the HTTP error code. :vartype code: str :ivar message: Required. Description of the error. :vartype message: str +======= + :param code: Required. Service specific error code which serves as the substatus for the HTTP + error code. + :type code: str + :param message: Required. Description of the error. + :type message: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -99,6 +120,7 @@ def __init__( message: str, **kwargs ): +<<<<<<< HEAD """ :keyword code: Required. Service specific error code which serves as the substatus for the HTTP error code. @@ -106,6 +128,8 @@ def __init__( :keyword message: Required. Description of the error. :paramtype message: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorDefinition, self).__init__(**kwargs) self.code = code self.message = message @@ -132,8 +156,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorResponse, self).__init__(**kwargs) self.error = None @@ -141,10 +168,17 @@ def __init__( class HelmOperatorProperties(msrest.serialization.Model): """Properties for Helm operator. +<<<<<<< HEAD :ivar chart_version: Version of the operator Helm chart. :vartype chart_version: str :ivar chart_values: Values override for the operator Helm chart. :vartype chart_values: str +======= + :param chart_version: Version of the operator Helm chart. + :type chart_version: str + :param chart_values: Values override for the operator Helm chart. + :type chart_values: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -159,12 +193,15 @@ def __init__( chart_values: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword chart_version: Version of the operator Helm chart. :paramtype chart_version: str :keyword chart_values: Values override for the operator Helm chart. :paramtype chart_values: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(HelmOperatorProperties, self).__init__(**kwargs) self.chart_version = chart_version self.chart_values = chart_values @@ -201,8 +238,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -240,8 +280,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ProxyResource, self).__init__(**kwargs) @@ -250,10 +293,17 @@ class ResourceProviderOperation(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. +<<<<<<< HEAD :ivar name: Operation name, in format of {provider}/{resource}/{operation}. :vartype name: str :ivar display: Display metadata associated with the operation. :vartype display: +======= + :param name: Operation name, in format of {provider}/{resource}/{operation}. + :type name: str + :param display: Display metadata associated with the operation. + :type display: +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ResourceProviderOperationDisplay :ivar is_data_action: The flag that indicates whether the operation applies to data plane. :vartype is_data_action: bool @@ -276,6 +326,7 @@ def __init__( display: Optional["ResourceProviderOperationDisplay"] = None, **kwargs ): +<<<<<<< HEAD """ :keyword name: Operation name, in format of {provider}/{resource}/{operation}. :paramtype name: str @@ -283,6 +334,8 @@ def __init__( :paramtype display: ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ResourceProviderOperationDisplay """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperation, self).__init__(**kwargs) self.name = name self.display = display @@ -292,6 +345,7 @@ def __init__( class ResourceProviderOperationDisplay(msrest.serialization.Model): """Display metadata associated with the operation. +<<<<<<< HEAD :ivar provider: Resource provider: Microsoft KubernetesConfiguration. :vartype provider: str :ivar resource: Resource on which the operation is performed. @@ -300,6 +354,16 @@ class ResourceProviderOperationDisplay(msrest.serialization.Model): :vartype operation: str :ivar description: Description of this operation. :vartype description: str +======= + :param provider: Resource provider: Microsoft KubernetesConfiguration. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this operation. + :type description: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -318,6 +382,7 @@ def __init__( description: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword provider: Resource provider: Microsoft KubernetesConfiguration. :paramtype provider: str @@ -328,6 +393,8 @@ def __init__( :keyword description: Description of this operation. :paramtype description: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperationDisplay, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -340,8 +407,13 @@ class ResourceProviderOperationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. +<<<<<<< HEAD :ivar value: List of operations supported by this resource provider. :vartype value: +======= + :param value: List of operations supported by this resource provider. + :type value: +>>>>>>> 331f997c (updating to the latest vendored sdk) list[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ResourceProviderOperation] :ivar next_link: URL to the next set of results, if any. :vartype next_link: str @@ -362,11 +434,14 @@ def __init__( value: Optional[List["ResourceProviderOperation"]] = None, **kwargs ): +<<<<<<< HEAD """ :keyword value: List of operations supported by this resource provider. :paramtype value: list[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ResourceProviderOperation] """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperationList, self).__init__(**kwargs) self.value = value self.next_link = None @@ -375,8 +450,13 @@ def __init__( class Result(msrest.serialization.Model): """Sample result definition. +<<<<<<< HEAD :ivar sample_property: Sample property of type string. :vartype sample_property: str +======= + :param sample_property: Sample property of type string. + :type sample_property: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -389,10 +469,13 @@ def __init__( sample_property: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword sample_property: Sample property of type string. :paramtype sample_property: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(Result, self).__init__(**kwargs) self.sample_property = sample_property @@ -413,6 +496,7 @@ class SourceControlConfiguration(ProxyResource): :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SystemData +<<<<<<< HEAD :ivar repository_url: Url of the SourceControl Repository. :vartype repository_url: str :ivar operator_namespace: The namespace to which this operator is installed to. Maximum of 253 @@ -432,10 +516,31 @@ class SourceControlConfiguration(ProxyResource): :ivar operator_scope: Scope at which the operator will be installed. Possible values include: "cluster", "namespace". Default value: "cluster". :vartype operator_scope: str or +======= + :param repository_url: Url of the SourceControl Repository. + :type repository_url: str + :param operator_namespace: The namespace to which this operator is installed to. Maximum of 253 + lower case alphanumeric characters, hyphen and period only. + :type operator_namespace: str + :param operator_instance_name: Instance name of the operator - identifying the specific + configuration. + :type operator_instance_name: str + :param operator_type: Type of the operator. Possible values include: "Flux". + :type operator_type: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.OperatorType + :param operator_params: Any Parameters for the Operator instance in string format. + :type operator_params: str + :param configuration_protected_settings: Name-value pairs of protected configuration settings + for the configuration. + :type configuration_protected_settings: dict[str, str] + :param operator_scope: Scope at which the operator will be installed. Possible values include: + "cluster", "namespace". Default value: "cluster". + :type operator_scope: str or +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.OperatorScopeType :ivar repository_public_key: Public Key associated with this SourceControl configuration (either generated within the cluster or provided by the user). :vartype repository_public_key: str +<<<<<<< HEAD :ivar ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys required to access private Git instances. :vartype ssh_known_hosts_contents: str @@ -443,6 +548,15 @@ class SourceControlConfiguration(ProxyResource): :vartype enable_helm_operator: bool :ivar helm_operator_properties: Properties for Helm operator. :vartype helm_operator_properties: +======= + :param ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys + required to access private Git instances. + :type ssh_known_hosts_contents: str + :param enable_helm_operator: Option to enable Helm Operator for this git configuration. + :type enable_helm_operator: bool + :param helm_operator_properties: Properties for Helm operator. + :type helm_operator_properties: +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.HelmOperatorProperties :ivar provisioning_state: The provisioning state of the resource provider. Possible values include: "Accepted", "Deleting", "Running", "Succeeded", "Failed". @@ -498,6 +612,7 @@ def __init__( helm_operator_properties: Optional["HelmOperatorProperties"] = None, **kwargs ): +<<<<<<< HEAD """ :keyword repository_url: Url of the SourceControl Repository. :paramtype repository_url: str @@ -528,6 +643,8 @@ def __init__( :paramtype helm_operator_properties: ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.HelmOperatorProperties """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(SourceControlConfiguration, self).__init__(**kwargs) self.system_data = None self.repository_url = repository_url @@ -571,8 +688,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(SourceControlConfigurationList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -581,6 +701,7 @@ def __init__( class SystemData(msrest.serialization.Model): """Metadata pertaining to creation and last modification of the resource. +<<<<<<< HEAD :ivar created_by: The identity that created the resource. :vartype created_by: str :ivar created_by_type: The type of identity that created the resource. Possible values include: @@ -597,6 +718,24 @@ class SystemData(msrest.serialization.Model): ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.CreatedByType :ivar last_modified_at: The timestamp of resource last modification (UTC). :vartype last_modified_at: ~datetime.datetime +======= + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -619,6 +758,7 @@ def __init__( last_modified_at: Optional[datetime.datetime] = None, **kwargs ): +<<<<<<< HEAD """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -637,6 +777,8 @@ def __init__( :keyword last_modified_at: The timestamp of resource last modification (UTC). :paramtype last_modified_at: ~datetime.datetime """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(SystemData, self).__init__(**kwargs) self.created_by = created_by self.created_by_type = created_by_type diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_source_control_configuration_client_enums.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_source_control_configuration_client_enums.py index 68b551afcbe..1fa1a3dbb51 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_source_control_configuration_client_enums.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_source_control_configuration_client_enums.py @@ -6,12 +6,36 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from enum import Enum from six import with_metaclass from azure.core import CaseInsensitiveEnumMeta class ComplianceStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class ComplianceStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """The compliance state of the configuration. """ @@ -21,7 +45,11 @@ class ComplianceStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): INSTALLED = "Installed" FAILED = "Failed" +<<<<<<< HEAD class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """The type of identity that created the resource. """ @@ -30,17 +58,29 @@ class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" +<<<<<<< HEAD class Enum0(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class Enum0(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) MICROSOFT_CONTAINER_SERVICE = "Microsoft.ContainerService" MICROSOFT_KUBERNETES = "Microsoft.Kubernetes" +<<<<<<< HEAD class Enum1(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class Enum1(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) MANAGED_CLUSTERS = "managedClusters" CONNECTED_CLUSTERS = "connectedClusters" +<<<<<<< HEAD class MessageLevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class MessageLevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Level of the message. """ @@ -48,20 +88,32 @@ class MessageLevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): WARNING = "Warning" INFORMATION = "Information" +<<<<<<< HEAD class OperatorScopeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class OperatorScopeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Scope at which the operator will be installed. """ CLUSTER = "cluster" NAMESPACE = "namespace" +<<<<<<< HEAD class OperatorType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class OperatorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Type of the operator """ FLUX = "Flux" +<<<<<<< HEAD class ProvisioningStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class ProvisioningStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """The provisioning state of the resource provider. """ diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/operations/_operations.py index 284e6510ab7..0c6b00498ac 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/operations/_operations.py @@ -5,13 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +======= +from typing import TYPE_CHECKING +>>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -49,6 +54,19 @@ def build_list_request( headers=header_parameters, **kwargs ) +======= +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +>>>>>>> 331f997c (updating to the latest vendored sdk) class Operations(object): """Operations operations. @@ -72,6 +90,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace def list( self, @@ -84,6 +103,18 @@ def list( cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ResourceProviderOperationList] +======= + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceProviderOperationList"] + """List all the available operations the KubernetesConfiguration resource provider supports. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ResourceProviderOperationList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -91,6 +122,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -112,6 +144,32 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) +======= + api_version = "2021-03-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,13 +182,21 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/operations/_source_control_configurations_operations.py index a36d0e745c0..131369370f8 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/operations/_source_control_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/operations/_source_control_configurations_operations.py @@ -5,13 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +======= +from typing import TYPE_CHECKING +>>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest @@ -198,6 +203,21 @@ def build_list_request( headers=header_parameters, **kwargs ) +======= +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +>>>>>>> 331f997c (updating to the latest vendored sdk) class SourceControlConfigurationsOperations(object): """SourceControlConfigurationsOperations operations. @@ -221,6 +241,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace def get( self, @@ -231,6 +252,18 @@ def get( source_control_configuration_name: str, **kwargs: Any ) -> "_models.SourceControlConfiguration": +======= + def get( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + source_control_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SourceControlConfiguration" +>>>>>>> 331f997c (updating to the latest vendored sdk) """Gets details of the Source Control Configuration. :param resource_group_name: The name of the resource group. @@ -240,8 +273,12 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. @@ -256,6 +293,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -270,12 +308,42 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-03-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) @@ -284,6 +352,7 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -299,6 +368,21 @@ def create_or_update( source_control_configuration: "_models.SourceControlConfiguration", **kwargs: Any ) -> "_models.SourceControlConfiguration": +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + source_control_configuration_name, # type: str + source_control_configuration, # type: "_models.SourceControlConfiguration" + **kwargs # type: Any + ): + # type: (...) -> "_models.SourceControlConfiguration" +>>>>>>> 331f997c (updating to the latest vendored sdk) """Create a new Kubernetes Source Control Configuration. :param resource_group_name: The name of the resource group. @@ -308,15 +392,23 @@ def create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. +<<<<<<< HEAD :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SourceControlConfiguration +======= + :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SourceControlConfiguration +>>>>>>> 331f997c (updating to the latest vendored sdk) :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SourceControlConfiguration @@ -327,6 +419,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -346,12 +439,47 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-03-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -364,6 +492,7 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -377,11 +506,26 @@ def _delete_initial( source_control_configuration_name: str, **kwargs: Any ) -> None: +======= + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + source_control_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_delete_request_initial( @@ -396,18 +540,50 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-03-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore +<<<<<<< HEAD @distributed_trace def begin_delete( @@ -419,6 +595,18 @@ def begin_delete( source_control_configuration_name: str, **kwargs: Any ) -> LROPoller[None]: +======= + def begin_delete( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + source_control_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] +>>>>>>> 331f997c (updating to the latest vendored sdk) """This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from the source repo. @@ -429,14 +617,19 @@ def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. +<<<<<<< HEAD :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -448,6 +641,17 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] +======= + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -464,14 +668,33 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) +<<<<<<< HEAD kwargs.pop('error_map', None) +======= + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) +>>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) +<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -483,6 +706,7 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -495,6 +719,19 @@ def list( cluster_name: str, **kwargs: Any ) -> Iterable["_models.SourceControlConfigurationList"]: +======= + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SourceControlConfigurationList"] +>>>>>>> 331f997c (updating to the latest vendored sdk) """List all Source Control Configurations. :param resource_group_name: The name of the resource group. @@ -504,6 +741,7 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -513,6 +751,14 @@ def list( cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SourceControlConfigurationList] +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SourceControlConfigurationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SourceControlConfigurationList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfigurationList"] @@ -520,6 +766,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -551,6 +798,40 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("SourceControlConfigurationList", pipeline_response) +======= + api_version = "2021-03-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SourceControlConfigurationList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -563,13 +844,21 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/__init__.py index e9096303633..fc12f19c5a1 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/__init__.py @@ -12,7 +12,15 @@ __version__ = VERSION __all__ = ['SourceControlConfigurationClient'] +<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() +======= +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/_configuration.py index e0d799c1310..c763d92ac9d 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/_configuration.py @@ -6,16 +6,29 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +======= +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy +>>>>>>> 331f997c (updating to the latest vendored sdk) from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports +<<<<<<< HEAD +======= + from typing import Any + +>>>>>>> 331f997c (updating to the latest vendored sdk) from azure.core.credentials import TokenCredential @@ -33,15 +46,27 @@ class SourceControlConfigurationClientConfiguration(Configuration): def __init__( self, +<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, **kwargs: Any ) -> None: super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +======= + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None +>>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") +<<<<<<< HEAD +======= + super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -65,4 +90,8 @@ 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: +<<<<<<< HEAD self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) +======= + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/_source_control_configuration_client.py index caa563f1320..f3e5be5d38e 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/_source_control_configuration_client.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from copy import deepcopy from typing import Any, Optional, TYPE_CHECKING @@ -48,28 +49,91 @@ class SourceControlConfigurationClient: :ivar operations: Operations operations :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.operations.Operations +======= +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + 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): + """KubernetesConfiguration Client. + + :ivar extensions: ExtensionsOperations operations + :vartype extensions: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.operations.ExtensionsOperations + :ivar operation_status: OperationStatusOperations operations + :vartype operation_status: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.operations.OperationStatusOperations + :ivar cluster_extension_type: ClusterExtensionTypeOperations operations + :vartype cluster_extension_type: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.operations.ClusterExtensionTypeOperations + :ivar cluster_extension_types: ClusterExtensionTypesOperations operations + :vartype cluster_extension_types: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.operations.ClusterExtensionTypesOperations + :ivar extension_type_versions: ExtensionTypeVersionsOperations operations + :vartype extension_type_versions: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.operations.ExtensionTypeVersionsOperations + :ivar location_extension_types: LocationExtensionTypesOperations operations + :vartype location_extension_types: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.operations.LocationExtensionTypesOperations + :ivar source_control_configurations: SourceControlConfigurationsOperations operations + :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.operations.SourceControlConfigurationsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.operations.Operations +>>>>>>> 331f997c (updating to the latest vendored sdk) :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str +<<<<<<< HEAD :param base_url: Service URL. Default value is 'https://management.azure.com'. :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. +======= + :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. +>>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, +<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) +======= + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) +<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -107,6 +171,45 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) +======= + 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 +>>>>>>> 331f997c (updating to the latest vendored sdk) def close(self): # type: () -> None diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/__init__.py index 5f583276b4e..5951024da8e 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/__init__.py @@ -8,8 +8,11 @@ from ._source_control_configuration_client import SourceControlConfigurationClient __all__ = ['SourceControlConfigurationClient'] +<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/_configuration.py index d457ecaa974..ab380ceff6e 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/_configuration.py @@ -10,7 +10,11 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +<<<<<<< HEAD from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy +======= +from azure.mgmt.core.policies import ARMHttpLoggingPolicy +>>>>>>> 331f997c (updating to the latest vendored sdk) from .._version import VERSION @@ -37,11 +41,18 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: +<<<<<<< HEAD super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") +<<<<<<< HEAD +======= + super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -64,4 +75,8 @@ 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: +<<<<<<< HEAD self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) +======= + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/_source_control_configuration_client.py index a2fbc1fdda5..2891adbddeb 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/_source_control_configuration_client.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from copy import deepcopy from typing import Any, Awaitable, Optional, TYPE_CHECKING @@ -17,10 +18,19 @@ from ._configuration import SourceControlConfigurationClientConfiguration from .operations import ClusterExtensionTypeOperations, ClusterExtensionTypesOperations, ExtensionTypeVersionsOperations, ExtensionsOperations, LocationExtensionTypesOperations, OperationStatusOperations, Operations, SourceControlConfigurationsOperations +======= +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 + +>>>>>>> 331f997c (updating to the latest vendored sdk) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential +<<<<<<< HEAD class SourceControlConfigurationClient: """KubernetesConfiguration Client. @@ -48,28 +58,76 @@ class SourceControlConfigurationClient: :ivar operations: Operations operations :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.aio.operations.Operations +======= +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): + """KubernetesConfiguration Client. + + :ivar extensions: ExtensionsOperations operations + :vartype extensions: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.aio.operations.ExtensionsOperations + :ivar operation_status: OperationStatusOperations operations + :vartype operation_status: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.aio.operations.OperationStatusOperations + :ivar cluster_extension_type: ClusterExtensionTypeOperations operations + :vartype cluster_extension_type: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.aio.operations.ClusterExtensionTypeOperations + :ivar cluster_extension_types: ClusterExtensionTypesOperations operations + :vartype cluster_extension_types: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.aio.operations.ClusterExtensionTypesOperations + :ivar extension_type_versions: ExtensionTypeVersionsOperations operations + :vartype extension_type_versions: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.aio.operations.ExtensionTypeVersionsOperations + :ivar location_extension_types: LocationExtensionTypesOperations operations + :vartype location_extension_types: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.aio.operations.LocationExtensionTypesOperations + :ivar source_control_configurations: SourceControlConfigurationsOperations operations + :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.aio.operations.SourceControlConfigurationsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.aio.operations.Operations +>>>>>>> 331f997c (updating to the latest vendored sdk) :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str +<<<<<<< HEAD :param base_url: Service URL. Default value is 'https://management.azure.com'. :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. +======= + :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. +>>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, +<<<<<<< HEAD base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) +======= + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) +<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -107,6 +165,44 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) +======= + 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 +>>>>>>> 331f997c (updating to the latest vendored sdk) async def close(self) -> None: await self._client.close() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_cluster_extension_type_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_cluster_extension_type_operations.py index c77d6b31997..224059db330 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_cluster_extension_type_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_cluster_extension_type_operations.py @@ -5,20 +5,16 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ..._vendor import _convert_request -from ...operations._cluster_extension_type_operations import build_get_request + T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +40,6 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config - @distributed_trace_async async def get( self, resource_group_name: str, @@ -78,26 +73,36 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterType': self._serialize.url("cluster_type", cluster_type, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionTypeName': self._serialize.url("extension_type_name", extension_type_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_type=cluster_type, - cluster_name=cluster_name, - extension_type_name=extension_type_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExtensionType', pipeline_response) @@ -106,6 +111,4 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterType}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{extensionTypeName}'} # type: ignore - diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_cluster_extension_types_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_cluster_extension_types_operations.py index b99f307b6ad..b0eaf6af2f6 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_cluster_extension_types_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_cluster_extension_types_operations.py @@ -5,22 +5,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ..._vendor import _convert_request -from ...operations._cluster_extension_types_operations import build_list_request + T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +41,6 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config - @distributed_trace def list( self, resource_group_name: str, @@ -65,8 +59,7 @@ def list( :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionTypeList or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionTypeList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionTypeList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionTypeList"] @@ -74,35 +67,37 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_name=cluster_name, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_name=cluster_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ExtensionTypeList", pipeline_response) + deserialized = self._deserialize('ExtensionTypeList', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,13 +110,12 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_extension_type_versions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_extension_type_versions_operations.py index 0fd76dd062a..bd9f2c220fc 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_extension_type_versions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_extension_type_versions_operations.py @@ -5,22 +5,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ..._vendor import _convert_request -from ...operations._extension_type_versions_operations import build_list_request + T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +41,6 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config - @distributed_trace def list( self, location: str, @@ -60,10 +54,8 @@ def list( :param extension_type_name: Extension type name. :type extension_type_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ExtensionVersionList or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionVersionList] + :return: An iterator like instance of either ExtensionVersionList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionVersionList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionVersionList"] @@ -71,33 +63,36 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - extension_type_name=extension_type_name, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'location': self._serialize.url("location", location, 'str'), + 'extensionTypeName': self._serialize.url("extension_type_name", extension_type_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - extension_type_name=extension_type_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ExtensionVersionList", pipeline_response) + deserialized = self._deserialize('ExtensionVersionList', pipeline_response) list_of_elem = deserialized.versions if cls: list_of_elem = cls(list_of_elem) @@ -110,13 +105,12 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_extensions_operations.py index 65591042bb2..c7347034d3d 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_extensions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_extensions_operations.py @@ -5,24 +5,36 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +======= +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +>>>>>>> 331f997c (updating to the latest vendored sdk) from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +<<<<<<< HEAD from ..._vendor import _convert_request from ...operations._extensions_operations import build_create_request_initial, build_delete_request_initial, build_get_request, build_list_request +======= + +>>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -63,6 +75,7 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -82,12 +95,48 @@ async def _create_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(extension, 'Extension') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) if response.status_code == 200: deserialized = self._deserialize('Extension', pipeline_response) @@ -99,11 +148,16 @@ async def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @distributed_trace_async +======= + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_create( self, resource_group_name: str, @@ -123,8 +177,12 @@ async def begin_create( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -133,6 +191,7 @@ async def begin_create( :type extension: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Extension :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. +<<<<<<< HEAD :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -147,6 +206,17 @@ async def begin_create( """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] +======= + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] lro_delay = kwargs.pop( 'polling_interval', @@ -161,6 +231,7 @@ async def begin_create( cluster_name=cluster_name, extension_name=extension_name, extension=extension, +<<<<<<< HEAD content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -170,12 +241,37 @@ async def begin_create( def get_long_running_output(pipeline_response): response = pipeline_response.http_response deserialized = self._deserialize('Extension', pipeline_response) +======= + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Extension', pipeline_response) + +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -187,10 +283,15 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @distributed_trace_async +======= + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -209,8 +310,12 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -225,6 +330,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -239,12 +345,42 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Extension', pipeline_response) @@ -253,10 +389,15 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) async def _delete_initial( self, resource_group_name: str, @@ -272,6 +413,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_delete_request_initial( @@ -287,20 +429,56 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if force_delete is not None: + query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore +<<<<<<< HEAD @distributed_trace_async +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_delete( self, resource_group_name: str, @@ -321,8 +499,12 @@ async def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -332,6 +514,7 @@ async def begin_delete( :type force_delete: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. +<<<<<<< HEAD :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -343,6 +526,17 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] +======= + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -360,14 +554,33 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) +<<<<<<< HEAD kwargs.pop('error_map', None) +======= + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) +>>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) +<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -379,10 +592,15 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @distributed_trace +======= + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -400,14 +618,22 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionsList or the result of cls(response) +<<<<<<< HEAD :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionsList] +======= + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionsList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionsList"] @@ -415,6 +641,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -446,6 +673,40 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionsList", pipeline_response) +======= + api_version = "2021-05-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ExtensionsList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -458,13 +719,21 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_location_extension_types_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_location_extension_types_operations.py index 024729f2f0f..f435cdfdcb5 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_location_extension_types_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_location_extension_types_operations.py @@ -5,22 +5,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ..._vendor import _convert_request -from ...operations._location_extension_types_operations import build_list_request + T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +41,6 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config - @distributed_trace def list( self, location: str, @@ -58,8 +52,7 @@ def list( :type location: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionTypeList or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionTypeList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionTypeList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionTypeList"] @@ -67,31 +60,35 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ExtensionTypeList", pipeline_response) + deserialized = self._deserialize('ExtensionTypeList', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -104,13 +101,12 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_operation_status_operations.py index 2d99d5e6b2f..88cd876c5f9 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_operation_status_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_operation_status_operations.py @@ -5,13 +5,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -21,6 +25,13 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operation_status_operations import build_get_request, build_list_request +======= +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +>>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +57,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -64,14 +78,22 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationStatusList or the result of cls(response) +<<<<<<< HEAD :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.OperationStatusList] +======= + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.OperationStatusList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusList"] @@ -79,6 +101,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -110,6 +133,40 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("OperationStatusList", pipeline_response) +======= + api_version = "2021-05-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationStatusList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,19 +179,30 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/operations'} # type: ignore +<<<<<<< HEAD @distributed_trace_async +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -154,8 +222,12 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -172,6 +244,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -187,12 +260,43 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OperationStatusResult', pipeline_response) @@ -201,6 +305,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_operations.py index d62dc62020b..66240d4806d 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_operations.py @@ -5,13 +5,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -21,6 +25,13 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operations import build_list_request +======= +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +>>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +57,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, **kwargs: Any @@ -54,10 +68,15 @@ def list( """List all the available operations the KubernetesConfiguration resource provider supports. :keyword callable cls: A custom type or function that will be passed the direct response +<<<<<<< HEAD :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ResourceProviderOperationList] +======= + :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ResourceProviderOperationList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -65,6 +84,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -86,6 +106,32 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) +======= + api_version = "2021-05-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,13 +144,21 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_source_control_configurations_operations.py index d63c27542d2..8b33eb991ab 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_source_control_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_source_control_configurations_operations.py @@ -5,24 +5,36 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +======= +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +>>>>>>> 331f997c (updating to the latest vendored sdk) from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +<<<<<<< HEAD from ..._vendor import _convert_request from ...operations._source_control_configurations_operations import build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request +======= + +>>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +60,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace_async +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -67,16 +82,24 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) +<<<<<<< HEAD :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration +======= + :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -84,6 +107,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -98,12 +122,42 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) @@ -112,11 +166,16 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @distributed_trace_async +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) async def create_or_update( self, resource_group_name: str, @@ -136,19 +195,30 @@ async def create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. +<<<<<<< HEAD :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration +======= + :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -156,6 +226,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -175,12 +246,47 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -193,10 +299,15 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore +======= + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) async def _delete_initial( self, resource_group_name: str, @@ -211,6 +322,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_delete_request_initial( @@ -225,20 +337,54 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore +<<<<<<< HEAD @distributed_trace_async +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_delete( self, resource_group_name: str, @@ -258,14 +404,19 @@ async def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. +<<<<<<< HEAD :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -277,6 +428,17 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] +======= + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -293,14 +455,33 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) +<<<<<<< HEAD kwargs.pop('error_map', None) +======= + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) +>>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) +<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -312,10 +493,15 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @distributed_trace +======= + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -333,6 +519,7 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -342,6 +529,14 @@ def list( cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfigurationList] +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SourceControlConfigurationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfigurationList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfigurationList"] @@ -349,6 +544,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -380,6 +576,40 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("SourceControlConfigurationList", pipeline_response) +======= + api_version = "2021-05-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SourceControlConfigurationList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -392,13 +622,21 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/__init__.py index 2b481eea8c9..ecffc1771f6 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/__init__.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from ._models_py3 import ClusterScopeSettings from ._models_py3 import ComplianceStatus from ._models_py3 import ErrorAdditionalInfo @@ -35,6 +36,66 @@ from ._models_py3 import SupportedScopes from ._models_py3 import SystemData +======= +try: + from ._models_py3 import ClusterScopeSettings + from ._models_py3 import ComplianceStatus + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse + from ._models_py3 import Extension + from ._models_py3 import ExtensionStatus + from ._models_py3 import ExtensionType + from ._models_py3 import ExtensionTypeList + from ._models_py3 import ExtensionVersionList + from ._models_py3 import ExtensionVersionListVersionsItem + from ._models_py3 import ExtensionsList + from ._models_py3 import HelmOperatorProperties + from ._models_py3 import Identity + from ._models_py3 import OperationStatusList + from ._models_py3 import OperationStatusResult + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import ResourceProviderOperation + from ._models_py3 import ResourceProviderOperationDisplay + from ._models_py3 import ResourceProviderOperationList + from ._models_py3 import Scope + from ._models_py3 import ScopeCluster + from ._models_py3 import ScopeNamespace + from ._models_py3 import SourceControlConfiguration + from ._models_py3 import SourceControlConfigurationList + from ._models_py3 import SupportedScopes + from ._models_py3 import SystemData +except (SyntaxError, ImportError): + from ._models import ClusterScopeSettings # type: ignore + from ._models import ComplianceStatus # type: ignore + from ._models import ErrorAdditionalInfo # type: ignore + from ._models import ErrorDetail # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import Extension # type: ignore + from ._models import ExtensionStatus # type: ignore + from ._models import ExtensionType # type: ignore + from ._models import ExtensionTypeList # type: ignore + from ._models import ExtensionVersionList # type: ignore + from ._models import ExtensionVersionListVersionsItem # type: ignore + from ._models import ExtensionsList # type: ignore + from ._models import HelmOperatorProperties # type: ignore + from ._models import Identity # type: ignore + from ._models import OperationStatusList # type: ignore + from ._models import OperationStatusResult # type: ignore + from ._models import ProxyResource # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceProviderOperation # type: ignore + from ._models import ResourceProviderOperationDisplay # type: ignore + from ._models import ResourceProviderOperationList # type: ignore + from ._models import Scope # type: ignore + from ._models import ScopeCluster # type: ignore + from ._models import ScopeNamespace # type: ignore + from ._models import SourceControlConfiguration # type: ignore + from ._models import SourceControlConfigurationList # type: ignore + from ._models import SupportedScopes # type: ignore + from ._models import SystemData # type: ignore +>>>>>>> 331f997c (updating to the latest vendored sdk) from ._source_control_configuration_client_enums import ( ClusterTypes, diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models.py new file mode 100644 index 00000000000..9a722f97fbb --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models.py @@ -0,0 +1,1056 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class ClusterScopeSettings(ProxyResource): + """Extension scope settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param allow_multiple_instances: Describes if multiple instances of the extension are allowed. + :type allow_multiple_instances: bool + :param default_release_namespace: Default extension release namespace. + :type default_release_namespace: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'allow_multiple_instances': {'key': 'properties.allowMultipleInstances', 'type': 'bool'}, + 'default_release_namespace': {'key': 'properties.defaultReleaseNamespace', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ClusterScopeSettings, self).__init__(**kwargs) + self.allow_multiple_instances = kwargs.get('allow_multiple_instances', None) + self.default_release_namespace = kwargs.get('default_release_namespace', None) + + +class ComplianceStatus(msrest.serialization.Model): + """Compliance Status details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar compliance_state: The compliance state of the configuration. Possible values include: + "Pending", "Compliant", "Noncompliant", "Installed", "Failed". + :vartype compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ComplianceStateType + :param last_config_applied: Datetime the configuration was last applied. + :type last_config_applied: ~datetime.datetime + :param message: Message from when the configuration was applied. + :type message: str + :param message_level: Level of the message. Possible values include: "Error", "Warning", + "Information". + :type message_level: str or + ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.MessageLevelType + """ + + _validation = { + 'compliance_state': {'readonly': True}, + } + + _attribute_map = { + 'compliance_state': {'key': 'complianceState', 'type': 'str'}, + 'last_config_applied': {'key': 'lastConfigApplied', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'message_level': {'key': 'messageLevel', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ComplianceStatus, self).__init__(**kwargs) + self.compliance_state = None + self.last_config_applied = kwargs.get('last_config_applied', None) + self.message = kwargs.get('message', None) + self.message_level = kwargs.get('message_level', None) + + +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(msrest.serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(msrest.serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). + + :param error: The error object. + :type error: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class Extension(ProxyResource): + """The Extension object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param identity: Identity of the Extension resource. + :type identity: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Identity + :ivar system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SystemData + :param extension_type: Type of the Extension, of which this resource is an instance of. It + must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the + Extension publisher. + :type extension_type: str + :param auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade + of minor version, or not. + :type auto_upgrade_minor_version: bool + :param release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. + Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :type release_train: str + :param version: Version of the extension for this extension, if it is 'pinned' to a specific + version. autoUpgradeMinorVersion must be 'false'. + :type version: str + :param scope: Scope at which the extension is installed. + :type scope: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Scope + :param configuration_settings: Configuration settings, as name-value pairs for configuring this + extension. + :type configuration_settings: dict[str, str] + :param configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :type configuration_protected_settings: dict[str, str] + :ivar provisioning_state: Status of installation of this extension. Possible values include: + "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ProvisioningState + :param statuses: Status from this extension. + :type statuses: + list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionStatus] + :ivar error_info: Error information from the Agent - e.g. errors during installation. + :vartype error_info: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ErrorDetail + :ivar custom_location_settings: Custom Location settings properties. + :vartype custom_location_settings: dict[str, str] + :ivar package_uri: Uri of the Helm package. + :vartype package_uri: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'error_info': {'readonly': True}, + 'custom_location_settings': {'readonly': True}, + 'package_uri': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'extension_type': {'key': 'properties.extensionType', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'release_train': {'key': 'properties.releaseTrain', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'Scope'}, + 'configuration_settings': {'key': 'properties.configurationSettings', 'type': '{str}'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'statuses': {'key': 'properties.statuses', 'type': '[ExtensionStatus]'}, + 'error_info': {'key': 'properties.errorInfo', 'type': 'ErrorDetail'}, + 'custom_location_settings': {'key': 'properties.customLocationSettings', 'type': '{str}'}, + 'package_uri': {'key': 'properties.packageUri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Extension, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.system_data = None + self.extension_type = kwargs.get('extension_type', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', True) + self.release_train = kwargs.get('release_train', "Stable") + self.version = kwargs.get('version', None) + self.scope = kwargs.get('scope', None) + self.configuration_settings = kwargs.get('configuration_settings', None) + self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) + self.provisioning_state = None + self.statuses = kwargs.get('statuses', None) + self.error_info = None + self.custom_location_settings = None + self.package_uri = None + + +class ExtensionsList(msrest.serialization.Model): + """Result of the request to list Extensions. It contains a list of Extension objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Extensions within a Kubernetes cluster. + :vartype value: list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Extension] + :ivar next_link: URL to get the next set of extension objects, if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Extension]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionsList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ExtensionStatus(msrest.serialization.Model): + """Status from the extension. + + :param code: Status code provided by the Extension. + :type code: str + :param display_status: Short description of status of the extension. + :type display_status: str + :param level: Level of the status. Possible values include: "Error", "Warning", "Information". + Default value: "Information". + :type level: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.LevelType + :param message: Detailed message of the status from the Extension. + :type message: str + :param time: DateLiteral (per ISO8601) noting the time of installation status. + :type time: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionStatus, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.display_status = kwargs.get('display_status', None) + self.level = kwargs.get('level', "Information") + self.message = kwargs.get('message', None) + self.time = kwargs.get('time', None) + + +class ExtensionType(msrest.serialization.Model): + """Represents an Extension Type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SystemData + :ivar release_trains: Extension release train: preview or stable. + :vartype release_trains: list[str] + :ivar cluster_types: Cluster types. Possible values include: "connectedClusters", + "managedClusters". + :vartype cluster_types: str or + ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ClusterTypes + :ivar supported_scopes: Extension scopes. + :vartype supported_scopes: + ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SupportedScopes + """ + + _validation = { + 'system_data': {'readonly': True}, + 'release_trains': {'readonly': True}, + 'cluster_types': {'readonly': True}, + 'supported_scopes': {'readonly': True}, + } + + _attribute_map = { + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'release_trains': {'key': 'properties.releaseTrains', 'type': '[str]'}, + 'cluster_types': {'key': 'properties.clusterTypes', 'type': 'str'}, + 'supported_scopes': {'key': 'properties.supportedScopes', 'type': 'SupportedScopes'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionType, self).__init__(**kwargs) + self.system_data = None + self.release_trains = None + self.cluster_types = None + self.supported_scopes = None + + +class ExtensionTypeList(msrest.serialization.Model): + """List Extension Types. + + :param value: The list of Extension Types. + :type value: list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionType] + :param next_link: The link to fetch the next page of Extension Types. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExtensionType]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionTypeList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ExtensionVersionList(msrest.serialization.Model): + """List versions for an Extension. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param versions: Versions available for this Extension Type. + :type versions: + list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionVersionListVersionsItem] + :param next_link: The link to fetch the next page of Extension Types. + :type next_link: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SystemData + """ + + _validation = { + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'versions': {'key': 'versions', 'type': '[ExtensionVersionListVersionsItem]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionVersionList, self).__init__(**kwargs) + self.versions = kwargs.get('versions', None) + self.next_link = kwargs.get('next_link', None) + self.system_data = None + + +class ExtensionVersionListVersionsItem(msrest.serialization.Model): + """ExtensionVersionListVersionsItem. + + :param release_train: The release train for this Extension Type. + :type release_train: str + :param versions: Versions available for this Extension Type and release train. + :type versions: list[str] + """ + + _attribute_map = { + 'release_train': {'key': 'releaseTrain', 'type': 'str'}, + 'versions': {'key': 'versions', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionVersionListVersionsItem, self).__init__(**kwargs) + self.release_train = kwargs.get('release_train', None) + self.versions = kwargs.get('versions', None) + + +class HelmOperatorProperties(msrest.serialization.Model): + """Properties for Helm operator. + + :param chart_version: Version of the operator Helm chart. + :type chart_version: str + :param chart_values: Values override for the operator Helm chart. + :type chart_values: str + """ + + _attribute_map = { + 'chart_version': {'key': 'chartVersion', 'type': 'str'}, + 'chart_values': {'key': 'chartValues', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HelmOperatorProperties, self).__init__(**kwargs) + self.chart_version = kwargs.get('chart_version', None) + self.chart_values = kwargs.get('chart_values', None) + + +class Identity(msrest.serialization.Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. The only acceptable values to pass in are None and + "SystemAssigned". The default value is None. + :type type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + + +class OperationStatusList(msrest.serialization.Model): + """The async operations in progress, in the cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of async operations in progress, in the cluster. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.OperationStatusResult] + :ivar next_link: URL to get the next set of Operation Result objects, if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OperationStatusResult]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationStatusList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class OperationStatusResult(msrest.serialization.Model): + """The current status of an async operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Fully qualified ID for the async operation. + :type id: str + :param name: Name of the async operation. + :type name: str + :param status: Required. Operation status. + :type status: str + :param properties: Additional information, if available. + :type properties: dict[str, str] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ErrorDetail + """ + + _validation = { + 'status': {'required': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationStatusResult, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.status = kwargs['status'] + self.properties = kwargs.get('properties', None) + self.error = None + + +class ResourceProviderOperation(msrest.serialization.Model): + """Supported operation of this resource provider. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: Operation name, in format of {provider}/{resource}/{operation}. + :type name: str + :param display: Display metadata associated with the operation. + :type display: + ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ResourceProviderOperationDisplay + :param origin: The intended executor of the operation;governs the display of the operation in + the RBAC UX and the audit logs UX. + :type origin: str + :ivar is_data_action: The flag that indicates whether the operation applies to data plane. + :vartype is_data_action: bool + """ + + _validation = { + 'is_data_action': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.is_data_action = None + + +class ResourceProviderOperationDisplay(msrest.serialization.Model): + """Display metadata associated with the operation. + + :param provider: Resource provider: Microsoft KubernetesConfiguration. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class ResourceProviderOperationList(msrest.serialization.Model): + """Result of the request to list operations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: List of operations supported by this resource provider. + :type value: + list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ResourceProviderOperation] + :ivar next_link: URL to the next set of results, if any. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperationList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class Scope(msrest.serialization.Model): + """Scope of the extension. It can be either Cluster or Namespace; but not both. + + :param cluster: Specifies that the scope of the extension is Cluster. + :type cluster: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ScopeCluster + :param namespace: Specifies that the scope of the extension is Namespace. + :type namespace: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ScopeNamespace + """ + + _attribute_map = { + 'cluster': {'key': 'cluster', 'type': 'ScopeCluster'}, + 'namespace': {'key': 'namespace', 'type': 'ScopeNamespace'}, + } + + def __init__( + self, + **kwargs + ): + super(Scope, self).__init__(**kwargs) + self.cluster = kwargs.get('cluster', None) + self.namespace = kwargs.get('namespace', None) + + +class ScopeCluster(msrest.serialization.Model): + """Specifies that the scope of the extension is Cluster. + + :param release_namespace: Namespace where the extension Release must be placed, for a Cluster + scoped extension. If this namespace does not exist, it will be created. + :type release_namespace: str + """ + + _attribute_map = { + 'release_namespace': {'key': 'releaseNamespace', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ScopeCluster, self).__init__(**kwargs) + self.release_namespace = kwargs.get('release_namespace', None) + + +class ScopeNamespace(msrest.serialization.Model): + """Specifies that the scope of the extension is Namespace. + + :param target_namespace: Namespace where the extension will be created for an Namespace scoped + extension. If this namespace does not exist, it will be created. + :type target_namespace: str + """ + + _attribute_map = { + 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ScopeNamespace, self).__init__(**kwargs) + self.target_namespace = kwargs.get('target_namespace', None) + + +class SourceControlConfiguration(ProxyResource): + """The SourceControl Configuration object returned in Get & Put response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SystemData + :param repository_url: Url of the SourceControl Repository. + :type repository_url: str + :param operator_namespace: The namespace to which this operator is installed to. Maximum of 253 + lower case alphanumeric characters, hyphen and period only. + :type operator_namespace: str + :param operator_instance_name: Instance name of the operator - identifying the specific + configuration. + :type operator_instance_name: str + :param operator_type: Type of the operator. Possible values include: "Flux". + :type operator_type: str or + ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.OperatorType + :param operator_params: Any Parameters for the Operator instance in string format. + :type operator_params: str + :param configuration_protected_settings: Name-value pairs of protected configuration settings + for the configuration. + :type configuration_protected_settings: dict[str, str] + :param operator_scope: Scope at which the operator will be installed. Possible values include: + "cluster", "namespace". Default value: "cluster". + :type operator_scope: str or + ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.OperatorScopeType + :ivar repository_public_key: Public Key associated with this SourceControl configuration + (either generated within the cluster or provided by the user). + :vartype repository_public_key: str + :param ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys + required to access private Git instances. + :type ssh_known_hosts_contents: str + :param enable_helm_operator: Option to enable Helm Operator for this git configuration. + :type enable_helm_operator: bool + :param helm_operator_properties: Properties for Helm operator. + :type helm_operator_properties: + ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.HelmOperatorProperties + :ivar provisioning_state: The provisioning state of the resource provider. Possible values + include: "Accepted", "Deleting", "Running", "Succeeded", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ProvisioningStateType + :ivar compliance_status: Compliance Status of the Configuration. + :vartype compliance_status: + ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ComplianceStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'repository_public_key': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'compliance_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'operator_namespace': {'key': 'properties.operatorNamespace', 'type': 'str'}, + 'operator_instance_name': {'key': 'properties.operatorInstanceName', 'type': 'str'}, + 'operator_type': {'key': 'properties.operatorType', 'type': 'str'}, + 'operator_params': {'key': 'properties.operatorParams', 'type': 'str'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, + 'operator_scope': {'key': 'properties.operatorScope', 'type': 'str'}, + 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, + 'ssh_known_hosts_contents': {'key': 'properties.sshKnownHostsContents', 'type': 'str'}, + 'enable_helm_operator': {'key': 'properties.enableHelmOperator', 'type': 'bool'}, + 'helm_operator_properties': {'key': 'properties.helmOperatorProperties', 'type': 'HelmOperatorProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'compliance_status': {'key': 'properties.complianceStatus', 'type': 'ComplianceStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlConfiguration, self).__init__(**kwargs) + self.system_data = None + self.repository_url = kwargs.get('repository_url', None) + self.operator_namespace = kwargs.get('operator_namespace', "default") + self.operator_instance_name = kwargs.get('operator_instance_name', None) + self.operator_type = kwargs.get('operator_type', None) + self.operator_params = kwargs.get('operator_params', None) + self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) + self.operator_scope = kwargs.get('operator_scope', "cluster") + self.repository_public_key = None + self.ssh_known_hosts_contents = kwargs.get('ssh_known_hosts_contents', None) + self.enable_helm_operator = kwargs.get('enable_helm_operator', None) + self.helm_operator_properties = kwargs.get('helm_operator_properties', None) + self.provisioning_state = None + self.compliance_status = None + + +class SourceControlConfigurationList(msrest.serialization.Model): + """Result of the request to list Source Control Configurations. It contains a list of SourceControlConfiguration objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Source Control Configurations within a Kubernetes cluster. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration] + :ivar next_link: URL to get the next set of configuration objects, if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SourceControlConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlConfigurationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SupportedScopes(msrest.serialization.Model): + """Extension scopes. + + :param default_scope: Default extension scopes: cluster or namespace. + :type default_scope: str + :param cluster_scope_settings: Scope settings. + :type cluster_scope_settings: + ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ClusterScopeSettings + """ + + _attribute_map = { + 'default_scope': {'key': 'defaultScope', 'type': 'str'}, + 'cluster_scope_settings': {'key': 'clusterScopeSettings', 'type': 'ClusterScopeSettings'}, + } + + def __init__( + self, + **kwargs + ): + super(SupportedScopes, self).__init__(**kwargs) + self.default_scope = kwargs.get('default_scope', None) + self.cluster_scope_settings = kwargs.get('cluster_scope_settings', None) + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models_py3.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models_py3.py index 97597606978..c497f1a38c5 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models_py3.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models_py3.py @@ -46,8 +46,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -85,8 +88,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ProxyResource, self).__init__(**kwargs) @@ -103,10 +109,17 @@ class ClusterScopeSettings(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str +<<<<<<< HEAD :ivar allow_multiple_instances: Describes if multiple instances of the extension are allowed. :vartype allow_multiple_instances: bool :ivar default_release_namespace: Default extension release namespace. :vartype default_release_namespace: str +======= + :param allow_multiple_instances: Describes if multiple instances of the extension are allowed. + :type allow_multiple_instances: bool + :param default_release_namespace: Default extension release namespace. + :type default_release_namespace: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -130,6 +143,7 @@ def __init__( default_release_namespace: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword allow_multiple_instances: Describes if multiple instances of the extension are allowed. @@ -137,6 +151,8 @@ def __init__( :keyword default_release_namespace: Default extension release namespace. :paramtype default_release_namespace: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ClusterScopeSettings, self).__init__(**kwargs) self.allow_multiple_instances = allow_multiple_instances self.default_release_namespace = default_release_namespace @@ -151,6 +167,7 @@ class ComplianceStatus(msrest.serialization.Model): "Pending", "Compliant", "Noncompliant", "Installed", "Failed". :vartype compliance_state: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ComplianceStateType +<<<<<<< HEAD :ivar last_config_applied: Datetime the configuration was last applied. :vartype last_config_applied: ~datetime.datetime :ivar message: Message from when the configuration was applied. @@ -158,6 +175,15 @@ class ComplianceStatus(msrest.serialization.Model): :ivar message_level: Level of the message. Possible values include: "Error", "Warning", "Information". :vartype message_level: str or +======= + :param last_config_applied: Datetime the configuration was last applied. + :type last_config_applied: ~datetime.datetime + :param message: Message from when the configuration was applied. + :type message: str + :param message_level: Level of the message. Possible values include: "Error", "Warning", + "Information". + :type message_level: str or +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.MessageLevelType """ @@ -180,6 +206,7 @@ def __init__( message_level: Optional[Union[str, "MessageLevelType"]] = None, **kwargs ): +<<<<<<< HEAD """ :keyword last_config_applied: Datetime the configuration was last applied. :paramtype last_config_applied: ~datetime.datetime @@ -190,6 +217,8 @@ def __init__( :paramtype message_level: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.MessageLevelType """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ComplianceStatus, self).__init__(**kwargs) self.compliance_state = None self.last_config_applied = last_config_applied @@ -222,8 +251,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -268,8 +300,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorDetail, self).__init__(**kwargs) self.code = None self.message = None @@ -281,8 +316,13 @@ def __init__( class ErrorResponse(msrest.serialization.Model): """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). +<<<<<<< HEAD :ivar error: The error object. :vartype error: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ErrorDetail +======= + :param error: The error object. + :type error: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ErrorDetail +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -295,10 +335,13 @@ def __init__( error: Optional["ErrorDetail"] = None, **kwargs ): +<<<<<<< HEAD """ :keyword error: The error object. :paramtype error: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ErrorDetail """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorResponse, self).__init__(**kwargs) self.error = error @@ -316,6 +359,7 @@ class Extension(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str +<<<<<<< HEAD :ivar identity: Identity of the Extension resource. :vartype identity: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Identity :ivar system_data: Top level metadata @@ -342,12 +386,45 @@ class Extension(ProxyResource): :ivar configuration_protected_settings: Configuration settings that are sensitive, as name-value pairs for configuring this extension. :vartype configuration_protected_settings: dict[str, str] +======= + :param identity: Identity of the Extension resource. + :type identity: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Identity + :ivar system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SystemData + :param extension_type: Type of the Extension, of which this resource is an instance of. It + must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the + Extension publisher. + :type extension_type: str + :param auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade + of minor version, or not. + :type auto_upgrade_minor_version: bool + :param release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. + Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :type release_train: str + :param version: Version of the extension for this extension, if it is 'pinned' to a specific + version. autoUpgradeMinorVersion must be 'false'. + :type version: str + :param scope: Scope at which the extension is installed. + :type scope: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Scope + :param configuration_settings: Configuration settings, as name-value pairs for configuring this + extension. + :type configuration_settings: dict[str, str] + :param configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :type configuration_protected_settings: dict[str, str] +>>>>>>> 331f997c (updating to the latest vendored sdk) :ivar provisioning_state: Status of installation of this extension. Possible values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". :vartype provisioning_state: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ProvisioningState +<<<<<<< HEAD :ivar statuses: Status from this extension. :vartype statuses: +======= + :param statuses: Status from this extension. + :type statuses: +>>>>>>> 331f997c (updating to the latest vendored sdk) list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionStatus] :ivar error_info: Error information from the Agent - e.g. errors during installation. :vartype error_info: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ErrorDetail @@ -402,6 +479,7 @@ def __init__( statuses: Optional[List["ExtensionStatus"]] = None, **kwargs ): +<<<<<<< HEAD """ :keyword identity: Identity of the Extension resource. :paramtype identity: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Identity @@ -430,6 +508,8 @@ def __init__( :paramtype statuses: list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionStatus] """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(Extension, self).__init__(**kwargs) self.identity = identity self.system_data = None @@ -472,8 +552,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionsList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -482,6 +565,7 @@ def __init__( class ExtensionStatus(msrest.serialization.Model): """Status from the extension. +<<<<<<< HEAD :ivar code: Status code provided by the Extension. :vartype code: str :ivar display_status: Short description of status of the extension. @@ -493,6 +577,19 @@ class ExtensionStatus(msrest.serialization.Model): :vartype message: str :ivar time: DateLiteral (per ISO8601) noting the time of installation status. :vartype time: str +======= + :param code: Status code provided by the Extension. + :type code: str + :param display_status: Short description of status of the extension. + :type display_status: str + :param level: Level of the status. Possible values include: "Error", "Warning", "Information". + Default value: "Information". + :type level: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.LevelType + :param message: Detailed message of the status from the Extension. + :type message: str + :param time: DateLiteral (per ISO8601) noting the time of installation status. + :type time: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -513,6 +610,7 @@ def __init__( time: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword code: Status code provided by the Extension. :paramtype code: str @@ -527,6 +625,8 @@ def __init__( :keyword time: DateLiteral (per ISO8601) noting the time of installation status. :paramtype time: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionStatus, self).__init__(**kwargs) self.code = code self.display_status = display_status @@ -571,8 +671,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionType, self).__init__(**kwargs) self.system_data = None self.release_trains = None @@ -583,11 +686,18 @@ def __init__( class ExtensionTypeList(msrest.serialization.Model): """List Extension Types. +<<<<<<< HEAD :ivar value: The list of Extension Types. :vartype value: list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionType] :ivar next_link: The link to fetch the next page of Extension Types. :vartype next_link: str +======= + :param value: The list of Extension Types. + :type value: list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionType] + :param next_link: The link to fetch the next page of Extension Types. + :type next_link: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -602,6 +712,7 @@ def __init__( next_link: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword value: The list of Extension Types. :paramtype value: @@ -609,6 +720,8 @@ def __init__( :keyword next_link: The link to fetch the next page of Extension Types. :paramtype next_link: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionTypeList, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -619,11 +732,19 @@ class ExtensionVersionList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. +<<<<<<< HEAD :ivar versions: Versions available for this Extension Type. :vartype versions: list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionVersionListVersionsItem] :ivar next_link: The link to fetch the next page of Extension Types. :vartype next_link: str +======= + :param versions: Versions available for this Extension Type. + :type versions: + list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionVersionListVersionsItem] + :param next_link: The link to fetch the next page of Extension Types. + :type next_link: str +>>>>>>> 331f997c (updating to the latest vendored sdk) :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SystemData """ @@ -645,6 +766,7 @@ def __init__( next_link: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword versions: Versions available for this Extension Type. :paramtype versions: @@ -652,6 +774,8 @@ def __init__( :keyword next_link: The link to fetch the next page of Extension Types. :paramtype next_link: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionVersionList, self).__init__(**kwargs) self.versions = versions self.next_link = next_link @@ -661,10 +785,17 @@ def __init__( class ExtensionVersionListVersionsItem(msrest.serialization.Model): """ExtensionVersionListVersionsItem. +<<<<<<< HEAD :ivar release_train: The release train for this Extension Type. :vartype release_train: str :ivar versions: Versions available for this Extension Type and release train. :vartype versions: list[str] +======= + :param release_train: The release train for this Extension Type. + :type release_train: str + :param versions: Versions available for this Extension Type and release train. + :type versions: list[str] +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -679,12 +810,15 @@ def __init__( versions: Optional[List[str]] = None, **kwargs ): +<<<<<<< HEAD """ :keyword release_train: The release train for this Extension Type. :paramtype release_train: str :keyword versions: Versions available for this Extension Type and release train. :paramtype versions: list[str] """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionVersionListVersionsItem, self).__init__(**kwargs) self.release_train = release_train self.versions = versions @@ -693,10 +827,17 @@ def __init__( class HelmOperatorProperties(msrest.serialization.Model): """Properties for Helm operator. +<<<<<<< HEAD :ivar chart_version: Version of the operator Helm chart. :vartype chart_version: str :ivar chart_values: Values override for the operator Helm chart. :vartype chart_values: str +======= + :param chart_version: Version of the operator Helm chart. + :type chart_version: str + :param chart_values: Values override for the operator Helm chart. + :type chart_values: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -711,12 +852,15 @@ def __init__( chart_values: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword chart_version: Version of the operator Helm chart. :paramtype chart_version: str :keyword chart_values: Values override for the operator Helm chart. :paramtype chart_values: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(HelmOperatorProperties, self).__init__(**kwargs) self.chart_version = chart_version self.chart_values = chart_values @@ -731,9 +875,15 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str +<<<<<<< HEAD :ivar type: The identity type. The only acceptable values to pass in are None and "SystemAssigned". The default value is None. :vartype type: str +======= + :param type: The identity type. The only acceptable values to pass in are None and + "SystemAssigned". The default value is None. + :type type: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -753,11 +903,14 @@ def __init__( type: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword type: The identity type. The only acceptable values to pass in are None and "SystemAssigned". The default value is None. :paramtype type: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(Identity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -790,8 +943,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(OperationStatusList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -804,6 +960,7 @@ class OperationStatusResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. +<<<<<<< HEAD :ivar id: Fully qualified ID for the async operation. :vartype id: str :ivar name: Name of the async operation. @@ -812,6 +969,16 @@ class OperationStatusResult(msrest.serialization.Model): :vartype status: str :ivar properties: Additional information, if available. :vartype properties: dict[str, str] +======= + :param id: Fully qualified ID for the async operation. + :type id: str + :param name: Name of the async operation. + :type name: str + :param status: Required. Operation status. + :type status: str + :param properties: Additional information, if available. + :type properties: dict[str, str] +>>>>>>> 331f997c (updating to the latest vendored sdk) :ivar error: If present, details of the operation error. :vartype error: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ErrorDetail """ @@ -838,6 +1005,7 @@ def __init__( properties: Optional[Dict[str, str]] = None, **kwargs ): +<<<<<<< HEAD """ :keyword id: Fully qualified ID for the async operation. :paramtype id: str @@ -848,6 +1016,8 @@ def __init__( :keyword properties: Additional information, if available. :paramtype properties: dict[str, str] """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(OperationStatusResult, self).__init__(**kwargs) self.id = id self.name = name @@ -861,6 +1031,7 @@ class ResourceProviderOperation(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. +<<<<<<< HEAD :ivar name: Operation name, in format of {provider}/{resource}/{operation}. :vartype name: str :ivar display: Display metadata associated with the operation. @@ -869,6 +1040,16 @@ class ResourceProviderOperation(msrest.serialization.Model): :ivar origin: The intended executor of the operation;governs the display of the operation in the RBAC UX and the audit logs UX. :vartype origin: str +======= + :param name: Operation name, in format of {provider}/{resource}/{operation}. + :type name: str + :param display: Display metadata associated with the operation. + :type display: + ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ResourceProviderOperationDisplay + :param origin: The intended executor of the operation;governs the display of the operation in + the RBAC UX and the audit logs UX. + :type origin: str +>>>>>>> 331f997c (updating to the latest vendored sdk) :ivar is_data_action: The flag that indicates whether the operation applies to data plane. :vartype is_data_action: bool """ @@ -892,6 +1073,7 @@ def __init__( origin: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword name: Operation name, in format of {provider}/{resource}/{operation}. :paramtype name: str @@ -902,6 +1084,8 @@ def __init__( the RBAC UX and the audit logs UX. :paramtype origin: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperation, self).__init__(**kwargs) self.name = name self.display = display @@ -912,6 +1096,7 @@ def __init__( class ResourceProviderOperationDisplay(msrest.serialization.Model): """Display metadata associated with the operation. +<<<<<<< HEAD :ivar provider: Resource provider: Microsoft KubernetesConfiguration. :vartype provider: str :ivar resource: Resource on which the operation is performed. @@ -920,6 +1105,16 @@ class ResourceProviderOperationDisplay(msrest.serialization.Model): :vartype operation: str :ivar description: Description of this operation. :vartype description: str +======= + :param provider: Resource provider: Microsoft KubernetesConfiguration. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this operation. + :type description: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -938,6 +1133,7 @@ def __init__( description: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword provider: Resource provider: Microsoft KubernetesConfiguration. :paramtype provider: str @@ -948,6 +1144,8 @@ def __init__( :keyword description: Description of this operation. :paramtype description: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperationDisplay, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -960,8 +1158,13 @@ class ResourceProviderOperationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. +<<<<<<< HEAD :ivar value: List of operations supported by this resource provider. :vartype value: +======= + :param value: List of operations supported by this resource provider. + :type value: +>>>>>>> 331f997c (updating to the latest vendored sdk) list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ResourceProviderOperation] :ivar next_link: URL to the next set of results, if any. :vartype next_link: str @@ -982,11 +1185,14 @@ def __init__( value: Optional[List["ResourceProviderOperation"]] = None, **kwargs ): +<<<<<<< HEAD """ :keyword value: List of operations supported by this resource provider. :paramtype value: list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ResourceProviderOperation] """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperationList, self).__init__(**kwargs) self.value = value self.next_link = None @@ -995,11 +1201,18 @@ def __init__( class Scope(msrest.serialization.Model): """Scope of the extension. It can be either Cluster or Namespace; but not both. +<<<<<<< HEAD :ivar cluster: Specifies that the scope of the extension is Cluster. :vartype cluster: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ScopeCluster :ivar namespace: Specifies that the scope of the extension is Namespace. :vartype namespace: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ScopeNamespace +======= + :param cluster: Specifies that the scope of the extension is Cluster. + :type cluster: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ScopeCluster + :param namespace: Specifies that the scope of the extension is Namespace. + :type namespace: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ScopeNamespace +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1014,6 +1227,7 @@ def __init__( namespace: Optional["ScopeNamespace"] = None, **kwargs ): +<<<<<<< HEAD """ :keyword cluster: Specifies that the scope of the extension is Cluster. :paramtype cluster: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ScopeCluster @@ -1021,6 +1235,8 @@ def __init__( :paramtype namespace: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ScopeNamespace """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(Scope, self).__init__(**kwargs) self.cluster = cluster self.namespace = namespace @@ -1029,9 +1245,15 @@ def __init__( class ScopeCluster(msrest.serialization.Model): """Specifies that the scope of the extension is Cluster. +<<<<<<< HEAD :ivar release_namespace: Namespace where the extension Release must be placed, for a Cluster scoped extension. If this namespace does not exist, it will be created. :vartype release_namespace: str +======= + :param release_namespace: Namespace where the extension Release must be placed, for a Cluster + scoped extension. If this namespace does not exist, it will be created. + :type release_namespace: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1044,11 +1266,14 @@ def __init__( release_namespace: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword release_namespace: Namespace where the extension Release must be placed, for a Cluster scoped extension. If this namespace does not exist, it will be created. :paramtype release_namespace: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ScopeCluster, self).__init__(**kwargs) self.release_namespace = release_namespace @@ -1056,9 +1281,15 @@ def __init__( class ScopeNamespace(msrest.serialization.Model): """Specifies that the scope of the extension is Namespace. +<<<<<<< HEAD :ivar target_namespace: Namespace where the extension will be created for an Namespace scoped extension. If this namespace does not exist, it will be created. :vartype target_namespace: str +======= + :param target_namespace: Namespace where the extension will be created for an Namespace scoped + extension. If this namespace does not exist, it will be created. + :type target_namespace: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1071,11 +1302,14 @@ def __init__( target_namespace: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword target_namespace: Namespace where the extension will be created for an Namespace scoped extension. If this namespace does not exist, it will be created. :paramtype target_namespace: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ScopeNamespace, self).__init__(**kwargs) self.target_namespace = target_namespace @@ -1096,6 +1330,7 @@ class SourceControlConfiguration(ProxyResource): :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SystemData +<<<<<<< HEAD :ivar repository_url: Url of the SourceControl Repository. :vartype repository_url: str :ivar operator_namespace: The namespace to which this operator is installed to. Maximum of 253 @@ -1115,10 +1350,32 @@ class SourceControlConfiguration(ProxyResource): :ivar operator_scope: Scope at which the operator will be installed. Possible values include: "cluster", "namespace". Default value: "cluster". :vartype operator_scope: str or +======= + :param repository_url: Url of the SourceControl Repository. + :type repository_url: str + :param operator_namespace: The namespace to which this operator is installed to. Maximum of 253 + lower case alphanumeric characters, hyphen and period only. + :type operator_namespace: str + :param operator_instance_name: Instance name of the operator - identifying the specific + configuration. + :type operator_instance_name: str + :param operator_type: Type of the operator. Possible values include: "Flux". + :type operator_type: str or + ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.OperatorType + :param operator_params: Any Parameters for the Operator instance in string format. + :type operator_params: str + :param configuration_protected_settings: Name-value pairs of protected configuration settings + for the configuration. + :type configuration_protected_settings: dict[str, str] + :param operator_scope: Scope at which the operator will be installed. Possible values include: + "cluster", "namespace". Default value: "cluster". + :type operator_scope: str or +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.OperatorScopeType :ivar repository_public_key: Public Key associated with this SourceControl configuration (either generated within the cluster or provided by the user). :vartype repository_public_key: str +<<<<<<< HEAD :ivar ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys required to access private Git instances. :vartype ssh_known_hosts_contents: str @@ -1126,6 +1383,15 @@ class SourceControlConfiguration(ProxyResource): :vartype enable_helm_operator: bool :ivar helm_operator_properties: Properties for Helm operator. :vartype helm_operator_properties: +======= + :param ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys + required to access private Git instances. + :type ssh_known_hosts_contents: str + :param enable_helm_operator: Option to enable Helm Operator for this git configuration. + :type enable_helm_operator: bool + :param helm_operator_properties: Properties for Helm operator. + :type helm_operator_properties: +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.HelmOperatorProperties :ivar provisioning_state: The provisioning state of the resource provider. Possible values include: "Accepted", "Deleting", "Running", "Succeeded", "Failed". @@ -1181,6 +1447,7 @@ def __init__( helm_operator_properties: Optional["HelmOperatorProperties"] = None, **kwargs ): +<<<<<<< HEAD """ :keyword repository_url: Url of the SourceControl Repository. :paramtype repository_url: str @@ -1211,6 +1478,8 @@ def __init__( :paramtype helm_operator_properties: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.HelmOperatorProperties """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(SourceControlConfiguration, self).__init__(**kwargs) self.system_data = None self.repository_url = repository_url @@ -1254,8 +1523,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(SourceControlConfigurationList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -1264,10 +1536,17 @@ def __init__( class SupportedScopes(msrest.serialization.Model): """Extension scopes. +<<<<<<< HEAD :ivar default_scope: Default extension scopes: cluster or namespace. :vartype default_scope: str :ivar cluster_scope_settings: Scope settings. :vartype cluster_scope_settings: +======= + :param default_scope: Default extension scopes: cluster or namespace. + :type default_scope: str + :param cluster_scope_settings: Scope settings. + :type cluster_scope_settings: +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ClusterScopeSettings """ @@ -1283,6 +1562,7 @@ def __init__( cluster_scope_settings: Optional["ClusterScopeSettings"] = None, **kwargs ): +<<<<<<< HEAD """ :keyword default_scope: Default extension scopes: cluster or namespace. :paramtype default_scope: str @@ -1290,6 +1570,8 @@ def __init__( :paramtype cluster_scope_settings: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ClusterScopeSettings """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(SupportedScopes, self).__init__(**kwargs) self.default_scope = default_scope self.cluster_scope_settings = cluster_scope_settings @@ -1298,6 +1580,7 @@ def __init__( class SystemData(msrest.serialization.Model): """Metadata pertaining to creation and last modification of the resource. +<<<<<<< HEAD :ivar created_by: The identity that created the resource. :vartype created_by: str :ivar created_by_type: The type of identity that created the resource. Possible values include: @@ -1314,6 +1597,24 @@ class SystemData(msrest.serialization.Model): ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.CreatedByType :ivar last_modified_at: The timestamp of resource last modification (UTC). :vartype last_modified_at: ~datetime.datetime +======= + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1336,6 +1637,7 @@ def __init__( last_modified_at: Optional[datetime.datetime] = None, **kwargs ): +<<<<<<< HEAD """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -1354,6 +1656,8 @@ def __init__( :keyword last_modified_at: The timestamp of resource last modification (UTC). :paramtype last_modified_at: ~datetime.datetime """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(SystemData, self).__init__(**kwargs) self.created_by = created_by self.created_by_type = created_by_type diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_source_control_configuration_client_enums.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_source_control_configuration_client_enums.py index bd58c28c279..b9aec635d6d 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_source_control_configuration_client_enums.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_source_control_configuration_client_enums.py @@ -6,19 +6,47 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from enum import Enum from six import with_metaclass from azure.core import CaseInsensitiveEnumMeta class ClusterTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class ClusterTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Cluster types """ CONNECTED_CLUSTERS = "connectedClusters" MANAGED_CLUSTERS = "managedClusters" +<<<<<<< HEAD class ComplianceStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class ComplianceStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """The compliance state of the configuration. """ @@ -28,7 +56,11 @@ class ComplianceStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): INSTALLED = "Installed" FAILED = "Failed" +<<<<<<< HEAD class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """The type of identity that created the resource. """ @@ -37,22 +69,38 @@ class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" +<<<<<<< HEAD class Enum0(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class Enum0(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) MICROSOFT_CONTAINER_SERVICE = "Microsoft.ContainerService" MICROSOFT_KUBERNETES = "Microsoft.Kubernetes" +<<<<<<< HEAD class Enum1(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class Enum1(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) MANAGED_CLUSTERS = "managedClusters" CONNECTED_CLUSTERS = "connectedClusters" +<<<<<<< HEAD class Enum5(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class Enum5(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) MANAGED_CLUSTERS = "managedClusters" CONNECTED_CLUSTERS = "connectedClusters" +<<<<<<< HEAD class LevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class LevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Level of the status. """ @@ -60,7 +108,11 @@ class LevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): WARNING = "Warning" INFORMATION = "Information" +<<<<<<< HEAD class MessageLevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class MessageLevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Level of the message. """ @@ -68,20 +120,32 @@ class MessageLevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): WARNING = "Warning" INFORMATION = "Information" +<<<<<<< HEAD class OperatorScopeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class OperatorScopeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Scope at which the operator will be installed. """ CLUSTER = "cluster" NAMESPACE = "namespace" +<<<<<<< HEAD class OperatorType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class OperatorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Type of the operator """ FLUX = "Flux" +<<<<<<< HEAD class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """The provisioning state of the extension resource. """ @@ -92,7 +156,11 @@ class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): UPDATING = "Updating" DELETING = "Deleting" +<<<<<<< HEAD class ProvisioningStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class ProvisioningStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """The provisioning state of the resource provider. """ diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_cluster_extension_type_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_cluster_extension_type_operations.py index a9e523f7ed1..f845b5d719a 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_cluster_extension_type_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_cluster_extension_type_operations.py @@ -5,65 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace +from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models -from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - -def build_get_request( - subscription_id: str, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_type: Union[str, "_models.Enum5"], - cluster_name: str, - extension_type_name: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2021-05-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterType}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{extensionTypeName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), - "clusterType": _SERIALIZER.url("cluster_type", cluster_type, 'str'), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), - "extensionTypeName": _SERIALIZER.url("extension_type_name", extension_type_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ClusterExtensionTypeOperations(object): """ClusterExtensionTypeOperations operations. @@ -87,16 +44,16 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config - @distributed_trace def get( self, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_type: Union[str, "_models.Enum5"], - cluster_name: str, - extension_type_name: str, - **kwargs: Any - ) -> "_models.ExtensionType": + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_type, # type: Union[str, "_models.Enum5"] + cluster_name, # type: str + extension_type_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ExtensionType" """Get Extension Type details. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -121,26 +78,36 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterType': self._serialize.url("cluster_type", cluster_type, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionTypeName': self._serialize.url("extension_type_name", extension_type_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_type=cluster_type, - cluster_name=cluster_name, - extension_type_name=extension_type_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExtensionType', pipeline_response) @@ -149,6 +116,4 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterType}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{extensionTypeName}'} # type: ignore - diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_cluster_extension_types_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_cluster_extension_types_operations.py index 210d4945423..2991257b530 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_cluster_extension_types_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_cluster_extension_types_operations.py @@ -5,62 +5,23 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace +from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models -from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - -def build_list_request( - subscription_id: str, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_name: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2021-05-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/connectedClusters/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ClusterExtensionTypesOperations(object): """ClusterExtensionTypesOperations operations. @@ -84,14 +45,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config - @distributed_trace def list( self, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_name: str, - **kwargs: Any - ) -> Iterable["_models.ExtensionTypeList"]: + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ExtensionTypeList"] """Get Extension Types. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -103,8 +64,7 @@ def list( :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionTypeList or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionTypeList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionTypeList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionTypeList"] @@ -112,35 +72,37 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_name=cluster_name, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_name=cluster_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): - deserialized = self._deserialize("ExtensionTypeList", pipeline_response) + deserialized = self._deserialize('ExtensionTypeList', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -153,13 +115,12 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_extension_type_versions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_extension_type_versions_operations.py index c978497cf58..bca368e1670 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_extension_type_versions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_extension_type_versions_operations.py @@ -5,60 +5,23 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace +from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models -from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - -def build_list_request( - subscription_id: str, - location: str, - extension_type_name: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2021-05-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/locations/{location}/extensionTypes/{extensionTypeName}/versions') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "location": _SERIALIZER.url("location", location, 'str'), - "extensionTypeName": _SERIALIZER.url("extension_type_name", extension_type_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ExtensionTypeVersionsOperations(object): """ExtensionTypeVersionsOperations operations. @@ -82,13 +45,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config - @distributed_trace def list( self, - location: str, - extension_type_name: str, - **kwargs: Any - ) -> Iterable["_models.ExtensionVersionList"]: + location, # type: str + extension_type_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ExtensionVersionList"] """List available versions for an Extension Type. :param location: extension location. @@ -96,10 +59,8 @@ def list( :param extension_type_name: Extension type name. :type extension_type_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ExtensionVersionList or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionVersionList] + :return: An iterator like instance of either ExtensionVersionList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionVersionList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionVersionList"] @@ -107,33 +68,36 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - extension_type_name=extension_type_name, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'location': self._serialize.url("location", location, 'str'), + 'extensionTypeName': self._serialize.url("extension_type_name", extension_type_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - extension_type_name=extension_type_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): - deserialized = self._deserialize("ExtensionVersionList", pipeline_response) + deserialized = self._deserialize('ExtensionVersionList', pipeline_response) list_of_elem = deserialized.versions if cls: list_of_elem = cls(list_of_elem) @@ -146,13 +110,12 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_extensions_operations.py index 36fca482e88..b05133955ee 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_extensions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_extensions_operations.py @@ -5,13 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +======= +from typing import TYPE_CHECKING +>>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest @@ -202,6 +207,21 @@ def build_list_request( headers=header_parameters, **kwargs ) +======= +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +>>>>>>> 331f997c (updating to the latest vendored sdk) class ExtensionsOperations(object): """ExtensionsOperations operations. @@ -227,6 +247,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_initial( self, +<<<<<<< HEAD resource_group_name: str, cluster_rp: Union[str, "_models.Enum0"], cluster_resource_name: Union[str, "_models.Enum1"], @@ -235,11 +256,23 @@ def _create_initial( extension: "_models.Extension", **kwargs: Any ) -> "_models.Extension": +======= + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_name, # type: str + extension, # type: "_models.Extension" + **kwargs # type: Any + ): + # type: (...) -> "_models.Extension" +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -259,12 +292,48 @@ def _create_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(extension, 'Extension') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) if response.status_code == 200: deserialized = self._deserialize('Extension', pipeline_response) @@ -276,6 +345,7 @@ def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @@ -291,6 +361,21 @@ def begin_create( extension: "_models.Extension", **kwargs: Any ) -> LROPoller["_models.Extension"]: +======= + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_name, # type: str + extension, # type: "_models.Extension" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Extension"] +>>>>>>> 331f997c (updating to the latest vendored sdk) """Create a new Kubernetes Cluster Extension. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -300,8 +385,12 @@ def begin_create( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -310,6 +399,7 @@ def begin_create( :type extension: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Extension :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. +<<<<<<< HEAD :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -323,6 +413,17 @@ def begin_create( """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] +======= + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Extension or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] lro_delay = kwargs.pop( 'polling_interval', @@ -337,6 +438,7 @@ def begin_create( cluster_name=cluster_name, extension_name=extension_name, extension=extension, +<<<<<<< HEAD content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -346,12 +448,37 @@ def begin_create( def get_long_running_output(pipeline_response): response = pipeline_response.http_response deserialized = self._deserialize('Extension', pipeline_response) +======= + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Extension', pipeline_response) + +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -363,6 +490,7 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @@ -376,6 +504,20 @@ def get( extension_name: str, **kwargs: Any ) -> "_models.Extension": +======= + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Extension" +>>>>>>> 331f997c (updating to the latest vendored sdk) """Gets Kubernetes Cluster Extension. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -385,8 +527,12 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -401,6 +547,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -415,12 +562,42 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Extension', pipeline_response) @@ -429,6 +606,7 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @@ -443,11 +621,27 @@ def _delete_initial( force_delete: Optional[bool] = None, **kwargs: Any ) -> None: +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_name, # type: str + force_delete=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_delete_request_initial( @@ -463,18 +657,52 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if force_delete is not None: + query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore +<<<<<<< HEAD @distributed_trace def begin_delete( @@ -487,6 +715,19 @@ def begin_delete( force_delete: Optional[bool] = None, **kwargs: Any ) -> LROPoller[None]: +======= + def begin_delete( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_name, # type: str + force_delete=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] +>>>>>>> 331f997c (updating to the latest vendored sdk) """Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. @@ -497,8 +738,12 @@ def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -508,6 +753,7 @@ def begin_delete( :type force_delete: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. +<<<<<<< HEAD :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -519,6 +765,17 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] +======= + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -536,14 +793,33 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) +<<<<<<< HEAD kwargs.pop('error_map', None) +======= + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) +>>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) +<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -555,6 +831,7 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @@ -567,6 +844,19 @@ def list( cluster_name: str, **kwargs: Any ) -> Iterable["_models.ExtensionsList"]: +======= + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ExtensionsList"] +>>>>>>> 331f997c (updating to the latest vendored sdk) """List all Extensions in the cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -576,14 +866,22 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionsList or the result of cls(response) +<<<<<<< HEAD :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionsList] +======= + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionsList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionsList"] @@ -591,6 +889,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -622,6 +921,40 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionsList", pipeline_response) +======= + api_version = "2021-05-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ExtensionsList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -634,13 +967,21 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_location_extension_types_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_location_extension_types_operations.py index 5a8c204da5e..15282cd28e0 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_location_extension_types_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_location_extension_types_operations.py @@ -5,58 +5,23 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace +from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models -from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - -def build_list_request( - subscription_id: str, - location: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2021-05-01-preview" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/locations/{location}/extensionTypes') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "location": _SERIALIZER.url("location", location, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class LocationExtensionTypesOperations(object): """LocationExtensionTypesOperations operations. @@ -80,20 +45,19 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config - @distributed_trace def list( self, - location: str, - **kwargs: Any - ) -> Iterable["_models.ExtensionTypeList"]: + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ExtensionTypeList"] """List all Extension Types. :param location: extension location. :type location: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionTypeList or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionTypeList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionTypeList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionTypeList"] @@ -101,31 +65,35 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - location=location, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): - deserialized = self._deserialize("ExtensionTypeList", pipeline_response) + deserialized = self._deserialize('ExtensionTypeList', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -138,13 +106,12 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_operation_status_operations.py index c1cdf65ac6d..2625bdfc61c 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_operation_status_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_operation_status_operations.py @@ -5,13 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +======= +from typing import TYPE_CHECKING +>>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -106,6 +111,19 @@ def build_get_request( headers=header_parameters, **kwargs ) +======= +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +>>>>>>> 331f997c (updating to the latest vendored sdk) class OperationStatusOperations(object): """OperationStatusOperations operations. @@ -129,6 +147,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace def list( self, @@ -138,6 +157,17 @@ def list( cluster_name: str, **kwargs: Any ) -> Iterable["_models.OperationStatusList"]: +======= + def list( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.OperationStatusList"] +>>>>>>> 331f997c (updating to the latest vendored sdk) """List Async Operations, currently in progress, in a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -147,14 +177,22 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationStatusList or the result of cls(response) +<<<<<<< HEAD :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.OperationStatusList] +======= + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.OperationStatusList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusList"] @@ -162,6 +200,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -193,6 +232,40 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("OperationStatusList", pipeline_response) +======= + api_version = "2021-05-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationStatusList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -205,18 +278,27 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/operations'} # type: ignore +<<<<<<< HEAD @distributed_trace def get( self, @@ -228,6 +310,19 @@ def get( operation_id: str, **kwargs: Any ) -> "_models.OperationStatusResult": +======= + def get( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.OperationStatusResult" +>>>>>>> 331f997c (updating to the latest vendored sdk) """Get Async Operation status. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -237,8 +332,12 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -255,6 +354,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -270,12 +370,43 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OperationStatusResult', pipeline_response) @@ -284,6 +415,10 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_operations.py index 6fd3ea82cea..7df95b40c3f 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_operations.py @@ -5,13 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +======= +from typing import TYPE_CHECKING +>>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -49,6 +54,19 @@ def build_list_request( headers=header_parameters, **kwargs ) +======= +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +>>>>>>> 331f997c (updating to the latest vendored sdk) class Operations(object): """Operations operations. @@ -72,6 +90,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace def list( self, @@ -84,6 +103,18 @@ def list( cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ResourceProviderOperationList] +======= + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceProviderOperationList"] + """List all the available operations the KubernetesConfiguration resource provider supports. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ResourceProviderOperationList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -91,6 +122,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -112,6 +144,32 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) +======= + api_version = "2021-05-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,13 +182,21 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_source_control_configurations_operations.py index f79edc22996..1dd2151f8b3 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_source_control_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_source_control_configurations_operations.py @@ -5,13 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +======= +from typing import TYPE_CHECKING +>>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest @@ -198,6 +203,21 @@ def build_list_request( headers=header_parameters, **kwargs ) +======= +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +>>>>>>> 331f997c (updating to the latest vendored sdk) class SourceControlConfigurationsOperations(object): """SourceControlConfigurationsOperations operations. @@ -221,6 +241,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace def get( self, @@ -231,6 +252,18 @@ def get( source_control_configuration_name: str, **kwargs: Any ) -> "_models.SourceControlConfiguration": +======= + def get( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + source_control_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SourceControlConfiguration" +>>>>>>> 331f997c (updating to the latest vendored sdk) """Gets details of the Source Control Configuration. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -240,16 +273,24 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) +<<<<<<< HEAD :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration +======= + :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -257,6 +298,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -271,12 +313,42 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) @@ -285,6 +357,7 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -300,6 +373,21 @@ def create_or_update( source_control_configuration: "_models.SourceControlConfiguration", **kwargs: Any ) -> "_models.SourceControlConfiguration": +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + source_control_configuration_name, # type: str + source_control_configuration, # type: "_models.SourceControlConfiguration" + **kwargs # type: Any + ): + # type: (...) -> "_models.SourceControlConfiguration" +>>>>>>> 331f997c (updating to the latest vendored sdk) """Create a new Kubernetes Source Control Configuration. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -309,19 +397,30 @@ def create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. +<<<<<<< HEAD :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration +======= + :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -329,6 +428,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -348,12 +448,47 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -366,6 +501,7 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -379,11 +515,26 @@ def _delete_initial( source_control_configuration_name: str, **kwargs: Any ) -> None: +======= + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + source_control_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_delete_request_initial( @@ -398,18 +549,50 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore +<<<<<<< HEAD @distributed_trace def begin_delete( @@ -421,6 +604,18 @@ def begin_delete( source_control_configuration_name: str, **kwargs: Any ) -> LROPoller[None]: +======= + def begin_delete( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + source_control_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] +>>>>>>> 331f997c (updating to the latest vendored sdk) """This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from the source repo. @@ -431,14 +626,19 @@ def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. +<<<<<<< HEAD :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -450,6 +650,17 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] +======= + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -466,14 +677,33 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) +<<<<<<< HEAD kwargs.pop('error_map', None) +======= + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) +>>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) +<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -485,6 +715,7 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -497,6 +728,19 @@ def list( cluster_name: str, **kwargs: Any ) -> Iterable["_models.SourceControlConfigurationList"]: +======= + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SourceControlConfigurationList"] +>>>>>>> 331f997c (updating to the latest vendored sdk) """List all Source Control Configurations. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -506,6 +750,7 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -515,6 +760,14 @@ def list( cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfigurationList] +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SourceControlConfigurationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfigurationList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfigurationList"] @@ -522,6 +775,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -553,6 +807,40 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("SourceControlConfigurationList", pipeline_response) +======= + api_version = "2021-05-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SourceControlConfigurationList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -565,13 +853,21 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/__init__.py index e9096303633..fc12f19c5a1 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/__init__.py @@ -12,7 +12,15 @@ __version__ = VERSION __all__ = ['SourceControlConfigurationClient'] +<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() +======= +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/_configuration.py index b83d2cdd71b..5cd5fd49fc4 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/_configuration.py @@ -6,16 +6,29 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +======= +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy +>>>>>>> 331f997c (updating to the latest vendored sdk) from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports +<<<<<<< HEAD +======= + from typing import Any + +>>>>>>> 331f997c (updating to the latest vendored sdk) from azure.core.credentials import TokenCredential @@ -33,15 +46,27 @@ class SourceControlConfigurationClientConfiguration(Configuration): def __init__( self, +<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, **kwargs: Any ) -> None: super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +======= + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None +>>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") +<<<<<<< HEAD +======= + super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -65,4 +90,8 @@ 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: +<<<<<<< HEAD self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) +======= + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/_source_control_configuration_client.py index 537f5bba325..8bd2f1fbb4e 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/_source_control_configuration_client.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from copy import deepcopy from typing import Any, Optional, TYPE_CHECKING @@ -30,30 +31,76 @@ class SourceControlConfigurationClient: :ivar operation_status: OperationStatusOperations operations :vartype operation_status: azure.mgmt.kubernetesconfiguration.v2021_09_01.operations.OperationStatusOperations +======= +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + 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 Operations +from . import models + + +class SourceControlConfigurationClient(object): + """KubernetesConfiguration Client. + + :ivar extensions: ExtensionsOperations operations + :vartype extensions: azure.mgmt.kubernetesconfiguration.v2021_09_01.operations.ExtensionsOperations + :ivar operation_status: OperationStatusOperations operations + :vartype operation_status: azure.mgmt.kubernetesconfiguration.v2021_09_01.operations.OperationStatusOperations +>>>>>>> 331f997c (updating to the latest vendored sdk) :ivar operations: Operations operations :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_09_01.operations.Operations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str +<<<<<<< HEAD :param base_url: Service URL. Default value is 'https://management.azure.com'. :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. +======= + :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. +>>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, +<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) +======= + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) +<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -86,6 +133,35 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) +======= + 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.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 +>>>>>>> 331f997c (updating to the latest vendored sdk) def close(self): # type: () -> None diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/__init__.py index 5f583276b4e..5951024da8e 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/__init__.py @@ -8,8 +8,11 @@ from ._source_control_configuration_client import SourceControlConfigurationClient __all__ = ['SourceControlConfigurationClient'] +<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/_configuration.py index 710846e073d..48cd4d60b2a 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/_configuration.py @@ -10,7 +10,11 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +<<<<<<< HEAD from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy +======= +from azure.mgmt.core.policies import ARMHttpLoggingPolicy +>>>>>>> 331f997c (updating to the latest vendored sdk) from .._version import VERSION @@ -37,11 +41,18 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: +<<<<<<< HEAD super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") +<<<<<<< HEAD +======= + super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -64,4 +75,8 @@ 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: +<<<<<<< HEAD self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) +======= + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/_source_control_configuration_client.py index 96bdeb10bc7..b534e0e1c29 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/_source_control_configuration_client.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from copy import deepcopy from typing import Any, Awaitable, Optional, TYPE_CHECKING @@ -17,10 +18,19 @@ from ._configuration import SourceControlConfigurationClientConfiguration from .operations import ExtensionsOperations, OperationStatusOperations, Operations +======= +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 + +>>>>>>> 331f997c (updating to the latest vendored sdk) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential +<<<<<<< HEAD class SourceControlConfigurationClient: """KubernetesConfiguration Client. @@ -30,30 +40,61 @@ class SourceControlConfigurationClient: :ivar operation_status: OperationStatusOperations operations :vartype operation_status: azure.mgmt.kubernetesconfiguration.v2021_09_01.aio.operations.OperationStatusOperations +======= +from ._configuration import SourceControlConfigurationClientConfiguration +from .operations import ExtensionsOperations +from .operations import OperationStatusOperations +from .operations import Operations +from .. import models + + +class SourceControlConfigurationClient(object): + """KubernetesConfiguration Client. + + :ivar extensions: ExtensionsOperations operations + :vartype extensions: azure.mgmt.kubernetesconfiguration.v2021_09_01.aio.operations.ExtensionsOperations + :ivar operation_status: OperationStatusOperations operations + :vartype operation_status: azure.mgmt.kubernetesconfiguration.v2021_09_01.aio.operations.OperationStatusOperations +>>>>>>> 331f997c (updating to the latest vendored sdk) :ivar operations: Operations operations :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_09_01.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 ID of the target subscription. :type subscription_id: str +<<<<<<< HEAD :param base_url: Service URL. Default value is 'https://management.azure.com'. :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. +======= + :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. +>>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, +<<<<<<< HEAD base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) +======= + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) +<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -86,6 +127,34 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) +======= + 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.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 +>>>>>>> 331f997c (updating to the latest vendored sdk) async def close(self) -> None: await self._client.close() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_extensions_operations.py index 46475d98ddf..c6c3c4f9d16 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_extensions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_extensions_operations.py @@ -5,24 +5,19 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._vendor import _convert_request -from ...operations._extensions_operations import build_create_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial + T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -63,31 +58,42 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(extension, 'Extension') + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - extension_name=extension_name, - content_type=content_type, - json=_json, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(extension, 'Extension') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize('Extension', pipeline_response) @@ -99,11 +105,8 @@ async def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - - @distributed_trace_async async def begin_create( self, resource_group_name: str, @@ -123,8 +126,7 @@ async def begin_create( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or - ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -133,20 +135,15 @@ async def begin_create( :type extension: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Extension :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Extension or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Extension] - :raises: ~azure.core.exceptions.HttpResponseError + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] lro_delay = kwargs.pop( 'polling_interval', @@ -161,21 +158,30 @@ async def begin_create( cluster_name=cluster_name, extension_name=extension_name, extension=extension, - content_type=content_type, cls=lambda x,y,z: x, **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): - response = pipeline_response.http_response deserialized = self._deserialize('Extension', pipeline_response) + if cls: return cls(pipeline_response, deserialized, {}) return deserialized + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -187,10 +193,8 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - @distributed_trace_async async def get( self, resource_group_name: str, @@ -209,8 +213,7 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or - ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -225,26 +228,36 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - extension_name=extension_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Extension', pipeline_response) @@ -253,10 +266,8 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - async def _delete_initial( self, resource_group_name: str, @@ -272,35 +283,45 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - extension_name=extension_name, - force_delete=force_delete, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if force_delete is not None: + query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool') + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - - @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -321,8 +342,7 @@ async def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or - ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -332,17 +352,15 @@ async def begin_delete( :type force_delete: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -360,14 +378,24 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -379,7 +407,6 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore async def _update_initial( @@ -394,34 +421,47 @@ async def _update_initial( ) -> "_models.Extension": cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: lambda response: ResourceExistsError(response=response, model=self._deserialize(_models.ErrorResponse, response), error_format=ARMErrorFormat), } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(patch_extension, 'PatchExtension') + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - extension_name=extension_name, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(patch_extension, 'PatchExtension') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Extension', pipeline_response) @@ -429,11 +469,8 @@ async def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - - @distributed_trace_async async def begin_update( self, resource_group_name: str, @@ -453,8 +490,7 @@ async def begin_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or - ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -463,20 +499,15 @@ async def begin_update( :type patch_extension: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.PatchExtension :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Extension or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Extension] - :raises: ~azure.core.exceptions.HttpResponseError + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] lro_delay = kwargs.pop( 'polling_interval', @@ -491,21 +522,30 @@ async def begin_update( cluster_name=cluster_name, extension_name=extension_name, patch_extension=patch_extension, - content_type=content_type, cls=lambda x,y,z: x, **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): - response = pipeline_response.http_response deserialized = self._deserialize('Extension', pipeline_response) + if cls: return cls(pipeline_response, deserialized, {}) return deserialized + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -517,10 +557,8 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - @distributed_trace def list( self, resource_group_name: str, @@ -538,14 +576,12 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or - ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionsList or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ExtensionsList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ExtensionsList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionsList"] @@ -553,37 +589,38 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-09-01" + accept = "application/json" + def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): - deserialized = self._deserialize("ExtensionsList", pipeline_response) + deserialized = self._deserialize('ExtensionsList', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -596,13 +633,12 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_operation_status_operations.py index 0d2cb035b00..61fca2984db 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_operation_status_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_operation_status_operations.py @@ -5,22 +5,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ..._vendor import _convert_request -from ...operations._operation_status_operations import build_get_request, build_list_request + T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +41,6 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config - @distributed_trace def list( self, resource_group_name: str, @@ -64,14 +58,12 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or - ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationStatusList or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.OperationStatusList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.OperationStatusList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusList"] @@ -79,37 +71,38 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-09-01" + accept = "application/json" + def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationStatusList", pipeline_response) + deserialized = self._deserialize('OperationStatusList', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,19 +115,17 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/operations'} # type: ignore - @distributed_trace_async async def get( self, resource_group_name: str, @@ -154,8 +145,7 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or - ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -172,27 +162,37 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - extension_name=extension_name, - operation_id=operation_id, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OperationStatusResult', pipeline_response) @@ -201,6 +201,4 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore - diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_operations.py index 2113e3798fe..ed49ac721a8 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_operations.py @@ -5,13 +5,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -21,6 +25,13 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operations import build_list_request +======= +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +>>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +57,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, **kwargs: Any @@ -55,10 +69,15 @@ def list( this api-version. :keyword callable cls: A custom type or function that will be passed the direct response +<<<<<<< HEAD :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ResourceProviderOperationList] +======= + :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ResourceProviderOperationList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -66,6 +85,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -87,6 +107,32 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) +======= + api_version = "2021-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -99,13 +145,21 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/__init__.py index 01a45e76c93..2bcf3a10bde 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/__init__.py @@ -6,27 +6,48 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._models_py3 import ErrorAdditionalInfo -from ._models_py3 import ErrorDetail -from ._models_py3 import ErrorResponse -from ._models_py3 import Extension -from ._models_py3 import ExtensionPropertiesAksAssignedIdentity -from ._models_py3 import ExtensionStatus -from ._models_py3 import ExtensionsList -from ._models_py3 import Identity -from ._models_py3 import OperationStatusList -from ._models_py3 import OperationStatusResult -from ._models_py3 import PatchExtension -from ._models_py3 import ProxyResource -from ._models_py3 import Resource -from ._models_py3 import ResourceProviderOperation -from ._models_py3 import ResourceProviderOperationDisplay -from ._models_py3 import ResourceProviderOperationList -from ._models_py3 import Scope -from ._models_py3 import ScopeCluster -from ._models_py3 import ScopeNamespace -from ._models_py3 import SystemData - +try: + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse + from ._models_py3 import Extension + from ._models_py3 import ExtensionPropertiesAksAssignedIdentity + from ._models_py3 import ExtensionStatus + from ._models_py3 import ExtensionsList + from ._models_py3 import Identity + from ._models_py3 import OperationStatusList + from ._models_py3 import OperationStatusResult + from ._models_py3 import PatchExtension + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import ResourceProviderOperation + from ._models_py3 import ResourceProviderOperationDisplay + from ._models_py3 import ResourceProviderOperationList + from ._models_py3 import Scope + from ._models_py3 import ScopeCluster + from ._models_py3 import ScopeNamespace + from ._models_py3 import SystemData +except (SyntaxError, ImportError): + from ._models import ErrorAdditionalInfo # type: ignore + from ._models import ErrorDetail # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import Extension # type: ignore + from ._models import ExtensionPropertiesAksAssignedIdentity # type: ignore + from ._models import ExtensionStatus # type: ignore + from ._models import ExtensionsList # type: ignore + from ._models import Identity # type: ignore + from ._models import OperationStatusList # type: ignore + from ._models import OperationStatusResult # type: ignore + from ._models import PatchExtension # type: ignore + from ._models import ProxyResource # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceProviderOperation # type: ignore + from ._models import ResourceProviderOperationDisplay # type: ignore + from ._models import ResourceProviderOperationList # type: ignore + from ._models import Scope # type: ignore + from ._models import ScopeCluster # type: ignore + from ._models import ScopeNamespace # type: ignore + from ._models import SystemData # type: ignore from ._source_control_configuration_client_enums import ( CreatedByType, diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_models.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_models.py new file mode 100644 index 00000000000..82ac361f3a2 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_models.py @@ -0,0 +1,739 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(msrest.serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(msrest.serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). + + :param error: The error object. + :type error: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class Extension(ProxyResource): + """The Extension object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param identity: Identity of the Extension resource. + :type identity: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Identity + :ivar system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.SystemData + :param extension_type: Type of the Extension, of which this resource is an instance of. It + must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the + Extension publisher. + :type extension_type: str + :param auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade + of minor version, or not. + :type auto_upgrade_minor_version: bool + :param release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. + Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :type release_train: str + :param version: Version of the extension for this extension, if it is 'pinned' to a specific + version. autoUpgradeMinorVersion must be 'false'. + :type version: str + :param scope: Scope at which the extension is installed. + :type scope: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Scope + :param configuration_settings: Configuration settings, as name-value pairs for configuring this + extension. + :type configuration_settings: dict[str, str] + :param configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :type configuration_protected_settings: dict[str, str] + :ivar provisioning_state: The provisioning state of the extension resource. Possible values + include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ProvisioningState + :param statuses: Status from this extension. + :type statuses: list[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ExtensionStatus] + :param error_info: The error detail. + :type error_info: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail + :ivar custom_location_settings: Custom Location settings properties. + :vartype custom_location_settings: dict[str, str] + :ivar package_uri: Uri of the Helm package. + :vartype package_uri: str + :param aks_assigned_identity: Identity of the Extension resource in an AKS cluster. + :type aks_assigned_identity: + ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ExtensionPropertiesAksAssignedIdentity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'custom_location_settings': {'readonly': True}, + 'package_uri': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'extension_type': {'key': 'properties.extensionType', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'release_train': {'key': 'properties.releaseTrain', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'Scope'}, + 'configuration_settings': {'key': 'properties.configurationSettings', 'type': '{str}'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'statuses': {'key': 'properties.statuses', 'type': '[ExtensionStatus]'}, + 'error_info': {'key': 'properties.errorInfo', 'type': 'ErrorDetail'}, + 'custom_location_settings': {'key': 'properties.customLocationSettings', 'type': '{str}'}, + 'package_uri': {'key': 'properties.packageUri', 'type': 'str'}, + 'aks_assigned_identity': {'key': 'properties.aksAssignedIdentity', 'type': 'ExtensionPropertiesAksAssignedIdentity'}, + } + + def __init__( + self, + **kwargs + ): + super(Extension, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.system_data = None + self.extension_type = kwargs.get('extension_type', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', True) + self.release_train = kwargs.get('release_train', "Stable") + self.version = kwargs.get('version', None) + self.scope = kwargs.get('scope', None) + self.configuration_settings = kwargs.get('configuration_settings', None) + self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) + self.provisioning_state = None + self.statuses = kwargs.get('statuses', None) + self.error_info = kwargs.get('error_info', None) + self.custom_location_settings = None + self.package_uri = None + self.aks_assigned_identity = kwargs.get('aks_assigned_identity', None) + + +class ExtensionPropertiesAksAssignedIdentity(msrest.serialization.Model): + """Identity of the Extension resource in an AKS cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. The only acceptable values to pass in are None and + "SystemAssigned". The default value is None. + :type type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionPropertiesAksAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + + +class ExtensionsList(msrest.serialization.Model): + """Result of the request to list Extensions. It contains a list of Extension objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Extensions within a Kubernetes cluster. + :vartype value: list[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Extension] + :ivar next_link: URL to get the next set of extension objects, if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Extension]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionsList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ExtensionStatus(msrest.serialization.Model): + """Status from the extension. + + :param code: Status code provided by the Extension. + :type code: str + :param display_status: Short description of status of the extension. + :type display_status: str + :param level: Level of the status. Possible values include: "Error", "Warning", "Information". + Default value: "Information". + :type level: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.LevelType + :param message: Detailed message of the status from the Extension. + :type message: str + :param time: DateLiteral (per ISO8601) noting the time of installation status. + :type time: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionStatus, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.display_status = kwargs.get('display_status', None) + self.level = kwargs.get('level', "Information") + self.message = kwargs.get('message', None) + self.time = kwargs.get('time', None) + + +class Identity(msrest.serialization.Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. The only acceptable values to pass in are None and + "SystemAssigned". The default value is None. + :type type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + + +class OperationStatusList(msrest.serialization.Model): + """The async operations in progress, in the cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of async operations in progress, in the cluster. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.OperationStatusResult] + :ivar next_link: URL to get the next set of Operation Result objects, if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OperationStatusResult]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationStatusList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class OperationStatusResult(msrest.serialization.Model): + """The current status of an async operation. + + All required parameters must be populated in order to send to Azure. + + :param id: Fully qualified ID for the async operation. + :type id: str + :param name: Name of the async operation. + :type name: str + :param status: Required. Operation status. + :type status: str + :param properties: Additional information, if available. + :type properties: dict[str, str] + :param error: The error detail. + :type error: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail + """ + + _validation = { + 'status': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationStatusResult, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.status = kwargs['status'] + self.properties = kwargs.get('properties', None) + self.error = kwargs.get('error', None) + + +class PatchExtension(msrest.serialization.Model): + """The Extension Patch Request object. + + :param auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade + of minor version, or not. + :type auto_upgrade_minor_version: bool + :param release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. + Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :type release_train: str + :param version: Version of the extension for this extension, if it is 'pinned' to a specific + version. autoUpgradeMinorVersion must be 'false'. + :type version: str + :param configuration_settings: Configuration settings, as name-value pairs for configuring this + extension. + :type configuration_settings: dict[str, str] + :param configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :type configuration_protected_settings: dict[str, str] + """ + + _attribute_map = { + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'release_train': {'key': 'properties.releaseTrain', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'configuration_settings': {'key': 'properties.configurationSettings', 'type': '{str}'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(PatchExtension, self).__init__(**kwargs) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', True) + self.release_train = kwargs.get('release_train', "Stable") + self.version = kwargs.get('version', None) + self.configuration_settings = kwargs.get('configuration_settings', None) + self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) + + +class ResourceProviderOperation(msrest.serialization.Model): + """Supported operation of this resource provider. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: Operation name, in format of {provider}/{resource}/{operation}. + :type name: str + :param display: Display metadata associated with the operation. + :type display: + ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ResourceProviderOperationDisplay + :ivar is_data_action: The flag that indicates whether the operation applies to data plane. + :vartype is_data_action: bool + :ivar origin: Origin of the operation. + :vartype origin: str + """ + + _validation = { + 'is_data_action': {'readonly': True}, + 'origin': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.is_data_action = None + self.origin = None + + +class ResourceProviderOperationDisplay(msrest.serialization.Model): + """Display metadata associated with the operation. + + :param provider: Resource provider: Microsoft KubernetesConfiguration. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class ResourceProviderOperationList(msrest.serialization.Model): + """Result of the request to list operations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: List of operations supported by this resource provider. + :type value: + list[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ResourceProviderOperation] + :ivar next_link: URL to the next set of results, if any. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperationList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class Scope(msrest.serialization.Model): + """Scope of the extension. It can be either Cluster or Namespace; but not both. + + :param cluster: Specifies that the scope of the extension is Cluster. + :type cluster: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ScopeCluster + :param namespace: Specifies that the scope of the extension is Namespace. + :type namespace: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ScopeNamespace + """ + + _attribute_map = { + 'cluster': {'key': 'cluster', 'type': 'ScopeCluster'}, + 'namespace': {'key': 'namespace', 'type': 'ScopeNamespace'}, + } + + def __init__( + self, + **kwargs + ): + super(Scope, self).__init__(**kwargs) + self.cluster = kwargs.get('cluster', None) + self.namespace = kwargs.get('namespace', None) + + +class ScopeCluster(msrest.serialization.Model): + """Specifies that the scope of the extension is Cluster. + + :param release_namespace: Namespace where the extension Release must be placed, for a Cluster + scoped extension. If this namespace does not exist, it will be created. + :type release_namespace: str + """ + + _attribute_map = { + 'release_namespace': {'key': 'releaseNamespace', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ScopeCluster, self).__init__(**kwargs) + self.release_namespace = kwargs.get('release_namespace', None) + + +class ScopeNamespace(msrest.serialization.Model): + """Specifies that the scope of the extension is Namespace. + + :param target_namespace: Namespace where the extension will be created for an Namespace scoped + extension. If this namespace does not exist, it will be created. + :type target_namespace: str + """ + + _attribute_map = { + 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ScopeNamespace, self).__init__(**kwargs) + self.target_namespace = kwargs.get('target_namespace', None) + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_models_py3.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_models_py3.py index e60feb17869..dfc2c01aab6 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_models_py3.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_models_py3.py @@ -40,8 +40,6 @@ def __init__( self, **kwargs ): - """ - """ super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -85,8 +83,6 @@ def __init__( self, **kwargs ): - """ - """ super(ErrorDetail, self).__init__(**kwargs) self.code = None self.message = None @@ -98,8 +94,8 @@ def __init__( class ErrorResponse(msrest.serialization.Model): """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - :ivar error: The error object. - :vartype error: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail + :param error: The error object. + :type error: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail """ _attribute_map = { @@ -112,10 +108,6 @@ def __init__( error: Optional["ErrorDetail"] = None, **kwargs ): - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail - """ super(ErrorResponse, self).__init__(**kwargs) self.error = error @@ -151,8 +143,6 @@ def __init__( self, **kwargs ): - """ - """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -190,8 +180,6 @@ def __init__( self, **kwargs ): - """ - """ super(ProxyResource, self).__init__(**kwargs) @@ -208,46 +196,46 @@ class Extension(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar identity: Identity of the Extension resource. - :vartype identity: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Identity + :param identity: Identity of the Extension resource. + :type identity: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Identity :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.SystemData - :ivar extension_type: Type of the Extension, of which this resource is an instance of. It must - be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the + :param extension_type: Type of the Extension, of which this resource is an instance of. It + must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the Extension publisher. - :vartype extension_type: str - :ivar auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade + :type extension_type: str + :param auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade of minor version, or not. - :vartype auto_upgrade_minor_version: bool - :ivar release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. Stable, - Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. - :vartype release_train: str - :ivar version: Version of the extension for this extension, if it is 'pinned' to a specific + :type auto_upgrade_minor_version: bool + :param release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. + Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :type release_train: str + :param version: Version of the extension for this extension, if it is 'pinned' to a specific version. autoUpgradeMinorVersion must be 'false'. - :vartype version: str - :ivar scope: Scope at which the extension is installed. - :vartype scope: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Scope - :ivar configuration_settings: Configuration settings, as name-value pairs for configuring this + :type version: str + :param scope: Scope at which the extension is installed. + :type scope: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Scope + :param configuration_settings: Configuration settings, as name-value pairs for configuring this extension. - :vartype configuration_settings: dict[str, str] - :ivar configuration_protected_settings: Configuration settings that are sensitive, as + :type configuration_settings: dict[str, str] + :param configuration_protected_settings: Configuration settings that are sensitive, as name-value pairs for configuring this extension. - :vartype configuration_protected_settings: dict[str, str] + :type configuration_protected_settings: dict[str, str] :ivar provisioning_state: The provisioning state of the extension resource. Possible values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". :vartype provisioning_state: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ProvisioningState - :ivar statuses: Status from this extension. - :vartype statuses: list[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ExtensionStatus] - :ivar error_info: The error detail. - :vartype error_info: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail + :param statuses: Status from this extension. + :type statuses: list[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ExtensionStatus] + :param error_info: The error detail. + :type error_info: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail :ivar custom_location_settings: Custom Location settings properties. :vartype custom_location_settings: dict[str, str] :ivar package_uri: Uri of the Helm package. :vartype package_uri: str - :ivar aks_assigned_identity: Identity of the Extension resource in an AKS cluster. - :vartype aks_assigned_identity: + :param aks_assigned_identity: Identity of the Extension resource in an AKS cluster. + :type aks_assigned_identity: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ExtensionPropertiesAksAssignedIdentity """ @@ -298,39 +286,6 @@ def __init__( aks_assigned_identity: Optional["ExtensionPropertiesAksAssignedIdentity"] = None, **kwargs ): - """ - :keyword identity: Identity of the Extension resource. - :paramtype identity: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Identity - :keyword extension_type: Type of the Extension, of which this resource is an instance of. It - must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the - Extension publisher. - :paramtype extension_type: str - :keyword auto_upgrade_minor_version: Flag to note if this extension participates in auto - upgrade of minor version, or not. - :paramtype auto_upgrade_minor_version: bool - :keyword release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. - Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. - :paramtype release_train: str - :keyword version: Version of the extension for this extension, if it is 'pinned' to a specific - version. autoUpgradeMinorVersion must be 'false'. - :paramtype version: str - :keyword scope: Scope at which the extension is installed. - :paramtype scope: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Scope - :keyword configuration_settings: Configuration settings, as name-value pairs for configuring - this extension. - :paramtype configuration_settings: dict[str, str] - :keyword configuration_protected_settings: Configuration settings that are sensitive, as - name-value pairs for configuring this extension. - :paramtype configuration_protected_settings: dict[str, str] - :keyword statuses: Status from this extension. - :paramtype statuses: - list[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ExtensionStatus] - :keyword error_info: The error detail. - :paramtype error_info: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail - :keyword aks_assigned_identity: Identity of the Extension resource in an AKS cluster. - :paramtype aks_assigned_identity: - ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ExtensionPropertiesAksAssignedIdentity - """ super(Extension, self).__init__(**kwargs) self.identity = identity self.system_data = None @@ -358,9 +313,9 @@ class ExtensionPropertiesAksAssignedIdentity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: The identity type. The only acceptable values to pass in are None and + :param type: The identity type. The only acceptable values to pass in are None and "SystemAssigned". The default value is None. - :vartype type: str + :type type: str """ _validation = { @@ -380,11 +335,6 @@ def __init__( type: Optional[str] = None, **kwargs ): - """ - :keyword type: The identity type. The only acceptable values to pass in are None and - "SystemAssigned". The default value is None. - :paramtype type: str - """ super(ExtensionPropertiesAksAssignedIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -416,8 +366,6 @@ def __init__( self, **kwargs ): - """ - """ super(ExtensionsList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -426,17 +374,17 @@ def __init__( class ExtensionStatus(msrest.serialization.Model): """Status from the extension. - :ivar code: Status code provided by the Extension. - :vartype code: str - :ivar display_status: Short description of status of the extension. - :vartype display_status: str - :ivar level: Level of the status. Possible values include: "Error", "Warning", "Information". + :param code: Status code provided by the Extension. + :type code: str + :param display_status: Short description of status of the extension. + :type display_status: str + :param level: Level of the status. Possible values include: "Error", "Warning", "Information". Default value: "Information". - :vartype level: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.LevelType - :ivar message: Detailed message of the status from the Extension. - :vartype message: str - :ivar time: DateLiteral (per ISO8601) noting the time of installation status. - :vartype time: str + :type level: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.LevelType + :param message: Detailed message of the status from the Extension. + :type message: str + :param time: DateLiteral (per ISO8601) noting the time of installation status. + :type time: str """ _attribute_map = { @@ -457,19 +405,6 @@ def __init__( time: Optional[str] = None, **kwargs ): - """ - :keyword code: Status code provided by the Extension. - :paramtype code: str - :keyword display_status: Short description of status of the extension. - :paramtype display_status: str - :keyword level: Level of the status. Possible values include: "Error", "Warning", - "Information". Default value: "Information". - :paramtype level: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.LevelType - :keyword message: Detailed message of the status from the Extension. - :paramtype message: str - :keyword time: DateLiteral (per ISO8601) noting the time of installation status. - :paramtype time: str - """ super(ExtensionStatus, self).__init__(**kwargs) self.code = code self.display_status = display_status @@ -487,9 +422,9 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: The identity type. The only acceptable values to pass in are None and + :param type: The identity type. The only acceptable values to pass in are None and "SystemAssigned". The default value is None. - :vartype type: str + :type type: str """ _validation = { @@ -509,11 +444,6 @@ def __init__( type: Optional[str] = None, **kwargs ): - """ - :keyword type: The identity type. The only acceptable values to pass in are None and - "SystemAssigned". The default value is None. - :paramtype type: str - """ super(Identity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -546,8 +476,6 @@ def __init__( self, **kwargs ): - """ - """ super(OperationStatusList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -558,16 +486,16 @@ class OperationStatusResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified ID for the async operation. - :vartype id: str - :ivar name: Name of the async operation. - :vartype name: str - :ivar status: Required. Operation status. - :vartype status: str - :ivar properties: Additional information, if available. - :vartype properties: dict[str, str] - :ivar error: The error detail. - :vartype error: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail + :param id: Fully qualified ID for the async operation. + :type id: str + :param name: Name of the async operation. + :type name: str + :param status: Required. Operation status. + :type status: str + :param properties: Additional information, if available. + :type properties: dict[str, str] + :param error: The error detail. + :type error: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail """ _validation = { @@ -592,18 +520,6 @@ def __init__( error: Optional["ErrorDetail"] = None, **kwargs ): - """ - :keyword id: Fully qualified ID for the async operation. - :paramtype id: str - :keyword name: Name of the async operation. - :paramtype name: str - :keyword status: Required. Operation status. - :paramtype status: str - :keyword properties: Additional information, if available. - :paramtype properties: dict[str, str] - :keyword error: The error detail. - :paramtype error: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail - """ super(OperationStatusResult, self).__init__(**kwargs) self.id = id self.name = name @@ -615,21 +531,21 @@ def __init__( class PatchExtension(msrest.serialization.Model): """The Extension Patch Request object. - :ivar auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade + :param auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade of minor version, or not. - :vartype auto_upgrade_minor_version: bool - :ivar release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. Stable, - Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. - :vartype release_train: str - :ivar version: Version of the extension for this extension, if it is 'pinned' to a specific + :type auto_upgrade_minor_version: bool + :param release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. + Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :type release_train: str + :param version: Version of the extension for this extension, if it is 'pinned' to a specific version. autoUpgradeMinorVersion must be 'false'. - :vartype version: str - :ivar configuration_settings: Configuration settings, as name-value pairs for configuring this + :type version: str + :param configuration_settings: Configuration settings, as name-value pairs for configuring this extension. - :vartype configuration_settings: dict[str, str] - :ivar configuration_protected_settings: Configuration settings that are sensitive, as + :type configuration_settings: dict[str, str] + :param configuration_protected_settings: Configuration settings that are sensitive, as name-value pairs for configuring this extension. - :vartype configuration_protected_settings: dict[str, str] + :type configuration_protected_settings: dict[str, str] """ _attribute_map = { @@ -650,23 +566,6 @@ def __init__( configuration_protected_settings: Optional[Dict[str, str]] = None, **kwargs ): - """ - :keyword auto_upgrade_minor_version: Flag to note if this extension participates in auto - upgrade of minor version, or not. - :paramtype auto_upgrade_minor_version: bool - :keyword release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. - Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. - :paramtype release_train: str - :keyword version: Version of the extension for this extension, if it is 'pinned' to a specific - version. autoUpgradeMinorVersion must be 'false'. - :paramtype version: str - :keyword configuration_settings: Configuration settings, as name-value pairs for configuring - this extension. - :paramtype configuration_settings: dict[str, str] - :keyword configuration_protected_settings: Configuration settings that are sensitive, as - name-value pairs for configuring this extension. - :paramtype configuration_protected_settings: dict[str, str] - """ super(PatchExtension, self).__init__(**kwargs) self.auto_upgrade_minor_version = auto_upgrade_minor_version self.release_train = release_train @@ -680,10 +579,10 @@ class ResourceProviderOperation(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Operation name, in format of {provider}/{resource}/{operation}. - :vartype name: str - :ivar display: Display metadata associated with the operation. - :vartype display: + :param name: Operation name, in format of {provider}/{resource}/{operation}. + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ResourceProviderOperationDisplay :ivar is_data_action: The flag that indicates whether the operation applies to data plane. :vartype is_data_action: bool @@ -710,13 +609,6 @@ def __init__( display: Optional["ResourceProviderOperationDisplay"] = None, **kwargs ): - """ - :keyword name: Operation name, in format of {provider}/{resource}/{operation}. - :paramtype name: str - :keyword display: Display metadata associated with the operation. - :paramtype display: - ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ResourceProviderOperationDisplay - """ super(ResourceProviderOperation, self).__init__(**kwargs) self.name = name self.display = display @@ -727,14 +619,14 @@ def __init__( class ResourceProviderOperationDisplay(msrest.serialization.Model): """Display metadata associated with the operation. - :ivar provider: Resource provider: Microsoft KubernetesConfiguration. - :vartype provider: str - :ivar resource: Resource on which the operation is performed. - :vartype resource: str - :ivar operation: Type of operation: get, read, delete, etc. - :vartype operation: str - :ivar description: Description of this operation. - :vartype description: str + :param provider: Resource provider: Microsoft KubernetesConfiguration. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this operation. + :type description: str """ _attribute_map = { @@ -753,16 +645,6 @@ def __init__( description: Optional[str] = None, **kwargs ): - """ - :keyword provider: Resource provider: Microsoft KubernetesConfiguration. - :paramtype provider: str - :keyword resource: Resource on which the operation is performed. - :paramtype resource: str - :keyword operation: Type of operation: get, read, delete, etc. - :paramtype operation: str - :keyword description: Description of this operation. - :paramtype description: str - """ super(ResourceProviderOperationDisplay, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -775,8 +657,8 @@ class ResourceProviderOperationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of operations supported by this resource provider. - :vartype value: + :param value: List of operations supported by this resource provider. + :type value: list[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ResourceProviderOperation] :ivar next_link: URL to the next set of results, if any. :vartype next_link: str @@ -797,11 +679,6 @@ def __init__( value: Optional[List["ResourceProviderOperation"]] = None, **kwargs ): - """ - :keyword value: List of operations supported by this resource provider. - :paramtype value: - list[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ResourceProviderOperation] - """ super(ResourceProviderOperationList, self).__init__(**kwargs) self.value = value self.next_link = None @@ -810,10 +687,10 @@ def __init__( class Scope(msrest.serialization.Model): """Scope of the extension. It can be either Cluster or Namespace; but not both. - :ivar cluster: Specifies that the scope of the extension is Cluster. - :vartype cluster: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ScopeCluster - :ivar namespace: Specifies that the scope of the extension is Namespace. - :vartype namespace: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ScopeNamespace + :param cluster: Specifies that the scope of the extension is Cluster. + :type cluster: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ScopeCluster + :param namespace: Specifies that the scope of the extension is Namespace. + :type namespace: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ScopeNamespace """ _attribute_map = { @@ -828,12 +705,6 @@ def __init__( namespace: Optional["ScopeNamespace"] = None, **kwargs ): - """ - :keyword cluster: Specifies that the scope of the extension is Cluster. - :paramtype cluster: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ScopeCluster - :keyword namespace: Specifies that the scope of the extension is Namespace. - :paramtype namespace: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ScopeNamespace - """ super(Scope, self).__init__(**kwargs) self.cluster = cluster self.namespace = namespace @@ -842,9 +713,9 @@ def __init__( class ScopeCluster(msrest.serialization.Model): """Specifies that the scope of the extension is Cluster. - :ivar release_namespace: Namespace where the extension Release must be placed, for a Cluster + :param release_namespace: Namespace where the extension Release must be placed, for a Cluster scoped extension. If this namespace does not exist, it will be created. - :vartype release_namespace: str + :type release_namespace: str """ _attribute_map = { @@ -857,11 +728,6 @@ def __init__( release_namespace: Optional[str] = None, **kwargs ): - """ - :keyword release_namespace: Namespace where the extension Release must be placed, for a Cluster - scoped extension. If this namespace does not exist, it will be created. - :paramtype release_namespace: str - """ super(ScopeCluster, self).__init__(**kwargs) self.release_namespace = release_namespace @@ -869,9 +735,9 @@ def __init__( class ScopeNamespace(msrest.serialization.Model): """Specifies that the scope of the extension is Namespace. - :ivar target_namespace: Namespace where the extension will be created for an Namespace scoped + :param target_namespace: Namespace where the extension will be created for an Namespace scoped extension. If this namespace does not exist, it will be created. - :vartype target_namespace: str + :type target_namespace: str """ _attribute_map = { @@ -884,11 +750,6 @@ def __init__( target_namespace: Optional[str] = None, **kwargs ): - """ - :keyword target_namespace: Namespace where the extension will be created for an Namespace - scoped extension. If this namespace does not exist, it will be created. - :paramtype target_namespace: str - """ super(ScopeNamespace, self).__init__(**kwargs) self.target_namespace = target_namespace @@ -896,22 +757,22 @@ def __init__( class SystemData(msrest.serialization.Model): """Metadata pertaining to creation and last modification of the resource. - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Possible values include: - "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Possible + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or + :type last_modified_by_type: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime """ _attribute_map = { @@ -934,24 +795,6 @@ def __init__( last_modified_at: Optional[datetime.datetime] = None, **kwargs ): - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or - ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ super(SystemData, self).__init__(**kwargs) self.created_by = created_by self.created_by_type = created_by_type diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_source_control_configuration_client_enums.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_source_control_configuration_client_enums.py index 48f19c25f2c..19b127e8cd4 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_source_control_configuration_client_enums.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_source_control_configuration_client_enums.py @@ -6,12 +6,27 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta from six import with_metaclass -from azure.core import CaseInsensitiveEnumMeta +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) -class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of identity that created the resource. """ @@ -20,17 +35,17 @@ class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" -class Enum0(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class Enum0(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MICROSOFT_CONTAINER_SERVICE = "Microsoft.ContainerService" MICROSOFT_KUBERNETES = "Microsoft.Kubernetes" -class Enum1(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class Enum1(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MANAGED_CLUSTERS = "managedClusters" CONNECTED_CLUSTERS = "connectedClusters" -class LevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class LevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Level of the status. """ @@ -38,7 +53,7 @@ class LevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): WARNING = "Warning" INFORMATION = "Information" -class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The provisioning state of the extension resource. """ diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_extensions_operations.py index 4e718b52671..7517bdd8cd2 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_extensions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_extensions_operations.py @@ -5,253 +5,25 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models -from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - -def build_create_request_initial( - subscription_id: str, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - extension_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any -) -> HttpRequest: - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2021-09-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), - "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), - "extensionName": _SERIALIZER.url("extension_name", extension_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - json=json, - content=content, - **kwargs - ) - - -def build_get_request( - subscription_id: str, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - extension_name: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2021-09-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), - "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), - "extensionName": _SERIALIZER.url("extension_name", extension_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id: str, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - extension_name: str, - *, - force_delete: Optional[bool] = None, - **kwargs: Any -) -> HttpRequest: - api_version = "2021-09-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), - "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), - "extensionName": _SERIALIZER.url("extension_name", extension_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - if force_delete is not None: - query_parameters['forceDelete'] = _SERIALIZER.query("force_delete", force_delete, 'bool') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_update_request_initial( - subscription_id: str, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - extension_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any -) -> HttpRequest: - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2021-09-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), - "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), - "extensionName": _SERIALIZER.url("extension_name", extension_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, - json=json, - content=content, - **kwargs - ) - - -def build_list_request( - subscription_id: str, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2021-09-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), - "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ExtensionsOperations(object): """ExtensionsOperations operations. @@ -277,44 +49,56 @@ def __init__(self, client, config, serializer, deserializer): def _create_initial( self, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - extension_name: str, - extension: "_models.Extension", - **kwargs: Any - ) -> "_models.Extension": + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_name, # type: str + extension, # type: "_models.Extension" + **kwargs # type: Any + ): + # type: (...) -> "_models.Extension" cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(extension, 'Extension') + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - request = build_create_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - extension_name=extension_name, - content_type=content_type, - json=_json, - template_url=self._create_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(extension, 'Extension') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize('Extension', pipeline_response) @@ -326,21 +110,19 @@ def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - - @distributed_trace def begin_create( self, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - extension_name: str, - extension: "_models.Extension", - **kwargs: Any - ) -> LROPoller["_models.Extension"]: + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_name, # type: str + extension, # type: "_models.Extension" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Extension"] """Create a new Kubernetes Cluster Extension. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -350,8 +132,7 @@ def begin_create( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or - ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -360,19 +141,15 @@ def begin_create( :type extension: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Extension :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either Extension or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Extension] - :raises: ~azure.core.exceptions.HttpResponseError + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] lro_delay = kwargs.pop( 'polling_interval', @@ -387,21 +164,30 @@ def begin_create( cluster_name=cluster_name, extension_name=extension_name, extension=extension, - content_type=content_type, cls=lambda x,y,z: x, **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): - response = pipeline_response.http_response deserialized = self._deserialize('Extension', pipeline_response) + if cls: return cls(pipeline_response, deserialized, {}) return deserialized + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -413,19 +199,18 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - @distributed_trace def get( self, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - extension_name: str, - **kwargs: Any - ) -> "_models.Extension": + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Extension" """Gets Kubernetes Cluster Extension. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -435,8 +220,7 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or - ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -451,26 +235,36 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - extension_name=extension_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Extension', pipeline_response) @@ -479,64 +273,74 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - def _delete_initial( self, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - extension_name: str, - force_delete: Optional[bool] = None, - **kwargs: Any - ) -> None: + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_name, # type: str + force_delete=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - extension_name=extension_name, - force_delete=force_delete, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if force_delete is not None: + query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool') + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - - @distributed_trace def begin_delete( self, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - extension_name: str, - force_delete: Optional[bool] = None, - **kwargs: Any - ) -> LROPoller[None]: + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_name, # type: str + force_delete=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. @@ -547,8 +351,7 @@ def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or - ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -558,17 +361,15 @@ def begin_delete( :type force_delete: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -586,14 +387,24 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -605,49 +416,62 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore def _update_initial( self, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - extension_name: str, - patch_extension: "_models.PatchExtension", - **kwargs: Any - ) -> "_models.Extension": + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_name, # type: str + patch_extension, # type: "_models.PatchExtension" + **kwargs # type: Any + ): + # type: (...) -> "_models.Extension" cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: lambda response: ResourceExistsError(response=response, model=self._deserialize(_models.ErrorResponse, response), error_format=ARMErrorFormat), } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(patch_extension, 'PatchExtension') + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - request = build_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - extension_name=extension_name, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(patch_extension, 'PatchExtension') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Extension', pipeline_response) @@ -655,21 +479,19 @@ def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - - @distributed_trace def begin_update( self, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - extension_name: str, - patch_extension: "_models.PatchExtension", - **kwargs: Any - ) -> LROPoller["_models.Extension"]: + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_name, # type: str + patch_extension, # type: "_models.PatchExtension" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Extension"] """Patch an existing Kubernetes Cluster Extension. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -679,8 +501,7 @@ def begin_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or - ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -689,19 +510,15 @@ def begin_update( :type patch_extension: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.PatchExtension :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either Extension or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Extension] - :raises: ~azure.core.exceptions.HttpResponseError + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] lro_delay = kwargs.pop( 'polling_interval', @@ -716,21 +533,30 @@ def begin_update( cluster_name=cluster_name, extension_name=extension_name, patch_extension=patch_extension, - content_type=content_type, cls=lambda x,y,z: x, **kwargs ) + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): - response = pipeline_response.http_response deserialized = self._deserialize('Extension', pipeline_response) + if cls: return cls(pipeline_response, deserialized, {}) return deserialized + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -742,18 +568,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - @distributed_trace def list( self, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - **kwargs: Any - ) -> Iterable["_models.ExtensionsList"]: + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ExtensionsList"] """List all Extensions in the cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -763,14 +588,12 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or - ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionsList or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ExtensionsList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ExtensionsList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionsList"] @@ -778,37 +601,38 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-09-01" + accept = "application/json" + def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): - deserialized = self._deserialize("ExtensionsList", pipeline_response) + deserialized = self._deserialize('ExtensionsList', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -821,13 +645,12 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_operation_status_operations.py index c418a705a30..1343bf36641 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_operation_status_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_operation_status_operations.py @@ -5,107 +5,23 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace +from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models -from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -def build_list_request( - subscription_id: str, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2021-09-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/operations') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), - "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id: str, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - extension_name: str, - operation_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2021-09-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), - "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), - "extensionName": _SERIALIZER.url("extension_name", extension_name, 'str'), - "operationId": _SERIALIZER.url("operation_id", operation_id, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class OperationStatusOperations(object): """OperationStatusOperations operations. @@ -129,15 +45,15 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config - @distributed_trace def list( self, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - **kwargs: Any - ) -> Iterable["_models.OperationStatusList"]: + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.OperationStatusList"] """List Async Operations, currently in progress, in a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -147,14 +63,12 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or - ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationStatusList or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.OperationStatusList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.OperationStatusList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusList"] @@ -162,37 +76,38 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-09-01" + accept = "application/json" + def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): - deserialized = self._deserialize("OperationStatusList", pipeline_response) + deserialized = self._deserialize('OperationStatusList', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -205,29 +120,28 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/operations'} # type: ignore - @distributed_trace def get( self, - resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], - cluster_name: str, - extension_name: str, - operation_id: str, - **kwargs: Any - ) -> "_models.OperationStatusResult": + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.OperationStatusResult" """Get Async Operation status. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -237,8 +151,7 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or - ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -255,27 +168,37 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-09-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_rp=cluster_rp, - cluster_resource_name=cluster_resource_name, - cluster_name=cluster_name, - extension_name=extension_name, - operation_id=operation_id, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OperationStatusResult', pipeline_response) @@ -284,6 +207,4 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore - diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_operations.py index e18d70e2222..1cb21812c9b 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_operations.py @@ -5,50 +5,23 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace +from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models -from .._vendor import _convert_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - -def build_list_request( - **kwargs: Any -) -> HttpRequest: - api_version = "2021-09-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/providers/Microsoft.KubernetesConfiguration/operations') - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class Operations(object): """Operations operations. @@ -72,19 +45,17 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config - @distributed_trace def list( self, - **kwargs: Any - ) -> Iterable["_models.ResourceProviderOperationList"]: + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceProviderOperationList"] """List all the available operations the KubernetesConfiguration resource provider supports, in this api-version. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ResourceProviderOperationList or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ResourceProviderOperationList] + :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ResourceProviderOperationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -92,27 +63,30 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-09-01" + accept = "application/json" + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: - - request = build_list_request( - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: - - request = build_list_request( - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): - deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) + deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -125,13 +99,12 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response - return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/__init__.py index e9096303633..fc12f19c5a1 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/__init__.py @@ -12,7 +12,15 @@ __version__ = VERSION __all__ = ['SourceControlConfigurationClient'] +<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() +======= +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/_configuration.py index b822e7bc318..a9e5a257c51 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/_configuration.py @@ -6,16 +6,29 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +======= +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy +>>>>>>> 331f997c (updating to the latest vendored sdk) from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports +<<<<<<< HEAD +======= + from typing import Any + +>>>>>>> 331f997c (updating to the latest vendored sdk) from azure.core.credentials import TokenCredential @@ -33,15 +46,27 @@ class SourceControlConfigurationClientConfiguration(Configuration): def __init__( self, +<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, **kwargs: Any ) -> None: super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +======= + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None +>>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") +<<<<<<< HEAD +======= + super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -65,4 +90,8 @@ 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: +<<<<<<< HEAD self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) +======= + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/_source_control_configuration_client.py index 7a4739e5d02..f150571b0cb 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/_source_control_configuration_client.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from copy import deepcopy from typing import Any, Optional, TYPE_CHECKING @@ -54,28 +55,97 @@ class SourceControlConfigurationClient: :ivar operations: Operations operations :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.Operations +======= +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + 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 FluxConfigurationsOperations +from .operations import FluxConfigOperationStatusOperations +from .operations import Operations +from . import models + + +class SourceControlConfigurationClient(object): + """KubernetesConfiguration Client. + + :ivar extensions: ExtensionsOperations operations + :vartype extensions: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.ExtensionsOperations + :ivar operation_status: OperationStatusOperations operations + :vartype operation_status: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.OperationStatusOperations + :ivar cluster_extension_type: ClusterExtensionTypeOperations operations + :vartype cluster_extension_type: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.ClusterExtensionTypeOperations + :ivar cluster_extension_types: ClusterExtensionTypesOperations operations + :vartype cluster_extension_types: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.ClusterExtensionTypesOperations + :ivar extension_type_versions: ExtensionTypeVersionsOperations operations + :vartype extension_type_versions: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.ExtensionTypeVersionsOperations + :ivar location_extension_types: LocationExtensionTypesOperations operations + :vartype location_extension_types: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.LocationExtensionTypesOperations + :ivar source_control_configurations: SourceControlConfigurationsOperations operations + :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.SourceControlConfigurationsOperations + :ivar flux_configurations: FluxConfigurationsOperations operations + :vartype flux_configurations: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.FluxConfigurationsOperations + :ivar flux_config_operation_status: FluxConfigOperationStatusOperations operations + :vartype flux_config_operation_status: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.FluxConfigOperationStatusOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.Operations +>>>>>>> 331f997c (updating to the latest vendored sdk) :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str +<<<<<<< HEAD :param base_url: Service URL. Default value is 'https://management.azure.com'. :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. +======= + :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. +>>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, +<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) +======= + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) +<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -115,6 +185,49 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) +======= + 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.flux_configurations = FluxConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.flux_config_operation_status = FluxConfigOperationStatusOperations( + 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 +>>>>>>> 331f997c (updating to the latest vendored sdk) def close(self): # type: () -> None diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/__init__.py index 5f583276b4e..5951024da8e 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/__init__.py @@ -8,8 +8,11 @@ from ._source_control_configuration_client import SourceControlConfigurationClient __all__ = ['SourceControlConfigurationClient'] +<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/_configuration.py index b86d839a94e..95e68899bdb 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/_configuration.py @@ -10,7 +10,11 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +<<<<<<< HEAD from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy +======= +from azure.mgmt.core.policies import ARMHttpLoggingPolicy +>>>>>>> 331f997c (updating to the latest vendored sdk) from .._version import VERSION @@ -37,11 +41,18 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: +<<<<<<< HEAD super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") +<<<<<<< HEAD +======= + super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -64,4 +75,8 @@ 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: +<<<<<<< HEAD self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) +======= + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/_source_control_configuration_client.py index e46bfe1b885..5f4e0aa8592 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/_source_control_configuration_client.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from copy import deepcopy from typing import Any, Awaitable, Optional, TYPE_CHECKING @@ -17,10 +18,19 @@ from ._configuration import SourceControlConfigurationClientConfiguration from .operations import ClusterExtensionTypeOperations, ClusterExtensionTypesOperations, ExtensionTypeVersionsOperations, ExtensionsOperations, FluxConfigOperationStatusOperations, FluxConfigurationsOperations, LocationExtensionTypesOperations, OperationStatusOperations, Operations, SourceControlConfigurationsOperations +======= +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 + +>>>>>>> 331f997c (updating to the latest vendored sdk) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential +<<<<<<< HEAD class SourceControlConfigurationClient: """KubernetesConfiguration Client. @@ -54,28 +64,82 @@ class SourceControlConfigurationClient: :ivar operations: Operations operations :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.aio.operations.Operations +======= +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 FluxConfigurationsOperations +from .operations import FluxConfigOperationStatusOperations +from .operations import Operations +from .. import models + + +class SourceControlConfigurationClient(object): + """KubernetesConfiguration Client. + + :ivar extensions: ExtensionsOperations operations + :vartype extensions: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.aio.operations.ExtensionsOperations + :ivar operation_status: OperationStatusOperations operations + :vartype operation_status: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.aio.operations.OperationStatusOperations + :ivar cluster_extension_type: ClusterExtensionTypeOperations operations + :vartype cluster_extension_type: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.aio.operations.ClusterExtensionTypeOperations + :ivar cluster_extension_types: ClusterExtensionTypesOperations operations + :vartype cluster_extension_types: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.aio.operations.ClusterExtensionTypesOperations + :ivar extension_type_versions: ExtensionTypeVersionsOperations operations + :vartype extension_type_versions: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.aio.operations.ExtensionTypeVersionsOperations + :ivar location_extension_types: LocationExtensionTypesOperations operations + :vartype location_extension_types: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.aio.operations.LocationExtensionTypesOperations + :ivar source_control_configurations: SourceControlConfigurationsOperations operations + :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.aio.operations.SourceControlConfigurationsOperations + :ivar flux_configurations: FluxConfigurationsOperations operations + :vartype flux_configurations: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.aio.operations.FluxConfigurationsOperations + :ivar flux_config_operation_status: FluxConfigOperationStatusOperations operations + :vartype flux_config_operation_status: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.aio.operations.FluxConfigOperationStatusOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.aio.operations.Operations +>>>>>>> 331f997c (updating to the latest vendored sdk) :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str +<<<<<<< HEAD :param base_url: Service URL. Default value is 'https://management.azure.com'. :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. +======= + :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. +>>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, +<<<<<<< HEAD base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) +======= + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) +<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -115,6 +179,48 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) +======= + 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.flux_configurations = FluxConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.flux_config_operation_status = FluxConfigOperationStatusOperations( + 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 +>>>>>>> 331f997c (updating to the latest vendored sdk) async def close(self) -> None: await self._client.close() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_cluster_extension_type_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_cluster_extension_type_operations.py index 0f6ebc8b36a..52a0a496241 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_cluster_extension_type_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_cluster_extension_type_operations.py @@ -5,12 +5,16 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async @@ -19,6 +23,13 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._cluster_extension_type_operations import build_get_request +======= +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +>>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +55,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace_async +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -63,8 +77,12 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_type_name: Extension type name. @@ -79,6 +97,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -93,12 +112,42 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionTypeName': self._serialize.url("extension_type_name", extension_type_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExtensionType', pipeline_response) @@ -107,6 +156,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{extensionTypeName}'} # type: ignore +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{extensionTypeName}'} # type: ignore +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_cluster_extension_types_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_cluster_extension_types_operations.py index ddeddcf87c6..b444efa4b49 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_cluster_extension_types_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_cluster_extension_types_operations.py @@ -5,13 +5,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -21,6 +25,13 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._cluster_extension_types_operations import build_list_request +======= +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +>>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +57,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -64,14 +78,22 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionTypeList or the result of cls(response) +<<<<<<< HEAD :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionTypeList] +======= + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionTypeList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionTypeList"] @@ -79,6 +101,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -110,6 +133,40 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionTypeList", pipeline_response) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ExtensionTypeList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -122,13 +179,21 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_extension_type_versions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_extension_type_versions_operations.py index 2fb6a487db6..7100912402a 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_extension_type_versions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_extension_type_versions_operations.py @@ -5,13 +5,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -21,6 +25,13 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._extension_type_versions_operations import build_list_request +======= +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +>>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +57,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, location: str, @@ -60,10 +74,15 @@ def list( :param extension_type_name: Extension type name. :type extension_type_name: str :keyword callable cls: A custom type or function that will be passed the direct response +<<<<<<< HEAD :return: An iterator like instance of either ExtensionVersionList or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionVersionList] +======= + :return: An iterator like instance of either ExtensionVersionList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionVersionList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionVersionList"] @@ -71,6 +90,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -98,6 +118,38 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionVersionList", pipeline_response) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'location': self._serialize.url("location", location, 'str'), + 'extensionTypeName': self._serialize.url("extension_type_name", extension_type_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ExtensionVersionList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.versions if cls: list_of_elem = cls(list_of_elem) @@ -110,13 +162,21 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_extensions_operations.py index a80a7a43909..87aef7ba49f 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_extensions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_extensions_operations.py @@ -5,24 +5,36 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +======= +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +>>>>>>> 331f997c (updating to the latest vendored sdk) from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +<<<<<<< HEAD from ..._vendor import _convert_request from ...operations._extensions_operations import build_create_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial +======= + +>>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -63,6 +75,7 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -82,12 +95,48 @@ async def _create_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(extension, 'Extension') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) if response.status_code == 200: deserialized = self._deserialize('Extension', pipeline_response) @@ -99,11 +148,16 @@ async def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @distributed_trace_async +======= + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_create( self, resource_group_name: str, @@ -123,8 +177,12 @@ async def begin_create( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -133,6 +191,7 @@ async def begin_create( :type extension: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Extension :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. +<<<<<<< HEAD :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -147,6 +206,17 @@ async def begin_create( """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] +======= + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] lro_delay = kwargs.pop( 'polling_interval', @@ -161,6 +231,7 @@ async def begin_create( cluster_name=cluster_name, extension_name=extension_name, extension=extension, +<<<<<<< HEAD content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -170,12 +241,37 @@ async def begin_create( def get_long_running_output(pipeline_response): response = pipeline_response.http_response deserialized = self._deserialize('Extension', pipeline_response) +======= + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Extension', pipeline_response) + +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -187,10 +283,15 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @distributed_trace_async +======= + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -209,8 +310,12 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -225,6 +330,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -239,12 +345,42 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Extension', pipeline_response) @@ -253,10 +389,15 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) async def _delete_initial( self, resource_group_name: str, @@ -272,6 +413,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_delete_request_initial( @@ -287,20 +429,56 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if force_delete is not None: + query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore +<<<<<<< HEAD @distributed_trace_async +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_delete( self, resource_group_name: str, @@ -321,8 +499,12 @@ async def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -332,6 +514,7 @@ async def begin_delete( :type force_delete: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. +<<<<<<< HEAD :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -343,6 +526,17 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] +======= + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -360,14 +554,33 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) +<<<<<<< HEAD kwargs.pop('error_map', None) +======= + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) +>>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) +<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -379,7 +592,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore async def _update_initial( @@ -394,6 +610,7 @@ async def _update_initial( ) -> "_models.Extension": cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] error_map = { +<<<<<<< HEAD 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) @@ -416,12 +633,53 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: lambda response: ResourceExistsError(response=response, model=self._deserialize(_models.ErrorResponse, response), error_format=ARMErrorFormat), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(patch_extension, 'PatchExtension') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) deserialized = self._deserialize('Extension', pipeline_response) @@ -429,11 +687,16 @@ async def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @distributed_trace_async +======= + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_update( self, resource_group_name: str, @@ -453,13 +716,18 @@ async def begin_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. :type extension_name: str :param patch_extension: Properties to Patch in an existing Extension. +<<<<<<< HEAD :type patch_extension: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.PatchExtension :keyword callable cls: A custom type or function that will be passed the direct response @@ -478,6 +746,20 @@ async def begin_update( """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] +======= + :type patch_extension: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.PatchExtension + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] lro_delay = kwargs.pop( 'polling_interval', @@ -492,6 +774,7 @@ async def begin_update( cluster_name=cluster_name, extension_name=extension_name, patch_extension=patch_extension, +<<<<<<< HEAD content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -501,12 +784,37 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response deserialized = self._deserialize('Extension', pipeline_response) +======= + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Extension', pipeline_response) + +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -518,10 +826,15 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @distributed_trace +======= + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -539,14 +852,22 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionsList or the result of cls(response) +<<<<<<< HEAD :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionsList] +======= + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionsList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionsList"] @@ -554,6 +875,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -585,6 +907,40 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionsList", pipeline_response) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ExtensionsList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -597,13 +953,21 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_flux_config_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_flux_config_operation_status_operations.py index 278055cbaf8..45cb9bb03ae 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_flux_config_operation_status_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_flux_config_operation_status_operations.py @@ -5,12 +5,16 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async @@ -19,6 +23,13 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._flux_config_operation_status_operations import build_get_request +======= +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +>>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +55,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace_async +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -64,8 +78,12 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param flux_configuration_name: Name of the Flux Configuration. @@ -82,6 +100,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -97,12 +116,43 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OperationStatusResult', pipeline_response) @@ -111,6 +161,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}/operations/{operationId}'} # type: ignore +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}/operations/{operationId}'} # type: ignore +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_flux_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_flux_configurations_operations.py index 75827d96b95..ad96497292f 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_flux_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_flux_configurations_operations.py @@ -5,24 +5,36 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +======= +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +>>>>>>> 331f997c (updating to the latest vendored sdk) from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +<<<<<<< HEAD from ..._vendor import _convert_request from ...operations._flux_configurations_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial +======= + +>>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +60,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace_async +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -67,8 +82,12 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param flux_configuration_name: Name of the Flux Configuration. @@ -83,6 +102,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -97,12 +117,42 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FluxConfiguration', pipeline_response) @@ -111,10 +161,15 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) async def _create_or_update_initial( self, resource_group_name: str, @@ -127,6 +182,7 @@ async def _create_or_update_initial( ) -> "_models.FluxConfiguration": cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] error_map = { +<<<<<<< HEAD 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) @@ -149,12 +205,53 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: lambda response: ResourceExistsError(response=response, model=self._deserialize(_models.ErrorResponse, response), error_format=ARMErrorFormat), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(flux_configuration, 'FluxConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) if response.status_code == 200: deserialized = self._deserialize('FluxConfiguration', pipeline_response) @@ -166,11 +263,16 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore @distributed_trace_async +======= + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_create_or_update( self, resource_group_name: str, @@ -190,13 +292,18 @@ async def begin_create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param flux_configuration_name: Name of the Flux Configuration. :type flux_configuration_name: str :param flux_configuration: Properties necessary to Create a FluxConfiguration. +<<<<<<< HEAD :type flux_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfiguration :keyword callable cls: A custom type or function that will be passed the direct response @@ -215,6 +322,20 @@ async def begin_create_or_update( """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] +======= + :type flux_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FluxConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] lro_delay = kwargs.pop( 'polling_interval', @@ -229,6 +350,7 @@ async def begin_create_or_update( cluster_name=cluster_name, flux_configuration_name=flux_configuration_name, flux_configuration=flux_configuration, +<<<<<<< HEAD content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -238,12 +360,37 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response deserialized = self._deserialize('FluxConfiguration', pipeline_response) +======= + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FluxConfiguration', pipeline_response) + +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -255,7 +402,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore async def _update_initial( @@ -270,6 +420,7 @@ async def _update_initial( ) -> "_models.FluxConfiguration": cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] error_map = { +<<<<<<< HEAD 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) @@ -292,12 +443,53 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: lambda response: ResourceExistsError(response=response, model=self._deserialize(_models.ErrorResponse, response), error_format=ARMErrorFormat), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(flux_configuration_patch, 'FluxConfigurationPatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) deserialized = self._deserialize('FluxConfiguration', pipeline_response) @@ -305,11 +497,16 @@ async def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore @distributed_trace_async +======= + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_update( self, resource_group_name: str, @@ -329,13 +526,18 @@ async def begin_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param flux_configuration_name: Name of the Flux Configuration. :type flux_configuration_name: str :param flux_configuration_patch: Properties to Patch in an existing Flux Configuration. +<<<<<<< HEAD :type flux_configuration_patch: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfigurationPatch :keyword callable cls: A custom type or function that will be passed the direct response @@ -354,6 +556,20 @@ async def begin_update( """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] +======= + :type flux_configuration_patch: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfigurationPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FluxConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] lro_delay = kwargs.pop( 'polling_interval', @@ -368,6 +584,7 @@ async def begin_update( cluster_name=cluster_name, flux_configuration_name=flux_configuration_name, flux_configuration_patch=flux_configuration_patch, +<<<<<<< HEAD content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -377,12 +594,37 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response deserialized = self._deserialize('FluxConfiguration', pipeline_response) +======= + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FluxConfiguration', pipeline_response) + +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -394,7 +636,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore async def _delete_initial( @@ -412,6 +657,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_delete_request_initial( @@ -427,20 +673,56 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if force_delete is not None: + query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore +<<<<<<< HEAD @distributed_trace_async +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_delete( self, resource_group_name: str, @@ -461,8 +743,12 @@ async def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param flux_configuration_name: Name of the Flux Configuration. @@ -472,6 +758,7 @@ async def begin_delete( :type force_delete: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. +<<<<<<< HEAD :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -483,6 +770,17 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] +======= + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -500,14 +798,33 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) +<<<<<<< HEAD + kwargs.pop('error_map', None) +======= + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) +>>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) +<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -519,10 +836,15 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore @distributed_trace +======= + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -540,6 +862,7 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -549,6 +872,14 @@ def list( cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfigurationsList] +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FluxConfigurationsList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfigurationsList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfigurationsList"] @@ -556,6 +887,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -587,6 +919,40 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("FluxConfigurationsList", pipeline_response) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('FluxConfigurationsList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -599,13 +965,21 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_location_extension_types_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_location_extension_types_operations.py index 4dfb3b692cd..dc69d4cbb24 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_location_extension_types_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_location_extension_types_operations.py @@ -5,13 +5,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -21,6 +25,13 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._location_extension_types_operations import build_list_request +======= +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +>>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +57,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, location: str, @@ -58,8 +72,12 @@ def list( :type location: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionTypeList or the result of cls(response) +<<<<<<< HEAD :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionTypeList] +======= + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionTypeList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionTypeList"] @@ -67,6 +85,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -92,6 +111,37 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionTypeList", pipeline_response) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ExtensionTypeList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -104,13 +154,21 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_operation_status_operations.py index ca83ab69e8d..d51dc41d129 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_operation_status_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_operation_status_operations.py @@ -5,13 +5,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -21,6 +25,13 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operation_status_operations import build_get_request, build_list_request +======= +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +>>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +57,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace_async +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -66,8 +80,12 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -84,6 +102,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -99,12 +118,43 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OperationStatusResult', pipeline_response) @@ -113,11 +163,16 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore @distributed_trace +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -135,14 +190,22 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationStatusList or the result of cls(response) +<<<<<<< HEAD :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.OperationStatusList] +======= + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.OperationStatusList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusList"] @@ -150,6 +213,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -181,6 +245,40 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("OperationStatusList", pipeline_response) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationStatusList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -193,13 +291,21 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_operations.py index bff33128e43..f606ac319d9 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_operations.py @@ -5,13 +5,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -21,6 +25,13 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operations import build_list_request +======= +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +>>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +57,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, **kwargs: Any @@ -54,10 +68,15 @@ def list( """List all the available operations the KubernetesConfiguration resource provider supports. :keyword callable cls: A custom type or function that will be passed the direct response +<<<<<<< HEAD :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ResourceProviderOperationList] +======= + :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ResourceProviderOperationList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -65,6 +84,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -86,6 +106,32 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,13 +144,21 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_source_control_configurations_operations.py index 9e25d1d3796..0dd8d1c1bc9 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_source_control_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_source_control_configurations_operations.py @@ -5,24 +5,36 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +======= +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +>>>>>>> 331f997c (updating to the latest vendored sdk) from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +<<<<<<< HEAD from ..._vendor import _convert_request from ...operations._source_control_configurations_operations import build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request +======= + +>>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +60,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace_async +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -67,16 +82,24 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) +<<<<<<< HEAD :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration +======= + :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -84,6 +107,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -98,12 +122,42 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) @@ -112,11 +166,16 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @distributed_trace_async +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) async def create_or_update( self, resource_group_name: str, @@ -136,19 +195,30 @@ async def create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. +<<<<<<< HEAD :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration +======= + :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -156,6 +226,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -175,12 +246,47 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -193,10 +299,15 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore +======= + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) async def _delete_initial( self, resource_group_name: str, @@ -211,6 +322,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_delete_request_initial( @@ -225,20 +337,54 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore +<<<<<<< HEAD @distributed_trace_async +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_delete( self, resource_group_name: str, @@ -258,14 +404,19 @@ async def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. +<<<<<<< HEAD :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -277,6 +428,17 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] +======= + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -293,14 +455,33 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) +<<<<<<< HEAD kwargs.pop('error_map', None) +======= + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) +>>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) +<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -312,10 +493,15 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @distributed_trace +======= + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + +>>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -333,6 +519,7 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -342,6 +529,14 @@ def list( cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfigurationList] +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SourceControlConfigurationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfigurationList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfigurationList"] @@ -349,6 +544,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -380,6 +576,40 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("SourceControlConfigurationList", pipeline_response) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SourceControlConfigurationList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -392,13 +622,21 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/__init__.py index b83d70226f0..df8b90124e5 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/__init__.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from ._models_py3 import ClusterScopeSettings from ._models_py3 import ComplianceStatus from ._models_py3 import DependsOnDefinition @@ -48,6 +49,92 @@ from ._models_py3 import SupportedScopes from ._models_py3 import SystemData +======= +try: + from ._models_py3 import ClusterScopeSettings + from ._models_py3 import ComplianceStatus + from ._models_py3 import DependsOnDefinition + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse + from ._models_py3 import Extension + from ._models_py3 import ExtensionPropertiesAksAssignedIdentity + from ._models_py3 import ExtensionStatus + from ._models_py3 import ExtensionType + from ._models_py3 import ExtensionTypeList + from ._models_py3 import ExtensionVersionList + from ._models_py3 import ExtensionVersionListVersionsItem + from ._models_py3 import ExtensionsList + from ._models_py3 import FluxConfiguration + from ._models_py3 import FluxConfigurationPatch + from ._models_py3 import FluxConfigurationsList + from ._models_py3 import GitRepositoryDefinition + from ._models_py3 import HelmOperatorProperties + from ._models_py3 import HelmReleasePropertiesDefinition + from ._models_py3 import Identity + from ._models_py3 import KustomizationDefinition + from ._models_py3 import ObjectReferenceDefinition + from ._models_py3 import ObjectStatusConditionDefinition + from ._models_py3 import ObjectStatusDefinition + from ._models_py3 import OperationStatusList + from ._models_py3 import OperationStatusResult + from ._models_py3 import PatchExtension + from ._models_py3 import ProxyResource + from ._models_py3 import RepositoryRefDefinition + from ._models_py3 import Resource + from ._models_py3 import ResourceProviderOperation + from ._models_py3 import ResourceProviderOperationDisplay + from ._models_py3 import ResourceProviderOperationList + from ._models_py3 import Scope + from ._models_py3 import ScopeCluster + from ._models_py3 import ScopeNamespace + from ._models_py3 import SourceControlConfiguration + from ._models_py3 import SourceControlConfigurationList + from ._models_py3 import SupportedScopes + from ._models_py3 import SystemData +except (SyntaxError, ImportError): + from ._models import ClusterScopeSettings # type: ignore + from ._models import ComplianceStatus # type: ignore + from ._models import DependsOnDefinition # type: ignore + from ._models import ErrorAdditionalInfo # type: ignore + from ._models import ErrorDetail # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import Extension # type: ignore + from ._models import ExtensionPropertiesAksAssignedIdentity # type: ignore + from ._models import ExtensionStatus # type: ignore + from ._models import ExtensionType # type: ignore + from ._models import ExtensionTypeList # type: ignore + from ._models import ExtensionVersionList # type: ignore + from ._models import ExtensionVersionListVersionsItem # type: ignore + from ._models import ExtensionsList # type: ignore + from ._models import FluxConfiguration # type: ignore + from ._models import FluxConfigurationPatch # type: ignore + from ._models import FluxConfigurationsList # type: ignore + from ._models import GitRepositoryDefinition # type: ignore + from ._models import HelmOperatorProperties # type: ignore + from ._models import HelmReleasePropertiesDefinition # type: ignore + from ._models import Identity # type: ignore + from ._models import KustomizationDefinition # type: ignore + from ._models import ObjectReferenceDefinition # type: ignore + from ._models import ObjectStatusConditionDefinition # type: ignore + from ._models import ObjectStatusDefinition # type: ignore + from ._models import OperationStatusList # type: ignore + from ._models import OperationStatusResult # type: ignore + from ._models import PatchExtension # type: ignore + from ._models import ProxyResource # type: ignore + from ._models import RepositoryRefDefinition # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceProviderOperation # type: ignore + from ._models import ResourceProviderOperationDisplay # type: ignore + from ._models import ResourceProviderOperationList # type: ignore + from ._models import Scope # type: ignore + from ._models import ScopeCluster # type: ignore + from ._models import ScopeNamespace # type: ignore + from ._models import SourceControlConfiguration # type: ignore + from ._models import SourceControlConfigurationList # type: ignore + from ._models import SupportedScopes # type: ignore + from ._models import SystemData # type: ignore +>>>>>>> 331f997c (updating to the latest vendored sdk) from ._source_control_configuration_client_enums import ( ClusterTypes, diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_models.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_models.py new file mode 100644 index 00000000000..c47ff7c1cde --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_models.py @@ -0,0 +1,1639 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class ClusterScopeSettings(ProxyResource): + """Extension scope settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param allow_multiple_instances: Describes if multiple instances of the extension are allowed. + :type allow_multiple_instances: bool + :param default_release_namespace: Default extension release namespace. + :type default_release_namespace: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'allow_multiple_instances': {'key': 'properties.allowMultipleInstances', 'type': 'bool'}, + 'default_release_namespace': {'key': 'properties.defaultReleaseNamespace', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ClusterScopeSettings, self).__init__(**kwargs) + self.allow_multiple_instances = kwargs.get('allow_multiple_instances', None) + self.default_release_namespace = kwargs.get('default_release_namespace', None) + + +class ComplianceStatus(msrest.serialization.Model): + """Compliance Status details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar compliance_state: The compliance state of the configuration. Possible values include: + "Pending", "Compliant", "Noncompliant", "Installed", "Failed". + :vartype compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ComplianceStateType + :param last_config_applied: Datetime the configuration was last applied. + :type last_config_applied: ~datetime.datetime + :param message: Message from when the configuration was applied. + :type message: str + :param message_level: Level of the message. Possible values include: "Error", "Warning", + "Information". + :type message_level: str or + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.MessageLevelType + """ + + _validation = { + 'compliance_state': {'readonly': True}, + } + + _attribute_map = { + 'compliance_state': {'key': 'complianceState', 'type': 'str'}, + 'last_config_applied': {'key': 'lastConfigApplied', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'message_level': {'key': 'messageLevel', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ComplianceStatus, self).__init__(**kwargs) + self.compliance_state = None + self.last_config_applied = kwargs.get('last_config_applied', None) + self.message = kwargs.get('message', None) + self.message_level = kwargs.get('message_level', None) + + +class DependsOnDefinition(msrest.serialization.Model): + """Specify which kustomizations must succeed reconciliation on the cluster prior to reconciling this kustomization. + + :param kustomization_name: Name of the kustomization to claim dependency on. + :type kustomization_name: str + """ + + _attribute_map = { + 'kustomization_name': {'key': 'kustomizationName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DependsOnDefinition, self).__init__(**kwargs) + self.kustomization_name = kwargs.get('kustomization_name', None) + + +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(msrest.serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(msrest.serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). + + :param error: The error object. + :type error: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class Extension(ProxyResource): + """The Extension object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param identity: Identity of the Extension resource. + :type identity: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Identity + :ivar system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SystemData + :param extension_type: Type of the Extension, of which this resource is an instance of. It + must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the + Extension publisher. + :type extension_type: str + :param auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade + of minor version, or not. + :type auto_upgrade_minor_version: bool + :param release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. + Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :type release_train: str + :param version: Version of the extension for this extension, if it is 'pinned' to a specific + version. autoUpgradeMinorVersion must be 'false'. + :type version: str + :param scope: Scope at which the extension is installed. + :type scope: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Scope + :param configuration_settings: Configuration settings, as name-value pairs for configuring this + extension. + :type configuration_settings: dict[str, str] + :param configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :type configuration_protected_settings: dict[str, str] + :ivar provisioning_state: Status of installation of this extension. Possible values include: + "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ProvisioningState + :param statuses: Status from this extension. + :type statuses: + list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionStatus] + :ivar error_info: Error information from the Agent - e.g. errors during installation. + :vartype error_info: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ErrorDetail + :ivar custom_location_settings: Custom Location settings properties. + :vartype custom_location_settings: dict[str, str] + :ivar package_uri: Uri of the Helm package. + :vartype package_uri: str + :param aks_assigned_identity: Identity of the Extension resource in an AKS cluster. + :type aks_assigned_identity: + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionPropertiesAksAssignedIdentity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'error_info': {'readonly': True}, + 'custom_location_settings': {'readonly': True}, + 'package_uri': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'extension_type': {'key': 'properties.extensionType', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'release_train': {'key': 'properties.releaseTrain', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'Scope'}, + 'configuration_settings': {'key': 'properties.configurationSettings', 'type': '{str}'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'statuses': {'key': 'properties.statuses', 'type': '[ExtensionStatus]'}, + 'error_info': {'key': 'properties.errorInfo', 'type': 'ErrorDetail'}, + 'custom_location_settings': {'key': 'properties.customLocationSettings', 'type': '{str}'}, + 'package_uri': {'key': 'properties.packageUri', 'type': 'str'}, + 'aks_assigned_identity': {'key': 'properties.aksAssignedIdentity', 'type': 'ExtensionPropertiesAksAssignedIdentity'}, + } + + def __init__( + self, + **kwargs + ): + super(Extension, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.system_data = None + self.extension_type = kwargs.get('extension_type', None) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', True) + self.release_train = kwargs.get('release_train', "Stable") + self.version = kwargs.get('version', None) + self.scope = kwargs.get('scope', None) + self.configuration_settings = kwargs.get('configuration_settings', None) + self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) + self.provisioning_state = None + self.statuses = kwargs.get('statuses', None) + self.error_info = None + self.custom_location_settings = None + self.package_uri = None + self.aks_assigned_identity = kwargs.get('aks_assigned_identity', None) + + +class ExtensionPropertiesAksAssignedIdentity(msrest.serialization.Model): + """Identity of the Extension resource in an AKS cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. The only acceptable values to pass in are None and + "SystemAssigned". The default value is None. + :type type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionPropertiesAksAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + + +class ExtensionsList(msrest.serialization.Model): + """Result of the request to list Extensions. It contains a list of Extension objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Extensions within a Kubernetes cluster. + :vartype value: list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Extension] + :ivar next_link: URL to get the next set of extension objects, if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Extension]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionsList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ExtensionStatus(msrest.serialization.Model): + """Status from the extension. + + :param code: Status code provided by the Extension. + :type code: str + :param display_status: Short description of status of the extension. + :type display_status: str + :param level: Level of the status. Possible values include: "Error", "Warning", "Information". + Default value: "Information". + :type level: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.LevelType + :param message: Detailed message of the status from the Extension. + :type message: str + :param time: DateLiteral (per ISO8601) noting the time of installation status. + :type time: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionStatus, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.display_status = kwargs.get('display_status', None) + self.level = kwargs.get('level', "Information") + self.message = kwargs.get('message', None) + self.time = kwargs.get('time', None) + + +class ExtensionType(msrest.serialization.Model): + """Represents an Extension Type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SystemData + :ivar release_trains: Extension release train: preview or stable. + :vartype release_trains: list[str] + :ivar cluster_types: Cluster types. Possible values include: "connectedClusters", + "managedClusters". + :vartype cluster_types: str or + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ClusterTypes + :ivar supported_scopes: Extension scopes. + :vartype supported_scopes: + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SupportedScopes + """ + + _validation = { + 'system_data': {'readonly': True}, + 'release_trains': {'readonly': True}, + 'cluster_types': {'readonly': True}, + 'supported_scopes': {'readonly': True}, + } + + _attribute_map = { + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'release_trains': {'key': 'properties.releaseTrains', 'type': '[str]'}, + 'cluster_types': {'key': 'properties.clusterTypes', 'type': 'str'}, + 'supported_scopes': {'key': 'properties.supportedScopes', 'type': 'SupportedScopes'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionType, self).__init__(**kwargs) + self.system_data = None + self.release_trains = None + self.cluster_types = None + self.supported_scopes = None + + +class ExtensionTypeList(msrest.serialization.Model): + """List Extension Types. + + :param value: The list of Extension Types. + :type value: list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionType] + :param next_link: The link to fetch the next page of Extension Types. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExtensionType]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionTypeList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ExtensionVersionList(msrest.serialization.Model): + """List versions for an Extension. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param versions: Versions available for this Extension Type. + :type versions: + list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionVersionListVersionsItem] + :param next_link: The link to fetch the next page of Extension Types. + :type next_link: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SystemData + """ + + _validation = { + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'versions': {'key': 'versions', 'type': '[ExtensionVersionListVersionsItem]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionVersionList, self).__init__(**kwargs) + self.versions = kwargs.get('versions', None) + self.next_link = kwargs.get('next_link', None) + self.system_data = None + + +class ExtensionVersionListVersionsItem(msrest.serialization.Model): + """ExtensionVersionListVersionsItem. + + :param release_train: The release train for this Extension Type. + :type release_train: str + :param versions: Versions available for this Extension Type and release train. + :type versions: list[str] + """ + + _attribute_map = { + 'release_train': {'key': 'releaseTrain', 'type': 'str'}, + 'versions': {'key': 'versions', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtensionVersionListVersionsItem, self).__init__(**kwargs) + self.release_train = kwargs.get('release_train', None) + self.versions = kwargs.get('versions', None) + + +class FluxConfiguration(ProxyResource): + """The Flux Configuration object returned in Get & Put response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SystemData + :param scope: Scope at which the operator will be installed. Possible values include: + "cluster", "namespace". Default value: "cluster". + :type scope: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ScopeType + :param namespace: The namespace to which this configuration is installed to. Maximum of 253 + lower case alphanumeric characters, hyphen and period only. + :type namespace: str + :param source_kind: Source Kind to pull the configuration data from. Possible values include: + "GitRepository". + :type source_kind: str or + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceKindType + :param suspend: Whether this configuration should suspend its reconciliation of its + kustomizations and sources. + :type suspend: bool + :param git_repository: Parameters to reconcile to the GitRepository source kind type. + :type git_repository: + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.GitRepositoryDefinition + :param kustomizations: Array of kustomizations used to reconcile the artifact pulled by the + source type on the cluster. + :type kustomizations: dict[str, + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.KustomizationDefinition] + :param configuration_protected_settings: Key-value pairs of protected configuration settings + for the configuration. + :type configuration_protected_settings: dict[str, str] + :ivar statuses: Statuses of the Flux Kubernetes resources created by the fluxConfiguration or + created by the managed objects provisioned by the fluxConfiguration. + :vartype statuses: + list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ObjectStatusDefinition] + :ivar repository_public_key: Public Key associated with this fluxConfiguration (either + generated within the cluster or provided by the user). + :vartype repository_public_key: str + :ivar last_source_synced_commit_id: Branch and SHA of the last source commit synced with the + cluster. + :vartype last_source_synced_commit_id: str + :ivar last_source_synced_at: Datetime the fluxConfiguration last synced its source on the + cluster. + :vartype last_source_synced_at: ~datetime.datetime + :ivar compliance_state: Combined status of the Flux Kubernetes resources created by the + fluxConfiguration or created by the managed objects. Possible values include: "Compliant", + "Non-Compliant", "Pending", "Suspended", "Unknown". Default value: "Unknown". + :vartype compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxComplianceState + :ivar provisioning_state: Status of the creation of the fluxConfiguration. Possible values + include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ProvisioningState + :ivar error_message: Error message returned to the user in the case of provisioning failure. + :vartype error_message: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'statuses': {'readonly': True}, + 'repository_public_key': {'readonly': True}, + 'last_source_synced_commit_id': {'readonly': True}, + 'last_source_synced_at': {'readonly': True}, + 'compliance_state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'error_message': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'namespace': {'key': 'properties.namespace', 'type': 'str'}, + 'source_kind': {'key': 'properties.sourceKind', 'type': 'str'}, + 'suspend': {'key': 'properties.suspend', 'type': 'bool'}, + 'git_repository': {'key': 'properties.gitRepository', 'type': 'GitRepositoryDefinition'}, + 'kustomizations': {'key': 'properties.kustomizations', 'type': '{KustomizationDefinition}'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, + 'statuses': {'key': 'properties.statuses', 'type': '[ObjectStatusDefinition]'}, + 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, + 'last_source_synced_commit_id': {'key': 'properties.lastSourceSyncedCommitId', 'type': 'str'}, + 'last_source_synced_at': {'key': 'properties.lastSourceSyncedAt', 'type': 'iso-8601'}, + 'compliance_state': {'key': 'properties.complianceState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'error_message': {'key': 'properties.errorMessage', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FluxConfiguration, self).__init__(**kwargs) + self.system_data = None + self.scope = kwargs.get('scope', "cluster") + self.namespace = kwargs.get('namespace', "default") + self.source_kind = kwargs.get('source_kind', None) + self.suspend = kwargs.get('suspend', False) + self.git_repository = kwargs.get('git_repository', None) + self.kustomizations = kwargs.get('kustomizations', None) + self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) + self.statuses = None + self.repository_public_key = None + self.last_source_synced_commit_id = None + self.last_source_synced_at = None + self.compliance_state = None + self.provisioning_state = None + self.error_message = None + + +class FluxConfigurationPatch(msrest.serialization.Model): + """The Flux Configuration Patch Request object. + + :param source_kind: Source Kind to pull the configuration data from. Possible values include: + "GitRepository". + :type source_kind: str or + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceKindType + :param suspend: Whether this configuration should suspend its reconciliation of its + kustomizations and sources. + :type suspend: bool + :param git_repository: Parameters to reconcile to the GitRepository source kind type. + :type git_repository: + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.GitRepositoryDefinition + :param kustomizations: Array of kustomizations used to reconcile the artifact pulled by the + source type on the cluster. + :type kustomizations: dict[str, + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.KustomizationDefinition] + :param configuration_protected_settings: Key-value pairs of protected configuration settings + for the configuration. + :type configuration_protected_settings: dict[str, str] + """ + + _attribute_map = { + 'source_kind': {'key': 'properties.sourceKind', 'type': 'str'}, + 'suspend': {'key': 'properties.suspend', 'type': 'bool'}, + 'git_repository': {'key': 'properties.gitRepository', 'type': 'GitRepositoryDefinition'}, + 'kustomizations': {'key': 'properties.kustomizations', 'type': '{KustomizationDefinition}'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(FluxConfigurationPatch, self).__init__(**kwargs) + self.source_kind = kwargs.get('source_kind', None) + self.suspend = kwargs.get('suspend', False) + self.git_repository = kwargs.get('git_repository', None) + self.kustomizations = kwargs.get('kustomizations', None) + self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) + + +class FluxConfigurationsList(msrest.serialization.Model): + """Result of the request to list Flux Configurations. It contains a list of FluxConfiguration objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Flux Configurations within a Kubernetes cluster. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfiguration] + :ivar next_link: URL to get the next set of configuration objects, if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FluxConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FluxConfigurationsList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class GitRepositoryDefinition(msrest.serialization.Model): + """Parameters to reconcile to the GitRepository source kind type. + + :param url: The URL to sync for the flux configuration git repository. + :type url: str + :param timeout_in_seconds: The maximum time to attempt to reconcile the cluster git repository + source with the remote. + :type timeout_in_seconds: long + :param sync_interval_in_seconds: The interval at which to re-reconcile the cluster git + repository source with the remote. + :type sync_interval_in_seconds: long + :param repository_ref: The source reference for the GitRepository object. + :type repository_ref: + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.RepositoryRefDefinition + :param ssh_known_hosts: Base64-encoded known_hosts value containing public SSH keys required to + access private git repositories over SSH. + :type ssh_known_hosts: str + :param https_user: Base64-encoded HTTPS username used to access private git repositories over + HTTPS. + :type https_user: str + :param https_ca_file: Base64-encoded HTTPS certificate authority contents used to access git + private git repositories over HTTPS. + :type https_ca_file: str + :param local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :type local_auth_ref: str + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'timeout_in_seconds': {'key': 'timeoutInSeconds', 'type': 'long'}, + 'sync_interval_in_seconds': {'key': 'syncIntervalInSeconds', 'type': 'long'}, + 'repository_ref': {'key': 'repositoryRef', 'type': 'RepositoryRefDefinition'}, + 'ssh_known_hosts': {'key': 'sshKnownHosts', 'type': 'str'}, + 'https_user': {'key': 'httpsUser', 'type': 'str'}, + 'https_ca_file': {'key': 'httpsCAFile', 'type': 'str'}, + 'local_auth_ref': {'key': 'localAuthRef', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GitRepositoryDefinition, self).__init__(**kwargs) + self.url = kwargs.get('url', None) + self.timeout_in_seconds = kwargs.get('timeout_in_seconds', 600) + self.sync_interval_in_seconds = kwargs.get('sync_interval_in_seconds', 600) + self.repository_ref = kwargs.get('repository_ref', None) + self.ssh_known_hosts = kwargs.get('ssh_known_hosts', None) + self.https_user = kwargs.get('https_user', None) + self.https_ca_file = kwargs.get('https_ca_file', None) + self.local_auth_ref = kwargs.get('local_auth_ref', None) + + +class HelmOperatorProperties(msrest.serialization.Model): + """Properties for Helm operator. + + :param chart_version: Version of the operator Helm chart. + :type chart_version: str + :param chart_values: Values override for the operator Helm chart. + :type chart_values: str + """ + + _attribute_map = { + 'chart_version': {'key': 'chartVersion', 'type': 'str'}, + 'chart_values': {'key': 'chartValues', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HelmOperatorProperties, self).__init__(**kwargs) + self.chart_version = kwargs.get('chart_version', None) + self.chart_values = kwargs.get('chart_values', None) + + +class HelmReleasePropertiesDefinition(msrest.serialization.Model): + """HelmReleasePropertiesDefinition. + + :param last_revision_applied: The revision number of the last released object change. + :type last_revision_applied: long + :param helm_chart_ref: The reference to the HelmChart object used as the source to this + HelmRelease. + :type helm_chart_ref: + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ObjectReferenceDefinition + :param failure_count: Total number of times that the HelmRelease failed to install or upgrade. + :type failure_count: long + :param install_failure_count: Number of times that the HelmRelease failed to install. + :type install_failure_count: long + :param upgrade_failure_count: Number of times that the HelmRelease failed to upgrade. + :type upgrade_failure_count: long + """ + + _attribute_map = { + 'last_revision_applied': {'key': 'lastRevisionApplied', 'type': 'long'}, + 'helm_chart_ref': {'key': 'helmChartRef', 'type': 'ObjectReferenceDefinition'}, + 'failure_count': {'key': 'failureCount', 'type': 'long'}, + 'install_failure_count': {'key': 'installFailureCount', 'type': 'long'}, + 'upgrade_failure_count': {'key': 'upgradeFailureCount', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(HelmReleasePropertiesDefinition, self).__init__(**kwargs) + self.last_revision_applied = kwargs.get('last_revision_applied', None) + self.helm_chart_ref = kwargs.get('helm_chart_ref', None) + self.failure_count = kwargs.get('failure_count', None) + self.install_failure_count = kwargs.get('install_failure_count', None) + self.upgrade_failure_count = kwargs.get('upgrade_failure_count', None) + + +class Identity(msrest.serialization.Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. The only acceptable values to pass in are None and + "SystemAssigned". The default value is None. + :type type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + + +class KustomizationDefinition(msrest.serialization.Model): + """The Kustomization defining how to reconcile the artifact pulled by the source type on the cluster. + + :param path: The path in the source reference to reconcile on the cluster. + :type path: str + :param depends_on: Specifies other Kustomizations that this Kustomization depends on. This + Kustomization will not reconcile until all dependencies have completed their reconciliation. + :type depends_on: + list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.DependsOnDefinition] + :param timeout_in_seconds: The maximum time to attempt to reconcile the Kustomization on the + cluster. + :type timeout_in_seconds: long + :param sync_interval_in_seconds: The interval at which to re-reconcile the Kustomization on the + cluster. + :type sync_interval_in_seconds: long + :param retry_interval_in_seconds: The interval at which to re-reconcile the Kustomization on + the cluster in the event of failure on reconciliation. + :type retry_interval_in_seconds: long + :param prune: Enable/disable garbage collections of Kubernetes objects created by this + Kustomization. + :type prune: bool + :param validation: Specify whether to validate the Kubernetes objects referenced in the + Kustomization before applying them to the cluster. Possible values include: "none", "client", + "server". Default value: "none". + :type validation: str or + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.KustomizationValidationType + :param force: Enable/disable re-creating Kubernetes resources on the cluster when patching + fails due to an immutable field change. + :type force: bool + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'depends_on': {'key': 'dependsOn', 'type': '[DependsOnDefinition]'}, + 'timeout_in_seconds': {'key': 'timeoutInSeconds', 'type': 'long'}, + 'sync_interval_in_seconds': {'key': 'syncIntervalInSeconds', 'type': 'long'}, + 'retry_interval_in_seconds': {'key': 'retryIntervalInSeconds', 'type': 'long'}, + 'prune': {'key': 'prune', 'type': 'bool'}, + 'validation': {'key': 'validation', 'type': 'str'}, + 'force': {'key': 'force', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(KustomizationDefinition, self).__init__(**kwargs) + self.path = kwargs.get('path', "") + self.depends_on = kwargs.get('depends_on', None) + self.timeout_in_seconds = kwargs.get('timeout_in_seconds', 600) + self.sync_interval_in_seconds = kwargs.get('sync_interval_in_seconds', 600) + self.retry_interval_in_seconds = kwargs.get('retry_interval_in_seconds', None) + self.prune = kwargs.get('prune', False) + self.validation = kwargs.get('validation', "none") + self.force = kwargs.get('force', False) + + +class ObjectReferenceDefinition(msrest.serialization.Model): + """Object reference to a Kubernetes object on a cluster. + + :param name: Name of the object. + :type name: str + :param namespace: Namespace of the object. + :type namespace: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ObjectReferenceDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.namespace = kwargs.get('namespace', None) + + +class ObjectStatusConditionDefinition(msrest.serialization.Model): + """Status condition of Kubernetes object. + + :param last_transition_time: Last time this status condition has changed. + :type last_transition_time: ~datetime.datetime + :param message: A more verbose description of the object status condition. + :type message: str + :param reason: Reason for the specified status condition type status. + :type reason: str + :param status: Status of the Kubernetes object condition type. + :type status: str + :param type: Object status condition type for this object. + :type type: str + """ + + _attribute_map = { + 'last_transition_time': {'key': 'lastTransitionTime', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ObjectStatusConditionDefinition, self).__init__(**kwargs) + self.last_transition_time = kwargs.get('last_transition_time', None) + self.message = kwargs.get('message', None) + self.reason = kwargs.get('reason', None) + self.status = kwargs.get('status', None) + self.type = kwargs.get('type', None) + + +class ObjectStatusDefinition(msrest.serialization.Model): + """Statuses of objects deployed by the user-specified kustomizations from the git repository. + + :param name: Name of the applied object. + :type name: str + :param namespace: Namespace of the applied object. + :type namespace: str + :param kind: Kind of the applied object. + :type kind: str + :param compliance_state: Compliance state of the applied object showing whether the applied + object has come into a ready state on the cluster. Possible values include: "Compliant", + "Non-Compliant", "Pending", "Suspended", "Unknown". Default value: "Unknown". + :type compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxComplianceState + :param applied_by: Object reference to the Kustomization that applied this object. + :type applied_by: + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ObjectReferenceDefinition + :param status_conditions: List of Kubernetes object status conditions present on the cluster. + :type status_conditions: + list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ObjectStatusConditionDefinition] + :param helm_release_properties: Additional properties that are provided from objects of the + HelmRelease kind. + :type helm_release_properties: + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.HelmReleasePropertiesDefinition + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'compliance_state': {'key': 'complianceState', 'type': 'str'}, + 'applied_by': {'key': 'appliedBy', 'type': 'ObjectReferenceDefinition'}, + 'status_conditions': {'key': 'statusConditions', 'type': '[ObjectStatusConditionDefinition]'}, + 'helm_release_properties': {'key': 'helmReleaseProperties', 'type': 'HelmReleasePropertiesDefinition'}, + } + + def __init__( + self, + **kwargs + ): + super(ObjectStatusDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.namespace = kwargs.get('namespace', None) + self.kind = kwargs.get('kind', None) + self.compliance_state = kwargs.get('compliance_state', "Unknown") + self.applied_by = kwargs.get('applied_by', None) + self.status_conditions = kwargs.get('status_conditions', None) + self.helm_release_properties = kwargs.get('helm_release_properties', None) + + +class OperationStatusList(msrest.serialization.Model): + """The async operations in progress, in the cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of async operations in progress, in the cluster. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.OperationStatusResult] + :ivar next_link: URL to get the next set of Operation Result objects, if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OperationStatusResult]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationStatusList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class OperationStatusResult(msrest.serialization.Model): + """The current status of an async operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Fully qualified ID for the async operation. + :type id: str + :param name: Name of the async operation. + :type name: str + :param status: Required. Operation status. + :type status: str + :param properties: Additional information, if available. + :type properties: dict[str, str] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ErrorDetail + """ + + _validation = { + 'status': {'required': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationStatusResult, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.status = kwargs['status'] + self.properties = kwargs.get('properties', None) + self.error = None + + +class PatchExtension(msrest.serialization.Model): + """The Extension Patch Request object. + + :param auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade + of minor version, or not. + :type auto_upgrade_minor_version: bool + :param release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. + Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :type release_train: str + :param version: Version of the extension for this extension, if it is 'pinned' to a specific + version. autoUpgradeMinorVersion must be 'false'. + :type version: str + :param configuration_settings: Configuration settings, as name-value pairs for configuring this + extension. + :type configuration_settings: dict[str, str] + :param configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :type configuration_protected_settings: dict[str, str] + """ + + _attribute_map = { + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'release_train': {'key': 'properties.releaseTrain', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'configuration_settings': {'key': 'properties.configurationSettings', 'type': '{str}'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(PatchExtension, self).__init__(**kwargs) + self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', True) + self.release_train = kwargs.get('release_train', "Stable") + self.version = kwargs.get('version', None) + self.configuration_settings = kwargs.get('configuration_settings', None) + self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) + + +class RepositoryRefDefinition(msrest.serialization.Model): + """The source reference for the GitRepository object. + + :param branch: The git repository branch name to checkout. + :type branch: str + :param tag: The git repository tag name to checkout. This takes precedence over branch. + :type tag: str + :param semver: The semver range used to match against git repository tags. This takes + precedence over tag. + :type semver: str + :param commit: The commit SHA to checkout. This value must be combined with the branch name to + be valid. This takes precedence over semver. + :type commit: str + """ + + _attribute_map = { + 'branch': {'key': 'branch', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'semver': {'key': 'semver', 'type': 'str'}, + 'commit': {'key': 'commit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RepositoryRefDefinition, self).__init__(**kwargs) + self.branch = kwargs.get('branch', None) + self.tag = kwargs.get('tag', None) + self.semver = kwargs.get('semver', None) + self.commit = kwargs.get('commit', None) + + +class ResourceProviderOperation(msrest.serialization.Model): + """Supported operation of this resource provider. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: Operation name, in format of {provider}/{resource}/{operation}. + :type name: str + :param display: Display metadata associated with the operation. + :type display: + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ResourceProviderOperationDisplay + :ivar is_data_action: The flag that indicates whether the operation applies to data plane. + :vartype is_data_action: bool + :ivar origin: Origin of the operation. + :vartype origin: str + """ + + _validation = { + 'is_data_action': {'readonly': True}, + 'origin': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.is_data_action = None + self.origin = None + + +class ResourceProviderOperationDisplay(msrest.serialization.Model): + """Display metadata associated with the operation. + + :param provider: Resource provider: Microsoft KubernetesConfiguration. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class ResourceProviderOperationList(msrest.serialization.Model): + """Result of the request to list operations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: List of operations supported by this resource provider. + :type value: + list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ResourceProviderOperation] + :ivar next_link: URL to the next set of results, if any. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperationList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class Scope(msrest.serialization.Model): + """Scope of the extension. It can be either Cluster or Namespace; but not both. + + :param cluster: Specifies that the scope of the extension is Cluster. + :type cluster: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ScopeCluster + :param namespace: Specifies that the scope of the extension is Namespace. + :type namespace: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ScopeNamespace + """ + + _attribute_map = { + 'cluster': {'key': 'cluster', 'type': 'ScopeCluster'}, + 'namespace': {'key': 'namespace', 'type': 'ScopeNamespace'}, + } + + def __init__( + self, + **kwargs + ): + super(Scope, self).__init__(**kwargs) + self.cluster = kwargs.get('cluster', None) + self.namespace = kwargs.get('namespace', None) + + +class ScopeCluster(msrest.serialization.Model): + """Specifies that the scope of the extension is Cluster. + + :param release_namespace: Namespace where the extension Release must be placed, for a Cluster + scoped extension. If this namespace does not exist, it will be created. + :type release_namespace: str + """ + + _attribute_map = { + 'release_namespace': {'key': 'releaseNamespace', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ScopeCluster, self).__init__(**kwargs) + self.release_namespace = kwargs.get('release_namespace', None) + + +class ScopeNamespace(msrest.serialization.Model): + """Specifies that the scope of the extension is Namespace. + + :param target_namespace: Namespace where the extension will be created for an Namespace scoped + extension. If this namespace does not exist, it will be created. + :type target_namespace: str + """ + + _attribute_map = { + 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ScopeNamespace, self).__init__(**kwargs) + self.target_namespace = kwargs.get('target_namespace', None) + + +class SourceControlConfiguration(ProxyResource): + """The SourceControl Configuration object returned in Get & Put response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SystemData + :param repository_url: Url of the SourceControl Repository. + :type repository_url: str + :param operator_namespace: The namespace to which this operator is installed to. Maximum of 253 + lower case alphanumeric characters, hyphen and period only. + :type operator_namespace: str + :param operator_instance_name: Instance name of the operator - identifying the specific + configuration. + :type operator_instance_name: str + :param operator_type: Type of the operator. Possible values include: "Flux". + :type operator_type: str or + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.OperatorType + :param operator_params: Any Parameters for the Operator instance in string format. + :type operator_params: str + :param configuration_protected_settings: Name-value pairs of protected configuration settings + for the configuration. + :type configuration_protected_settings: dict[str, str] + :param operator_scope: Scope at which the operator will be installed. Possible values include: + "cluster", "namespace". Default value: "cluster". + :type operator_scope: str or + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.OperatorScopeType + :ivar repository_public_key: Public Key associated with this SourceControl configuration + (either generated within the cluster or provided by the user). + :vartype repository_public_key: str + :param ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys + required to access private Git instances. + :type ssh_known_hosts_contents: str + :param enable_helm_operator: Option to enable Helm Operator for this git configuration. + :type enable_helm_operator: bool + :param helm_operator_properties: Properties for Helm operator. + :type helm_operator_properties: + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.HelmOperatorProperties + :ivar provisioning_state: The provisioning state of the resource provider. Possible values + include: "Accepted", "Deleting", "Running", "Succeeded", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ProvisioningStateType + :ivar compliance_status: Compliance Status of the Configuration. + :vartype compliance_status: + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ComplianceStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'repository_public_key': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'compliance_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'operator_namespace': {'key': 'properties.operatorNamespace', 'type': 'str'}, + 'operator_instance_name': {'key': 'properties.operatorInstanceName', 'type': 'str'}, + 'operator_type': {'key': 'properties.operatorType', 'type': 'str'}, + 'operator_params': {'key': 'properties.operatorParams', 'type': 'str'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, + 'operator_scope': {'key': 'properties.operatorScope', 'type': 'str'}, + 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, + 'ssh_known_hosts_contents': {'key': 'properties.sshKnownHostsContents', 'type': 'str'}, + 'enable_helm_operator': {'key': 'properties.enableHelmOperator', 'type': 'bool'}, + 'helm_operator_properties': {'key': 'properties.helmOperatorProperties', 'type': 'HelmOperatorProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'compliance_status': {'key': 'properties.complianceStatus', 'type': 'ComplianceStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlConfiguration, self).__init__(**kwargs) + self.system_data = None + self.repository_url = kwargs.get('repository_url', None) + self.operator_namespace = kwargs.get('operator_namespace', "default") + self.operator_instance_name = kwargs.get('operator_instance_name', None) + self.operator_type = kwargs.get('operator_type', None) + self.operator_params = kwargs.get('operator_params', None) + self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) + self.operator_scope = kwargs.get('operator_scope', "cluster") + self.repository_public_key = None + self.ssh_known_hosts_contents = kwargs.get('ssh_known_hosts_contents', None) + self.enable_helm_operator = kwargs.get('enable_helm_operator', None) + self.helm_operator_properties = kwargs.get('helm_operator_properties', None) + self.provisioning_state = None + self.compliance_status = None + + +class SourceControlConfigurationList(msrest.serialization.Model): + """Result of the request to list Source Control Configurations. It contains a list of SourceControlConfiguration objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Source Control Configurations within a Kubernetes cluster. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration] + :ivar next_link: URL to get the next set of configuration objects, if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SourceControlConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlConfigurationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SupportedScopes(msrest.serialization.Model): + """Extension scopes. + + :param default_scope: Default extension scopes: cluster or namespace. + :type default_scope: str + :param cluster_scope_settings: Scope settings. + :type cluster_scope_settings: + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ClusterScopeSettings + """ + + _attribute_map = { + 'default_scope': {'key': 'defaultScope', 'type': 'str'}, + 'cluster_scope_settings': {'key': 'clusterScopeSettings', 'type': 'ClusterScopeSettings'}, + } + + def __init__( + self, + **kwargs + ): + super(SupportedScopes, self).__init__(**kwargs) + self.default_scope = kwargs.get('default_scope', None) + self.cluster_scope_settings = kwargs.get('cluster_scope_settings', None) + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_models_py3.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_models_py3.py index b7d98fd1b6d..d2a627f98e7 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_models_py3.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_models_py3.py @@ -46,8 +46,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -85,8 +88,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ProxyResource, self).__init__(**kwargs) @@ -103,10 +109,17 @@ class ClusterScopeSettings(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str +<<<<<<< HEAD :ivar allow_multiple_instances: Describes if multiple instances of the extension are allowed. :vartype allow_multiple_instances: bool :ivar default_release_namespace: Default extension release namespace. :vartype default_release_namespace: str +======= + :param allow_multiple_instances: Describes if multiple instances of the extension are allowed. + :type allow_multiple_instances: bool + :param default_release_namespace: Default extension release namespace. + :type default_release_namespace: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -130,6 +143,7 @@ def __init__( default_release_namespace: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword allow_multiple_instances: Describes if multiple instances of the extension are allowed. @@ -137,6 +151,8 @@ def __init__( :keyword default_release_namespace: Default extension release namespace. :paramtype default_release_namespace: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ClusterScopeSettings, self).__init__(**kwargs) self.allow_multiple_instances = allow_multiple_instances self.default_release_namespace = default_release_namespace @@ -151,6 +167,7 @@ class ComplianceStatus(msrest.serialization.Model): "Pending", "Compliant", "Noncompliant", "Installed", "Failed". :vartype compliance_state: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ComplianceStateType +<<<<<<< HEAD :ivar last_config_applied: Datetime the configuration was last applied. :vartype last_config_applied: ~datetime.datetime :ivar message: Message from when the configuration was applied. @@ -158,6 +175,15 @@ class ComplianceStatus(msrest.serialization.Model): :ivar message_level: Level of the message. Possible values include: "Error", "Warning", "Information". :vartype message_level: str or +======= + :param last_config_applied: Datetime the configuration was last applied. + :type last_config_applied: ~datetime.datetime + :param message: Message from when the configuration was applied. + :type message: str + :param message_level: Level of the message. Possible values include: "Error", "Warning", + "Information". + :type message_level: str or +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.MessageLevelType """ @@ -180,6 +206,7 @@ def __init__( message_level: Optional[Union[str, "MessageLevelType"]] = None, **kwargs ): +<<<<<<< HEAD """ :keyword last_config_applied: Datetime the configuration was last applied. :paramtype last_config_applied: ~datetime.datetime @@ -190,6 +217,8 @@ def __init__( :paramtype message_level: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.MessageLevelType """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ComplianceStatus, self).__init__(**kwargs) self.compliance_state = None self.last_config_applied = last_config_applied @@ -200,8 +229,13 @@ def __init__( class DependsOnDefinition(msrest.serialization.Model): """Specify which kustomizations must succeed reconciliation on the cluster prior to reconciling this kustomization. +<<<<<<< HEAD :ivar kustomization_name: Name of the kustomization to claim dependency on. :vartype kustomization_name: str +======= + :param kustomization_name: Name of the kustomization to claim dependency on. + :type kustomization_name: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -214,10 +248,13 @@ def __init__( kustomization_name: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword kustomization_name: Name of the kustomization to claim dependency on. :paramtype kustomization_name: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(DependsOnDefinition, self).__init__(**kwargs) self.kustomization_name = kustomization_name @@ -247,8 +284,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -293,8 +333,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorDetail, self).__init__(**kwargs) self.code = None self.message = None @@ -306,8 +349,13 @@ def __init__( class ErrorResponse(msrest.serialization.Model): """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). +<<<<<<< HEAD :ivar error: The error object. :vartype error: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ErrorDetail +======= + :param error: The error object. + :type error: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ErrorDetail +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -320,10 +368,13 @@ def __init__( error: Optional["ErrorDetail"] = None, **kwargs ): +<<<<<<< HEAD """ :keyword error: The error object. :paramtype error: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ErrorDetail """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorResponse, self).__init__(**kwargs) self.error = error @@ -341,6 +392,7 @@ class Extension(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str +<<<<<<< HEAD :ivar identity: Identity of the Extension resource. :vartype identity: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Identity :ivar system_data: Top level metadata @@ -367,12 +419,45 @@ class Extension(ProxyResource): :ivar configuration_protected_settings: Configuration settings that are sensitive, as name-value pairs for configuring this extension. :vartype configuration_protected_settings: dict[str, str] +======= + :param identity: Identity of the Extension resource. + :type identity: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Identity + :ivar system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SystemData + :param extension_type: Type of the Extension, of which this resource is an instance of. It + must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the + Extension publisher. + :type extension_type: str + :param auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade + of minor version, or not. + :type auto_upgrade_minor_version: bool + :param release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. + Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :type release_train: str + :param version: Version of the extension for this extension, if it is 'pinned' to a specific + version. autoUpgradeMinorVersion must be 'false'. + :type version: str + :param scope: Scope at which the extension is installed. + :type scope: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Scope + :param configuration_settings: Configuration settings, as name-value pairs for configuring this + extension. + :type configuration_settings: dict[str, str] + :param configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :type configuration_protected_settings: dict[str, str] +>>>>>>> 331f997c (updating to the latest vendored sdk) :ivar provisioning_state: Status of installation of this extension. Possible values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". :vartype provisioning_state: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ProvisioningState +<<<<<<< HEAD :ivar statuses: Status from this extension. :vartype statuses: +======= + :param statuses: Status from this extension. + :type statuses: +>>>>>>> 331f997c (updating to the latest vendored sdk) list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionStatus] :ivar error_info: Error information from the Agent - e.g. errors during installation. :vartype error_info: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ErrorDetail @@ -380,8 +465,13 @@ class Extension(ProxyResource): :vartype custom_location_settings: dict[str, str] :ivar package_uri: Uri of the Helm package. :vartype package_uri: str +<<<<<<< HEAD :ivar aks_assigned_identity: Identity of the Extension resource in an AKS cluster. :vartype aks_assigned_identity: +======= + :param aks_assigned_identity: Identity of the Extension resource in an AKS cluster. + :type aks_assigned_identity: +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionPropertiesAksAssignedIdentity """ @@ -432,6 +522,7 @@ def __init__( aks_assigned_identity: Optional["ExtensionPropertiesAksAssignedIdentity"] = None, **kwargs ): +<<<<<<< HEAD """ :keyword identity: Identity of the Extension resource. :paramtype identity: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Identity @@ -463,6 +554,8 @@ def __init__( :paramtype aks_assigned_identity: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionPropertiesAksAssignedIdentity """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(Extension, self).__init__(**kwargs) self.identity = identity self.system_data = None @@ -490,9 +583,15 @@ class ExtensionPropertiesAksAssignedIdentity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str +<<<<<<< HEAD :ivar type: The identity type. The only acceptable values to pass in are None and "SystemAssigned". The default value is None. :vartype type: str +======= + :param type: The identity type. The only acceptable values to pass in are None and + "SystemAssigned". The default value is None. + :type type: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -512,11 +611,14 @@ def __init__( type: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword type: The identity type. The only acceptable values to pass in are None and "SystemAssigned". The default value is None. :paramtype type: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionPropertiesAksAssignedIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -548,8 +650,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionsList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -558,6 +663,7 @@ def __init__( class ExtensionStatus(msrest.serialization.Model): """Status from the extension. +<<<<<<< HEAD :ivar code: Status code provided by the Extension. :vartype code: str :ivar display_status: Short description of status of the extension. @@ -569,6 +675,19 @@ class ExtensionStatus(msrest.serialization.Model): :vartype message: str :ivar time: DateLiteral (per ISO8601) noting the time of installation status. :vartype time: str +======= + :param code: Status code provided by the Extension. + :type code: str + :param display_status: Short description of status of the extension. + :type display_status: str + :param level: Level of the status. Possible values include: "Error", "Warning", "Information". + Default value: "Information". + :type level: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.LevelType + :param message: Detailed message of the status from the Extension. + :type message: str + :param time: DateLiteral (per ISO8601) noting the time of installation status. + :type time: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -589,6 +708,7 @@ def __init__( time: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword code: Status code provided by the Extension. :paramtype code: str @@ -603,6 +723,8 @@ def __init__( :keyword time: DateLiteral (per ISO8601) noting the time of installation status. :paramtype time: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionStatus, self).__init__(**kwargs) self.code = code self.display_status = display_status @@ -647,8 +769,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionType, self).__init__(**kwargs) self.system_data = None self.release_trains = None @@ -659,11 +784,18 @@ def __init__( class ExtensionTypeList(msrest.serialization.Model): """List Extension Types. +<<<<<<< HEAD :ivar value: The list of Extension Types. :vartype value: list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionType] :ivar next_link: The link to fetch the next page of Extension Types. :vartype next_link: str +======= + :param value: The list of Extension Types. + :type value: list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionType] + :param next_link: The link to fetch the next page of Extension Types. + :type next_link: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -678,6 +810,7 @@ def __init__( next_link: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword value: The list of Extension Types. :paramtype value: @@ -685,6 +818,8 @@ def __init__( :keyword next_link: The link to fetch the next page of Extension Types. :paramtype next_link: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionTypeList, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -695,11 +830,19 @@ class ExtensionVersionList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. +<<<<<<< HEAD :ivar versions: Versions available for this Extension Type. :vartype versions: list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionVersionListVersionsItem] :ivar next_link: The link to fetch the next page of Extension Types. :vartype next_link: str +======= + :param versions: Versions available for this Extension Type. + :type versions: + list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionVersionListVersionsItem] + :param next_link: The link to fetch the next page of Extension Types. + :type next_link: str +>>>>>>> 331f997c (updating to the latest vendored sdk) :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SystemData """ @@ -721,6 +864,7 @@ def __init__( next_link: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword versions: Versions available for this Extension Type. :paramtype versions: @@ -728,6 +872,8 @@ def __init__( :keyword next_link: The link to fetch the next page of Extension Types. :paramtype next_link: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionVersionList, self).__init__(**kwargs) self.versions = versions self.next_link = next_link @@ -737,10 +883,17 @@ def __init__( class ExtensionVersionListVersionsItem(msrest.serialization.Model): """ExtensionVersionListVersionsItem. +<<<<<<< HEAD :ivar release_train: The release train for this Extension Type. :vartype release_train: str :ivar versions: Versions available for this Extension Type and release train. :vartype versions: list[str] +======= + :param release_train: The release train for this Extension Type. + :type release_train: str + :param versions: Versions available for this Extension Type and release train. + :type versions: list[str] +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -755,12 +908,15 @@ def __init__( versions: Optional[List[str]] = None, **kwargs ): +<<<<<<< HEAD """ :keyword release_train: The release train for this Extension Type. :paramtype release_train: str :keyword versions: Versions available for this Extension Type and release train. :paramtype versions: list[str] """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionVersionListVersionsItem, self).__init__(**kwargs) self.release_train = release_train self.versions = versions @@ -782,6 +938,7 @@ class FluxConfiguration(ProxyResource): :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SystemData +<<<<<<< HEAD :ivar scope: Scope at which the operator will be installed. Possible values include: "cluster", "namespace". Default value: "cluster". :vartype scope: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ScopeType @@ -805,6 +962,31 @@ class FluxConfiguration(ProxyResource): :ivar configuration_protected_settings: Key-value pairs of protected configuration settings for the configuration. :vartype configuration_protected_settings: dict[str, str] +======= + :param scope: Scope at which the operator will be installed. Possible values include: + "cluster", "namespace". Default value: "cluster". + :type scope: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ScopeType + :param namespace: The namespace to which this configuration is installed to. Maximum of 253 + lower case alphanumeric characters, hyphen and period only. + :type namespace: str + :param source_kind: Source Kind to pull the configuration data from. Possible values include: + "GitRepository". + :type source_kind: str or + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceKindType + :param suspend: Whether this configuration should suspend its reconciliation of its + kustomizations and sources. + :type suspend: bool + :param git_repository: Parameters to reconcile to the GitRepository source kind type. + :type git_repository: + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.GitRepositoryDefinition + :param kustomizations: Array of kustomizations used to reconcile the artifact pulled by the + source type on the cluster. + :type kustomizations: dict[str, + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.KustomizationDefinition] + :param configuration_protected_settings: Key-value pairs of protected configuration settings + for the configuration. + :type configuration_protected_settings: dict[str, str] +>>>>>>> 331f997c (updating to the latest vendored sdk) :ivar statuses: Statuses of the Flux Kubernetes resources created by the fluxConfiguration or created by the managed objects provisioned by the fluxConfiguration. :vartype statuses: @@ -878,6 +1060,7 @@ def __init__( configuration_protected_settings: Optional[Dict[str, str]] = None, **kwargs ): +<<<<<<< HEAD """ :keyword scope: Scope at which the operator will be installed. Possible values include: "cluster", "namespace". Default value: "cluster". @@ -904,6 +1087,8 @@ def __init__( for the configuration. :paramtype configuration_protected_settings: dict[str, str] """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(FluxConfiguration, self).__init__(**kwargs) self.system_data = None self.scope = scope @@ -925,6 +1110,7 @@ def __init__( class FluxConfigurationPatch(msrest.serialization.Model): """The Flux Configuration Patch Request object. +<<<<<<< HEAD :ivar source_kind: Source Kind to pull the configuration data from. Possible values include: "GitRepository". :vartype source_kind: str or @@ -942,6 +1128,25 @@ class FluxConfigurationPatch(msrest.serialization.Model): :ivar configuration_protected_settings: Key-value pairs of protected configuration settings for the configuration. :vartype configuration_protected_settings: dict[str, str] +======= + :param source_kind: Source Kind to pull the configuration data from. Possible values include: + "GitRepository". + :type source_kind: str or + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceKindType + :param suspend: Whether this configuration should suspend its reconciliation of its + kustomizations and sources. + :type suspend: bool + :param git_repository: Parameters to reconcile to the GitRepository source kind type. + :type git_repository: + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.GitRepositoryDefinition + :param kustomizations: Array of kustomizations used to reconcile the artifact pulled by the + source type on the cluster. + :type kustomizations: dict[str, + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.KustomizationDefinition] + :param configuration_protected_settings: Key-value pairs of protected configuration settings + for the configuration. + :type configuration_protected_settings: dict[str, str] +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -962,6 +1167,7 @@ def __init__( configuration_protected_settings: Optional[Dict[str, str]] = None, **kwargs ): +<<<<<<< HEAD """ :keyword source_kind: Source Kind to pull the configuration data from. Possible values include: "GitRepository". @@ -981,6 +1187,8 @@ def __init__( for the configuration. :paramtype configuration_protected_settings: dict[str, str] """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(FluxConfigurationPatch, self).__init__(**kwargs) self.source_kind = source_kind self.suspend = suspend @@ -1015,8 +1223,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(FluxConfigurationsList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -1025,6 +1236,7 @@ def __init__( class GitRepositoryDefinition(msrest.serialization.Model): """Parameters to reconcile to the GitRepository source kind type. +<<<<<<< HEAD :ivar url: The URL to sync for the flux configuration git repository. :vartype url: str :ivar timeout_in_seconds: The maximum time to attempt to reconcile the cluster git repository @@ -1048,6 +1260,31 @@ class GitRepositoryDefinition(msrest.serialization.Model): :ivar local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets. :vartype local_auth_ref: str +======= + :param url: The URL to sync for the flux configuration git repository. + :type url: str + :param timeout_in_seconds: The maximum time to attempt to reconcile the cluster git repository + source with the remote. + :type timeout_in_seconds: long + :param sync_interval_in_seconds: The interval at which to re-reconcile the cluster git + repository source with the remote. + :type sync_interval_in_seconds: long + :param repository_ref: The source reference for the GitRepository object. + :type repository_ref: + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.RepositoryRefDefinition + :param ssh_known_hosts: Base64-encoded known_hosts value containing public SSH keys required to + access private git repositories over SSH. + :type ssh_known_hosts: str + :param https_user: Base64-encoded HTTPS username used to access private git repositories over + HTTPS. + :type https_user: str + :param https_ca_file: Base64-encoded HTTPS certificate authority contents used to access git + private git repositories over HTTPS. + :type https_ca_file: str + :param local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :type local_auth_ref: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1074,6 +1311,7 @@ def __init__( local_auth_ref: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword url: The URL to sync for the flux configuration git repository. :paramtype url: str @@ -1099,6 +1337,8 @@ def __init__( authentication secret rather than the managed or user-provided configuration secrets. :paramtype local_auth_ref: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(GitRepositoryDefinition, self).__init__(**kwargs) self.url = url self.timeout_in_seconds = timeout_in_seconds @@ -1113,10 +1353,17 @@ def __init__( class HelmOperatorProperties(msrest.serialization.Model): """Properties for Helm operator. +<<<<<<< HEAD :ivar chart_version: Version of the operator Helm chart. :vartype chart_version: str :ivar chart_values: Values override for the operator Helm chart. :vartype chart_values: str +======= + :param chart_version: Version of the operator Helm chart. + :type chart_version: str + :param chart_values: Values override for the operator Helm chart. + :type chart_values: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1131,12 +1378,15 @@ def __init__( chart_values: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword chart_version: Version of the operator Helm chart. :paramtype chart_version: str :keyword chart_values: Values override for the operator Helm chart. :paramtype chart_values: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(HelmOperatorProperties, self).__init__(**kwargs) self.chart_version = chart_version self.chart_values = chart_values @@ -1145,6 +1395,7 @@ def __init__( class HelmReleasePropertiesDefinition(msrest.serialization.Model): """HelmReleasePropertiesDefinition. +<<<<<<< HEAD :ivar last_revision_applied: The revision number of the last released object change. :vartype last_revision_applied: long :ivar helm_chart_ref: The reference to the HelmChart object used as the source to this @@ -1157,6 +1408,20 @@ class HelmReleasePropertiesDefinition(msrest.serialization.Model): :vartype install_failure_count: long :ivar upgrade_failure_count: Number of times that the HelmRelease failed to upgrade. :vartype upgrade_failure_count: long +======= + :param last_revision_applied: The revision number of the last released object change. + :type last_revision_applied: long + :param helm_chart_ref: The reference to the HelmChart object used as the source to this + HelmRelease. + :type helm_chart_ref: + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ObjectReferenceDefinition + :param failure_count: Total number of times that the HelmRelease failed to install or upgrade. + :type failure_count: long + :param install_failure_count: Number of times that the HelmRelease failed to install. + :type install_failure_count: long + :param upgrade_failure_count: Number of times that the HelmRelease failed to upgrade. + :type upgrade_failure_count: long +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1177,6 +1442,7 @@ def __init__( upgrade_failure_count: Optional[int] = None, **kwargs ): +<<<<<<< HEAD """ :keyword last_revision_applied: The revision number of the last released object change. :paramtype last_revision_applied: long @@ -1192,6 +1458,8 @@ def __init__( :keyword upgrade_failure_count: Number of times that the HelmRelease failed to upgrade. :paramtype upgrade_failure_count: long """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(HelmReleasePropertiesDefinition, self).__init__(**kwargs) self.last_revision_applied = last_revision_applied self.helm_chart_ref = helm_chart_ref @@ -1209,9 +1477,15 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str +<<<<<<< HEAD :ivar type: The identity type. The only acceptable values to pass in are None and "SystemAssigned". The default value is None. :vartype type: str +======= + :param type: The identity type. The only acceptable values to pass in are None and + "SystemAssigned". The default value is None. + :type type: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -1231,11 +1505,14 @@ def __init__( type: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword type: The identity type. The only acceptable values to pass in are None and "SystemAssigned". The default value is None. :paramtype type: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(Identity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -1245,6 +1522,7 @@ def __init__( class KustomizationDefinition(msrest.serialization.Model): """The Kustomization defining how to reconcile the artifact pulled by the source type on the cluster. +<<<<<<< HEAD :ivar path: The path in the source reference to reconcile on the cluster. :vartype path: str :ivar depends_on: Specifies other Kustomizations that this Kustomization depends on. This @@ -1271,6 +1549,34 @@ class KustomizationDefinition(msrest.serialization.Model): :ivar force: Enable/disable re-creating Kubernetes resources on the cluster when patching fails due to an immutable field change. :vartype force: bool +======= + :param path: The path in the source reference to reconcile on the cluster. + :type path: str + :param depends_on: Specifies other Kustomizations that this Kustomization depends on. This + Kustomization will not reconcile until all dependencies have completed their reconciliation. + :type depends_on: + list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.DependsOnDefinition] + :param timeout_in_seconds: The maximum time to attempt to reconcile the Kustomization on the + cluster. + :type timeout_in_seconds: long + :param sync_interval_in_seconds: The interval at which to re-reconcile the Kustomization on the + cluster. + :type sync_interval_in_seconds: long + :param retry_interval_in_seconds: The interval at which to re-reconcile the Kustomization on + the cluster in the event of failure on reconciliation. + :type retry_interval_in_seconds: long + :param prune: Enable/disable garbage collections of Kubernetes objects created by this + Kustomization. + :type prune: bool + :param validation: Specify whether to validate the Kubernetes objects referenced in the + Kustomization before applying them to the cluster. Possible values include: "none", "client", + "server". Default value: "none". + :type validation: str or + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.KustomizationValidationType + :param force: Enable/disable re-creating Kubernetes resources on the cluster when patching + fails due to an immutable field change. + :type force: bool +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1297,6 +1603,7 @@ def __init__( force: Optional[bool] = False, **kwargs ): +<<<<<<< HEAD """ :keyword path: The path in the source reference to reconcile on the cluster. :paramtype path: str @@ -1325,6 +1632,8 @@ def __init__( fails due to an immutable field change. :paramtype force: bool """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(KustomizationDefinition, self).__init__(**kwargs) self.path = path self.depends_on = depends_on @@ -1339,10 +1648,17 @@ def __init__( class ObjectReferenceDefinition(msrest.serialization.Model): """Object reference to a Kubernetes object on a cluster. +<<<<<<< HEAD :ivar name: Name of the object. :vartype name: str :ivar namespace: Namespace of the object. :vartype namespace: str +======= + :param name: Name of the object. + :type name: str + :param namespace: Namespace of the object. + :type namespace: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1357,12 +1673,15 @@ def __init__( namespace: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword name: Name of the object. :paramtype name: str :keyword namespace: Namespace of the object. :paramtype namespace: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ObjectReferenceDefinition, self).__init__(**kwargs) self.name = name self.namespace = namespace @@ -1371,6 +1690,7 @@ def __init__( class ObjectStatusConditionDefinition(msrest.serialization.Model): """Status condition of Kubernetes object. +<<<<<<< HEAD :ivar last_transition_time: Last time this status condition has changed. :vartype last_transition_time: ~datetime.datetime :ivar message: A more verbose description of the object status condition. @@ -1381,6 +1701,18 @@ class ObjectStatusConditionDefinition(msrest.serialization.Model): :vartype status: str :ivar type: Object status condition type for this object. :vartype type: str +======= + :param last_transition_time: Last time this status condition has changed. + :type last_transition_time: ~datetime.datetime + :param message: A more verbose description of the object status condition. + :type message: str + :param reason: Reason for the specified status condition type status. + :type reason: str + :param status: Status of the Kubernetes object condition type. + :type status: str + :param type: Object status condition type for this object. + :type type: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1401,6 +1733,7 @@ def __init__( type: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword last_transition_time: Last time this status condition has changed. :paramtype last_transition_time: ~datetime.datetime @@ -1413,6 +1746,8 @@ def __init__( :keyword type: Object status condition type for this object. :paramtype type: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ObjectStatusConditionDefinition, self).__init__(**kwargs) self.last_transition_time = last_transition_time self.message = message @@ -1424,6 +1759,7 @@ def __init__( class ObjectStatusDefinition(msrest.serialization.Model): """Statuses of objects deployed by the user-specified kustomizations from the git repository. +<<<<<<< HEAD :ivar name: Name of the applied object. :vartype name: str :ivar namespace: Namespace of the applied object. @@ -1444,6 +1780,28 @@ class ObjectStatusDefinition(msrest.serialization.Model): :ivar helm_release_properties: Additional properties that are provided from objects of the HelmRelease kind. :vartype helm_release_properties: +======= + :param name: Name of the applied object. + :type name: str + :param namespace: Namespace of the applied object. + :type namespace: str + :param kind: Kind of the applied object. + :type kind: str + :param compliance_state: Compliance state of the applied object showing whether the applied + object has come into a ready state on the cluster. Possible values include: "Compliant", + "Non-Compliant", "Pending", "Suspended", "Unknown". Default value: "Unknown". + :type compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxComplianceState + :param applied_by: Object reference to the Kustomization that applied this object. + :type applied_by: + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ObjectReferenceDefinition + :param status_conditions: List of Kubernetes object status conditions present on the cluster. + :type status_conditions: + list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ObjectStatusConditionDefinition] + :param helm_release_properties: Additional properties that are provided from objects of the + HelmRelease kind. + :type helm_release_properties: +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.HelmReleasePropertiesDefinition """ @@ -1469,6 +1827,7 @@ def __init__( helm_release_properties: Optional["HelmReleasePropertiesDefinition"] = None, **kwargs ): +<<<<<<< HEAD """ :keyword name: Name of the applied object. :paramtype name: str @@ -1492,6 +1851,8 @@ def __init__( :paramtype helm_release_properties: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.HelmReleasePropertiesDefinition """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ObjectStatusDefinition, self).__init__(**kwargs) self.name = name self.namespace = namespace @@ -1528,8 +1889,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(OperationStatusList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -1542,6 +1906,7 @@ class OperationStatusResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. +<<<<<<< HEAD :ivar id: Fully qualified ID for the async operation. :vartype id: str :ivar name: Name of the async operation. @@ -1550,6 +1915,16 @@ class OperationStatusResult(msrest.serialization.Model): :vartype status: str :ivar properties: Additional information, if available. :vartype properties: dict[str, str] +======= + :param id: Fully qualified ID for the async operation. + :type id: str + :param name: Name of the async operation. + :type name: str + :param status: Required. Operation status. + :type status: str + :param properties: Additional information, if available. + :type properties: dict[str, str] +>>>>>>> 331f997c (updating to the latest vendored sdk) :ivar error: If present, details of the operation error. :vartype error: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ErrorDetail """ @@ -1576,6 +1951,7 @@ def __init__( properties: Optional[Dict[str, str]] = None, **kwargs ): +<<<<<<< HEAD """ :keyword id: Fully qualified ID for the async operation. :paramtype id: str @@ -1586,6 +1962,8 @@ def __init__( :keyword properties: Additional information, if available. :paramtype properties: dict[str, str] """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(OperationStatusResult, self).__init__(**kwargs) self.id = id self.name = name @@ -1597,6 +1975,7 @@ def __init__( class PatchExtension(msrest.serialization.Model): """The Extension Patch Request object. +<<<<<<< HEAD :ivar auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade of minor version, or not. :vartype auto_upgrade_minor_version: bool @@ -1612,6 +1991,23 @@ class PatchExtension(msrest.serialization.Model): :ivar configuration_protected_settings: Configuration settings that are sensitive, as name-value pairs for configuring this extension. :vartype configuration_protected_settings: dict[str, str] +======= + :param auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade + of minor version, or not. + :type auto_upgrade_minor_version: bool + :param release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. + Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :type release_train: str + :param version: Version of the extension for this extension, if it is 'pinned' to a specific + version. autoUpgradeMinorVersion must be 'false'. + :type version: str + :param configuration_settings: Configuration settings, as name-value pairs for configuring this + extension. + :type configuration_settings: dict[str, str] + :param configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :type configuration_protected_settings: dict[str, str] +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1632,6 +2028,7 @@ def __init__( configuration_protected_settings: Optional[Dict[str, str]] = None, **kwargs ): +<<<<<<< HEAD """ :keyword auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade of minor version, or not. @@ -1649,6 +2046,8 @@ def __init__( name-value pairs for configuring this extension. :paramtype configuration_protected_settings: dict[str, str] """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(PatchExtension, self).__init__(**kwargs) self.auto_upgrade_minor_version = auto_upgrade_minor_version self.release_train = release_train @@ -1660,6 +2059,7 @@ def __init__( class RepositoryRefDefinition(msrest.serialization.Model): """The source reference for the GitRepository object. +<<<<<<< HEAD :ivar branch: The git repository branch name to checkout. :vartype branch: str :ivar tag: The git repository tag name to checkout. This takes precedence over branch. @@ -1670,6 +2070,18 @@ class RepositoryRefDefinition(msrest.serialization.Model): :ivar commit: The commit SHA to checkout. This value must be combined with the branch name to be valid. This takes precedence over semver. :vartype commit: str +======= + :param branch: The git repository branch name to checkout. + :type branch: str + :param tag: The git repository tag name to checkout. This takes precedence over branch. + :type tag: str + :param semver: The semver range used to match against git repository tags. This takes + precedence over tag. + :type semver: str + :param commit: The commit SHA to checkout. This value must be combined with the branch name to + be valid. This takes precedence over semver. + :type commit: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1688,6 +2100,7 @@ def __init__( commit: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword branch: The git repository branch name to checkout. :paramtype branch: str @@ -1700,6 +2113,8 @@ def __init__( to be valid. This takes precedence over semver. :paramtype commit: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(RepositoryRefDefinition, self).__init__(**kwargs) self.branch = branch self.tag = tag @@ -1712,10 +2127,17 @@ class ResourceProviderOperation(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. +<<<<<<< HEAD :ivar name: Operation name, in format of {provider}/{resource}/{operation}. :vartype name: str :ivar display: Display metadata associated with the operation. :vartype display: +======= + :param name: Operation name, in format of {provider}/{resource}/{operation}. + :type name: str + :param display: Display metadata associated with the operation. + :type display: +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ResourceProviderOperationDisplay :ivar is_data_action: The flag that indicates whether the operation applies to data plane. :vartype is_data_action: bool @@ -1742,6 +2164,7 @@ def __init__( display: Optional["ResourceProviderOperationDisplay"] = None, **kwargs ): +<<<<<<< HEAD """ :keyword name: Operation name, in format of {provider}/{resource}/{operation}. :paramtype name: str @@ -1749,6 +2172,8 @@ def __init__( :paramtype display: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ResourceProviderOperationDisplay """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperation, self).__init__(**kwargs) self.name = name self.display = display @@ -1759,6 +2184,7 @@ def __init__( class ResourceProviderOperationDisplay(msrest.serialization.Model): """Display metadata associated with the operation. +<<<<<<< HEAD :ivar provider: Resource provider: Microsoft KubernetesConfiguration. :vartype provider: str :ivar resource: Resource on which the operation is performed. @@ -1767,6 +2193,16 @@ class ResourceProviderOperationDisplay(msrest.serialization.Model): :vartype operation: str :ivar description: Description of this operation. :vartype description: str +======= + :param provider: Resource provider: Microsoft KubernetesConfiguration. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this operation. + :type description: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1785,6 +2221,7 @@ def __init__( description: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword provider: Resource provider: Microsoft KubernetesConfiguration. :paramtype provider: str @@ -1795,6 +2232,8 @@ def __init__( :keyword description: Description of this operation. :paramtype description: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperationDisplay, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -1807,8 +2246,13 @@ class ResourceProviderOperationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. +<<<<<<< HEAD :ivar value: List of operations supported by this resource provider. :vartype value: +======= + :param value: List of operations supported by this resource provider. + :type value: +>>>>>>> 331f997c (updating to the latest vendored sdk) list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ResourceProviderOperation] :ivar next_link: URL to the next set of results, if any. :vartype next_link: str @@ -1829,11 +2273,14 @@ def __init__( value: Optional[List["ResourceProviderOperation"]] = None, **kwargs ): +<<<<<<< HEAD """ :keyword value: List of operations supported by this resource provider. :paramtype value: list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ResourceProviderOperation] """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperationList, self).__init__(**kwargs) self.value = value self.next_link = None @@ -1842,11 +2289,18 @@ def __init__( class Scope(msrest.serialization.Model): """Scope of the extension. It can be either Cluster or Namespace; but not both. +<<<<<<< HEAD :ivar cluster: Specifies that the scope of the extension is Cluster. :vartype cluster: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ScopeCluster :ivar namespace: Specifies that the scope of the extension is Namespace. :vartype namespace: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ScopeNamespace +======= + :param cluster: Specifies that the scope of the extension is Cluster. + :type cluster: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ScopeCluster + :param namespace: Specifies that the scope of the extension is Namespace. + :type namespace: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ScopeNamespace +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1861,6 +2315,7 @@ def __init__( namespace: Optional["ScopeNamespace"] = None, **kwargs ): +<<<<<<< HEAD """ :keyword cluster: Specifies that the scope of the extension is Cluster. :paramtype cluster: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ScopeCluster @@ -1868,6 +2323,8 @@ def __init__( :paramtype namespace: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ScopeNamespace """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(Scope, self).__init__(**kwargs) self.cluster = cluster self.namespace = namespace @@ -1876,9 +2333,15 @@ def __init__( class ScopeCluster(msrest.serialization.Model): """Specifies that the scope of the extension is Cluster. +<<<<<<< HEAD :ivar release_namespace: Namespace where the extension Release must be placed, for a Cluster scoped extension. If this namespace does not exist, it will be created. :vartype release_namespace: str +======= + :param release_namespace: Namespace where the extension Release must be placed, for a Cluster + scoped extension. If this namespace does not exist, it will be created. + :type release_namespace: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1891,11 +2354,14 @@ def __init__( release_namespace: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword release_namespace: Namespace where the extension Release must be placed, for a Cluster scoped extension. If this namespace does not exist, it will be created. :paramtype release_namespace: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ScopeCluster, self).__init__(**kwargs) self.release_namespace = release_namespace @@ -1903,9 +2369,15 @@ def __init__( class ScopeNamespace(msrest.serialization.Model): """Specifies that the scope of the extension is Namespace. +<<<<<<< HEAD :ivar target_namespace: Namespace where the extension will be created for an Namespace scoped extension. If this namespace does not exist, it will be created. :vartype target_namespace: str +======= + :param target_namespace: Namespace where the extension will be created for an Namespace scoped + extension. If this namespace does not exist, it will be created. + :type target_namespace: str +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1918,11 +2390,14 @@ def __init__( target_namespace: Optional[str] = None, **kwargs ): +<<<<<<< HEAD """ :keyword target_namespace: Namespace where the extension will be created for an Namespace scoped extension. If this namespace does not exist, it will be created. :paramtype target_namespace: str """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(ScopeNamespace, self).__init__(**kwargs) self.target_namespace = target_namespace @@ -1943,6 +2418,7 @@ class SourceControlConfiguration(ProxyResource): :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SystemData +<<<<<<< HEAD :ivar repository_url: Url of the SourceControl Repository. :vartype repository_url: str :ivar operator_namespace: The namespace to which this operator is installed to. Maximum of 253 @@ -1962,10 +2438,32 @@ class SourceControlConfiguration(ProxyResource): :ivar operator_scope: Scope at which the operator will be installed. Possible values include: "cluster", "namespace". Default value: "cluster". :vartype operator_scope: str or +======= + :param repository_url: Url of the SourceControl Repository. + :type repository_url: str + :param operator_namespace: The namespace to which this operator is installed to. Maximum of 253 + lower case alphanumeric characters, hyphen and period only. + :type operator_namespace: str + :param operator_instance_name: Instance name of the operator - identifying the specific + configuration. + :type operator_instance_name: str + :param operator_type: Type of the operator. Possible values include: "Flux". + :type operator_type: str or + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.OperatorType + :param operator_params: Any Parameters for the Operator instance in string format. + :type operator_params: str + :param configuration_protected_settings: Name-value pairs of protected configuration settings + for the configuration. + :type configuration_protected_settings: dict[str, str] + :param operator_scope: Scope at which the operator will be installed. Possible values include: + "cluster", "namespace". Default value: "cluster". + :type operator_scope: str or +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.OperatorScopeType :ivar repository_public_key: Public Key associated with this SourceControl configuration (either generated within the cluster or provided by the user). :vartype repository_public_key: str +<<<<<<< HEAD :ivar ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys required to access private Git instances. :vartype ssh_known_hosts_contents: str @@ -1973,6 +2471,15 @@ class SourceControlConfiguration(ProxyResource): :vartype enable_helm_operator: bool :ivar helm_operator_properties: Properties for Helm operator. :vartype helm_operator_properties: +======= + :param ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys + required to access private Git instances. + :type ssh_known_hosts_contents: str + :param enable_helm_operator: Option to enable Helm Operator for this git configuration. + :type enable_helm_operator: bool + :param helm_operator_properties: Properties for Helm operator. + :type helm_operator_properties: +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.HelmOperatorProperties :ivar provisioning_state: The provisioning state of the resource provider. Possible values include: "Accepted", "Deleting", "Running", "Succeeded", "Failed". @@ -2028,6 +2535,7 @@ def __init__( helm_operator_properties: Optional["HelmOperatorProperties"] = None, **kwargs ): +<<<<<<< HEAD """ :keyword repository_url: Url of the SourceControl Repository. :paramtype repository_url: str @@ -2058,6 +2566,8 @@ def __init__( :paramtype helm_operator_properties: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.HelmOperatorProperties """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(SourceControlConfiguration, self).__init__(**kwargs) self.system_data = None self.repository_url = repository_url @@ -2101,8 +2611,11 @@ def __init__( self, **kwargs ): +<<<<<<< HEAD """ """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(SourceControlConfigurationList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -2111,10 +2624,17 @@ def __init__( class SupportedScopes(msrest.serialization.Model): """Extension scopes. +<<<<<<< HEAD :ivar default_scope: Default extension scopes: cluster or namespace. :vartype default_scope: str :ivar cluster_scope_settings: Scope settings. :vartype cluster_scope_settings: +======= + :param default_scope: Default extension scopes: cluster or namespace. + :type default_scope: str + :param cluster_scope_settings: Scope settings. + :type cluster_scope_settings: +>>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ClusterScopeSettings """ @@ -2130,6 +2650,7 @@ def __init__( cluster_scope_settings: Optional["ClusterScopeSettings"] = None, **kwargs ): +<<<<<<< HEAD """ :keyword default_scope: Default extension scopes: cluster or namespace. :paramtype default_scope: str @@ -2137,6 +2658,8 @@ def __init__( :paramtype cluster_scope_settings: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ClusterScopeSettings """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(SupportedScopes, self).__init__(**kwargs) self.default_scope = default_scope self.cluster_scope_settings = cluster_scope_settings @@ -2145,6 +2668,7 @@ def __init__( class SystemData(msrest.serialization.Model): """Metadata pertaining to creation and last modification of the resource. +<<<<<<< HEAD :ivar created_by: The identity that created the resource. :vartype created_by: str :ivar created_by_type: The type of identity that created the resource. Possible values include: @@ -2161,6 +2685,24 @@ class SystemData(msrest.serialization.Model): ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.CreatedByType :ivar last_modified_at: The timestamp of resource last modification (UTC). :vartype last_modified_at: ~datetime.datetime +======= + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime +>>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -2183,6 +2725,7 @@ def __init__( last_modified_at: Optional[datetime.datetime] = None, **kwargs ): +<<<<<<< HEAD """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -2201,6 +2744,8 @@ def __init__( :keyword last_modified_at: The timestamp of resource last modification (UTC). :paramtype last_modified_at: ~datetime.datetime """ +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) super(SystemData, self).__init__(**kwargs) self.created_by = created_by self.created_by_type = created_by_type diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_source_control_configuration_client_enums.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_source_control_configuration_client_enums.py index 544b13b91c2..a52d279870a 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_source_control_configuration_client_enums.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_source_control_configuration_client_enums.py @@ -6,19 +6,47 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD from enum import Enum from six import with_metaclass from azure.core import CaseInsensitiveEnumMeta class ClusterTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class ClusterTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Cluster types """ CONNECTED_CLUSTERS = "connectedClusters" MANAGED_CLUSTERS = "managedClusters" +<<<<<<< HEAD class ComplianceStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class ComplianceStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """The compliance state of the configuration. """ @@ -28,7 +56,11 @@ class ComplianceStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): INSTALLED = "Installed" FAILED = "Failed" +<<<<<<< HEAD class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """The type of identity that created the resource. """ @@ -37,17 +69,29 @@ class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" +<<<<<<< HEAD class Enum0(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class Enum0(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) MICROSOFT_CONTAINER_SERVICE = "Microsoft.ContainerService" MICROSOFT_KUBERNETES = "Microsoft.Kubernetes" +<<<<<<< HEAD class Enum1(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class Enum1(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) MANAGED_CLUSTERS = "managedClusters" CONNECTED_CLUSTERS = "connectedClusters" +<<<<<<< HEAD class FluxComplianceState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class FluxComplianceState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Compliance state of the cluster object. """ @@ -57,7 +101,11 @@ class FluxComplianceState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): SUSPENDED = "Suspended" UNKNOWN = "Unknown" +<<<<<<< HEAD class KustomizationValidationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class KustomizationValidationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Specify whether to validate the Kubernetes objects referenced in the Kustomization before applying them to the cluster. """ @@ -66,7 +114,11 @@ class KustomizationValidationType(with_metaclass(CaseInsensitiveEnumMeta, str, E CLIENT = "client" SERVER = "server" +<<<<<<< HEAD class LevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class LevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Level of the status. """ @@ -74,7 +126,11 @@ class LevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): WARNING = "Warning" INFORMATION = "Information" +<<<<<<< HEAD class MessageLevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class MessageLevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Level of the message. """ @@ -82,20 +138,32 @@ class MessageLevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): WARNING = "Warning" INFORMATION = "Information" +<<<<<<< HEAD class OperatorScopeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class OperatorScopeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Scope at which the operator will be installed. """ CLUSTER = "cluster" NAMESPACE = "namespace" +<<<<<<< HEAD class OperatorType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class OperatorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Type of the operator """ FLUX = "Flux" +<<<<<<< HEAD class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """The provisioning state of the resource. """ @@ -106,7 +174,11 @@ class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): UPDATING = "Updating" DELETING = "Deleting" +<<<<<<< HEAD class ProvisioningStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class ProvisioningStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """The provisioning state of the resource provider. """ @@ -116,14 +188,22 @@ class ProvisioningStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): SUCCEEDED = "Succeeded" FAILED = "Failed" +<<<<<<< HEAD class ScopeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class ScopeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Scope at which the configuration will be installed. """ CLUSTER = "cluster" NAMESPACE = "namespace" +<<<<<<< HEAD class SourceKindType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +======= +class SourceKindType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +>>>>>>> 331f997c (updating to the latest vendored sdk) """Source Kind to pull the configuration data from. """ diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_cluster_extension_type_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_cluster_extension_type_operations.py index 3521f8a7573..9d985e419b3 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_cluster_extension_type_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_cluster_extension_type_operations.py @@ -5,12 +5,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +======= +from typing import TYPE_CHECKING +>>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -64,6 +69,19 @@ def build_get_request( headers=header_parameters, **kwargs ) +======= +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +>>>>>>> 331f997c (updating to the latest vendored sdk) class ClusterExtensionTypeOperations(object): """ClusterExtensionTypeOperations operations. @@ -87,6 +105,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace def get( self, @@ -97,6 +116,18 @@ def get( extension_type_name: str, **kwargs: Any ) -> "_models.ExtensionType": +======= + def get( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_type_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ExtensionType" +>>>>>>> 331f997c (updating to the latest vendored sdk) """Get Extension Type details. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -106,8 +137,12 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_type_name: Extension type name. @@ -122,6 +157,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -136,12 +172,42 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionTypeName': self._serialize.url("extension_type_name", extension_type_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExtensionType', pipeline_response) @@ -150,6 +216,10 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{extensionTypeName}'} # type: ignore +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{extensionTypeName}'} # type: ignore +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_cluster_extension_types_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_cluster_extension_types_operations.py index 7d7e58989f9..778b39ddf1d 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_cluster_extension_types_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_cluster_extension_types_operations.py @@ -5,13 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +======= +from typing import TYPE_CHECKING +>>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -63,6 +68,19 @@ def build_list_request( headers=header_parameters, **kwargs ) +======= +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +>>>>>>> 331f997c (updating to the latest vendored sdk) class ClusterExtensionTypesOperations(object): """ClusterExtensionTypesOperations operations. @@ -86,6 +104,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace def list( self, @@ -95,6 +114,17 @@ def list( cluster_name: str, **kwargs: Any ) -> Iterable["_models.ExtensionTypeList"]: +======= + def list( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ExtensionTypeList"] +>>>>>>> 331f997c (updating to the latest vendored sdk) """Get Extension Types. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -104,14 +134,22 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionTypeList or the result of cls(response) +<<<<<<< HEAD :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionTypeList] +======= + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionTypeList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionTypeList"] @@ -119,6 +157,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -150,6 +189,40 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionTypeList", pipeline_response) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ExtensionTypeList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -162,13 +235,21 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_extension_type_versions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_extension_type_versions_operations.py index b9e4fd842ee..7103eabd50f 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_extension_type_versions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_extension_type_versions_operations.py @@ -5,13 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +======= +from typing import TYPE_CHECKING +>>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -59,6 +64,19 @@ def build_list_request( headers=header_parameters, **kwargs ) +======= +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +>>>>>>> 331f997c (updating to the latest vendored sdk) class ExtensionTypeVersionsOperations(object): """ExtensionTypeVersionsOperations operations. @@ -82,6 +100,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace def list( self, @@ -89,6 +108,15 @@ def list( extension_type_name: str, **kwargs: Any ) -> Iterable["_models.ExtensionVersionList"]: +======= + def list( + self, + location, # type: str + extension_type_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ExtensionVersionList"] +>>>>>>> 331f997c (updating to the latest vendored sdk) """List available versions for an Extension Type. :param location: extension location. @@ -96,10 +124,15 @@ def list( :param extension_type_name: Extension type name. :type extension_type_name: str :keyword callable cls: A custom type or function that will be passed the direct response +<<<<<<< HEAD :return: An iterator like instance of either ExtensionVersionList or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionVersionList] +======= + :return: An iterator like instance of either ExtensionVersionList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionVersionList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionVersionList"] @@ -107,6 +140,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -134,6 +168,38 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionVersionList", pipeline_response) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'location': self._serialize.url("location", location, 'str'), + 'extensionTypeName': self._serialize.url("extension_type_name", extension_type_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ExtensionVersionList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.versions if cls: list_of_elem = cls(list_of_elem) @@ -146,13 +212,21 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_extensions_operations.py index 0531c000385..287ba611fe8 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_extensions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_extensions_operations.py @@ -5,13 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +======= +from typing import TYPE_CHECKING +>>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest @@ -252,6 +257,21 @@ def build_list_request( headers=header_parameters, **kwargs ) +======= +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +>>>>>>> 331f997c (updating to the latest vendored sdk) class ExtensionsOperations(object): """ExtensionsOperations operations. @@ -277,6 +297,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_initial( self, +<<<<<<< HEAD resource_group_name: str, cluster_rp: Union[str, "_models.Enum0"], cluster_resource_name: Union[str, "_models.Enum1"], @@ -285,11 +306,23 @@ def _create_initial( extension: "_models.Extension", **kwargs: Any ) -> "_models.Extension": +======= + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_name, # type: str + extension, # type: "_models.Extension" + **kwargs # type: Any + ): + # type: (...) -> "_models.Extension" +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -309,12 +342,48 @@ def _create_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(extension, 'Extension') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) if response.status_code == 200: deserialized = self._deserialize('Extension', pipeline_response) @@ -326,6 +395,7 @@ def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @@ -341,6 +411,21 @@ def begin_create( extension: "_models.Extension", **kwargs: Any ) -> LROPoller["_models.Extension"]: +======= + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_name, # type: str + extension, # type: "_models.Extension" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Extension"] +>>>>>>> 331f997c (updating to the latest vendored sdk) """Create a new Kubernetes Cluster Extension. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -350,8 +435,12 @@ def begin_create( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -360,6 +449,7 @@ def begin_create( :type extension: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Extension :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. +<<<<<<< HEAD :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -373,6 +463,17 @@ def begin_create( """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] +======= + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Extension or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] lro_delay = kwargs.pop( 'polling_interval', @@ -387,6 +488,7 @@ def begin_create( cluster_name=cluster_name, extension_name=extension_name, extension=extension, +<<<<<<< HEAD content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -396,12 +498,37 @@ def begin_create( def get_long_running_output(pipeline_response): response = pipeline_response.http_response deserialized = self._deserialize('Extension', pipeline_response) +======= + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Extension', pipeline_response) + +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -413,6 +540,7 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @@ -426,6 +554,20 @@ def get( extension_name: str, **kwargs: Any ) -> "_models.Extension": +======= + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Extension" +>>>>>>> 331f997c (updating to the latest vendored sdk) """Gets Kubernetes Cluster Extension. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -435,8 +577,12 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -451,6 +597,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -465,12 +612,42 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Extension', pipeline_response) @@ -479,6 +656,7 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @@ -493,11 +671,27 @@ def _delete_initial( force_delete: Optional[bool] = None, **kwargs: Any ) -> None: +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_name, # type: str + force_delete=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_delete_request_initial( @@ -513,18 +707,52 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if force_delete is not None: + query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore +<<<<<<< HEAD @distributed_trace def begin_delete( @@ -537,6 +765,19 @@ def begin_delete( force_delete: Optional[bool] = None, **kwargs: Any ) -> LROPoller[None]: +======= + def begin_delete( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_name, # type: str + force_delete=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] +>>>>>>> 331f997c (updating to the latest vendored sdk) """Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. @@ -547,8 +788,12 @@ def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -558,6 +803,7 @@ def begin_delete( :type force_delete: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. +<<<<<<< HEAD :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -569,6 +815,17 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] +======= + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -586,14 +843,33 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) +<<<<<<< HEAD kwargs.pop('error_map', None) +======= + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) +>>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) +<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -605,11 +881,15 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore def _update_initial( self, +<<<<<<< HEAD resource_group_name: str, cluster_rp: Union[str, "_models.Enum0"], cluster_resource_name: Union[str, "_models.Enum1"], @@ -642,12 +922,64 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_name, # type: str + patch_extension, # type: "_models.PatchExtension" + **kwargs # type: Any + ): + # type: (...) -> "_models.Extension" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: lambda response: ResourceExistsError(response=response, model=self._deserialize(_models.ErrorResponse, response), error_format=ARMErrorFormat), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(patch_extension, 'PatchExtension') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) deserialized = self._deserialize('Extension', pipeline_response) @@ -655,6 +987,7 @@ def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @@ -670,6 +1003,21 @@ def begin_update( patch_extension: "_models.PatchExtension", **kwargs: Any ) -> LROPoller["_models.Extension"]: +======= + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_name, # type: str + patch_extension, # type: "_models.PatchExtension" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Extension"] +>>>>>>> 331f997c (updating to the latest vendored sdk) """Patch an existing Kubernetes Cluster Extension. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -679,13 +1027,18 @@ def begin_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. :type extension_name: str :param patch_extension: Properties to Patch in an existing Extension. +<<<<<<< HEAD :type patch_extension: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.PatchExtension :keyword callable cls: A custom type or function that will be passed the direct response @@ -703,6 +1056,20 @@ def begin_update( """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] +======= + :type patch_extension: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.PatchExtension + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Extension or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] lro_delay = kwargs.pop( 'polling_interval', @@ -717,6 +1084,7 @@ def begin_update( cluster_name=cluster_name, extension_name=extension_name, patch_extension=patch_extension, +<<<<<<< HEAD content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -726,12 +1094,37 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response deserialized = self._deserialize('Extension', pipeline_response) +======= + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Extension', pipeline_response) + +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -743,6 +1136,7 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @@ -755,6 +1149,19 @@ def list( cluster_name: str, **kwargs: Any ) -> Iterable["_models.ExtensionsList"]: +======= + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ExtensionsList"] +>>>>>>> 331f997c (updating to the latest vendored sdk) """List all Extensions in the cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -764,14 +1171,22 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionsList or the result of cls(response) +<<<<<<< HEAD :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionsList] +======= + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionsList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionsList"] @@ -779,6 +1194,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -810,6 +1226,40 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionsList", pipeline_response) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ExtensionsList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -822,13 +1272,21 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_flux_config_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_flux_config_operation_status_operations.py index dea63e7dac3..fcab06502d7 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_flux_config_operation_status_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_flux_config_operation_status_operations.py @@ -5,12 +5,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +======= +from typing import TYPE_CHECKING +>>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -66,6 +71,19 @@ def build_get_request( headers=header_parameters, **kwargs ) +======= +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +>>>>>>> 331f997c (updating to the latest vendored sdk) class FluxConfigOperationStatusOperations(object): """FluxConfigOperationStatusOperations operations. @@ -89,6 +107,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace def get( self, @@ -100,6 +119,19 @@ def get( operation_id: str, **kwargs: Any ) -> "_models.OperationStatusResult": +======= + def get( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + flux_configuration_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.OperationStatusResult" +>>>>>>> 331f997c (updating to the latest vendored sdk) """Get Async Operation status. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -109,8 +141,12 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param flux_configuration_name: Name of the Flux Configuration. @@ -127,6 +163,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -142,12 +179,43 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OperationStatusResult', pipeline_response) @@ -156,6 +224,10 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}/operations/{operationId}'} # type: ignore +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}/operations/{operationId}'} # type: ignore +>>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_flux_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_flux_configurations_operations.py index c3d3cf613ba..a9517c7dfce 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_flux_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_flux_configurations_operations.py @@ -5,13 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +======= +from typing import TYPE_CHECKING +>>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest @@ -252,6 +257,21 @@ def build_list_request( headers=header_parameters, **kwargs ) +======= +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +>>>>>>> 331f997c (updating to the latest vendored sdk) class FluxConfigurationsOperations(object): """FluxConfigurationsOperations operations. @@ -275,6 +295,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace def get( self, @@ -285,6 +306,18 @@ def get( flux_configuration_name: str, **kwargs: Any ) -> "_models.FluxConfiguration": +======= + def get( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + flux_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.FluxConfiguration" +>>>>>>> 331f997c (updating to the latest vendored sdk) """Gets details of the Flux Configuration. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -294,8 +327,12 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param flux_configuration_name: Name of the Flux Configuration. @@ -310,6 +347,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -324,12 +362,42 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FluxConfiguration', pipeline_response) @@ -338,6 +406,7 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore @@ -376,12 +445,68 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + flux_configuration_name, # type: str + flux_configuration, # type: "_models.FluxConfiguration" + **kwargs # type: Any + ): + # type: (...) -> "_models.FluxConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: lambda response: ResourceExistsError(response=response, model=self._deserialize(_models.ErrorResponse, response), error_format=ARMErrorFormat), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(flux_configuration, 'FluxConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) if response.status_code == 200: deserialized = self._deserialize('FluxConfiguration', pipeline_response) @@ -393,6 +518,7 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore @@ -408,6 +534,21 @@ def begin_create_or_update( flux_configuration: "_models.FluxConfiguration", **kwargs: Any ) -> LROPoller["_models.FluxConfiguration"]: +======= + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + flux_configuration_name, # type: str + flux_configuration, # type: "_models.FluxConfiguration" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.FluxConfiguration"] +>>>>>>> 331f997c (updating to the latest vendored sdk) """Create a new Kubernetes Flux Configuration. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -417,13 +558,18 @@ def begin_create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param flux_configuration_name: Name of the Flux Configuration. :type flux_configuration_name: str :param flux_configuration: Properties necessary to Create a FluxConfiguration. +<<<<<<< HEAD :type flux_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfiguration :keyword callable cls: A custom type or function that will be passed the direct response @@ -442,6 +588,20 @@ def begin_create_or_update( """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] +======= + :type flux_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either FluxConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] lro_delay = kwargs.pop( 'polling_interval', @@ -456,6 +616,7 @@ def begin_create_or_update( cluster_name=cluster_name, flux_configuration_name=flux_configuration_name, flux_configuration=flux_configuration, +<<<<<<< HEAD content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -465,12 +626,37 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response deserialized = self._deserialize('FluxConfiguration', pipeline_response) +======= + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FluxConfiguration', pipeline_response) + +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -482,11 +668,15 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore def _update_initial( self, +<<<<<<< HEAD resource_group_name: str, cluster_rp: Union[str, "_models.Enum0"], cluster_resource_name: Union[str, "_models.Enum1"], @@ -519,12 +709,64 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + flux_configuration_name, # type: str + flux_configuration_patch, # type: "_models.FluxConfigurationPatch" + **kwargs # type: Any + ): + # type: (...) -> "_models.FluxConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: lambda response: ResourceExistsError(response=response, model=self._deserialize(_models.ErrorResponse, response), error_format=ARMErrorFormat), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(flux_configuration_patch, 'FluxConfigurationPatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) deserialized = self._deserialize('FluxConfiguration', pipeline_response) @@ -532,6 +774,7 @@ def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore @@ -547,6 +790,21 @@ def begin_update( flux_configuration_patch: "_models.FluxConfigurationPatch", **kwargs: Any ) -> LROPoller["_models.FluxConfiguration"]: +======= + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + flux_configuration_name, # type: str + flux_configuration_patch, # type: "_models.FluxConfigurationPatch" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.FluxConfiguration"] +>>>>>>> 331f997c (updating to the latest vendored sdk) """Update an existing Kubernetes Flux Configuration. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -556,13 +814,18 @@ def begin_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param flux_configuration_name: Name of the Flux Configuration. :type flux_configuration_name: str :param flux_configuration_patch: Properties to Patch in an existing Flux Configuration. +<<<<<<< HEAD :type flux_configuration_patch: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfigurationPatch :keyword callable cls: A custom type or function that will be passed the direct response @@ -581,6 +844,20 @@ def begin_update( """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] +======= + :type flux_configuration_patch: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfigurationPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either FluxConfiguration or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] lro_delay = kwargs.pop( 'polling_interval', @@ -595,6 +872,7 @@ def begin_update( cluster_name=cluster_name, flux_configuration_name=flux_configuration_name, flux_configuration_patch=flux_configuration_patch, +<<<<<<< HEAD content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -604,12 +882,37 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response deserialized = self._deserialize('FluxConfiguration', pipeline_response) +======= + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FluxConfiguration', pipeline_response) + +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -621,11 +924,15 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore def _delete_initial( self, +<<<<<<< HEAD resource_group_name: str, cluster_rp: Union[str, "_models.Enum0"], cluster_resource_name: Union[str, "_models.Enum1"], @@ -634,11 +941,23 @@ def _delete_initial( force_delete: Optional[bool] = None, **kwargs: Any ) -> None: +======= + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + flux_configuration_name, # type: str + force_delete=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_delete_request_initial( @@ -654,18 +973,52 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if force_delete is not None: + query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore +<<<<<<< HEAD @distributed_trace def begin_delete( @@ -678,6 +1031,19 @@ def begin_delete( force_delete: Optional[bool] = None, **kwargs: Any ) -> LROPoller[None]: +======= + def begin_delete( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + flux_configuration_name, # type: str + force_delete=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] +>>>>>>> 331f997c (updating to the latest vendored sdk) """This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the source repo. @@ -688,8 +1054,12 @@ def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param flux_configuration_name: Name of the Flux Configuration. @@ -699,6 +1069,7 @@ def begin_delete( :type force_delete: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. +<<<<<<< HEAD :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -710,6 +1081,17 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] +======= + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -727,14 +1109,33 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) +<<<<<<< HEAD + kwargs.pop('error_map', None) +======= + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) +>>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) +<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -746,6 +1147,7 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore @@ -758,6 +1160,19 @@ def list( cluster_name: str, **kwargs: Any ) -> Iterable["_models.FluxConfigurationsList"]: +======= + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.FluxConfigurationsList"] +>>>>>>> 331f997c (updating to the latest vendored sdk) """List all Flux Configurations. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -767,6 +1182,7 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -776,6 +1192,14 @@ def list( cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfigurationsList] +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FluxConfigurationsList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfigurationsList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfigurationsList"] @@ -783,6 +1207,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -814,6 +1239,40 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("FluxConfigurationsList", pipeline_response) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('FluxConfigurationsList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -826,13 +1285,21 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_location_extension_types_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_location_extension_types_operations.py index 6e8be79c061..2a9c3b93c87 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_location_extension_types_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_location_extension_types_operations.py @@ -5,13 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +======= +from typing import TYPE_CHECKING +>>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -57,6 +62,19 @@ def build_list_request( headers=header_parameters, **kwargs ) +======= +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +>>>>>>> 331f997c (updating to the latest vendored sdk) class LocationExtensionTypesOperations(object): """LocationExtensionTypesOperations operations. @@ -80,20 +98,33 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace def list( self, location: str, **kwargs: Any ) -> Iterable["_models.ExtensionTypeList"]: +======= + def list( + self, + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ExtensionTypeList"] +>>>>>>> 331f997c (updating to the latest vendored sdk) """List all Extension Types. :param location: extension location. :type location: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionTypeList or the result of cls(response) +<<<<<<< HEAD :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionTypeList] +======= + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionTypeList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionTypeList"] @@ -101,6 +132,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -126,6 +158,37 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionTypeList", pipeline_response) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ExtensionTypeList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -138,13 +201,21 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_operation_status_operations.py index 99b73b72038..66fdc1f761f 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_operation_status_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_operation_status_operations.py @@ -5,13 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +======= +from typing import TYPE_CHECKING +>>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -106,6 +111,19 @@ def build_list_request( headers=header_parameters, **kwargs ) +======= +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +>>>>>>> 331f997c (updating to the latest vendored sdk) class OperationStatusOperations(object): """OperationStatusOperations operations. @@ -129,6 +147,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace def get( self, @@ -140,6 +159,19 @@ def get( operation_id: str, **kwargs: Any ) -> "_models.OperationStatusResult": +======= + def get( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + extension_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.OperationStatusResult" +>>>>>>> 331f997c (updating to the latest vendored sdk) """Get Async Operation status. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -149,8 +181,12 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -167,6 +203,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -182,12 +219,43 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OperationStatusResult', pipeline_response) @@ -196,6 +264,7 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore @@ -209,6 +278,19 @@ def list( cluster_name: str, **kwargs: Any ) -> Iterable["_models.OperationStatusList"]: +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.OperationStatusList"] +>>>>>>> 331f997c (updating to the latest vendored sdk) """List Async Operations, currently in progress, in a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -218,14 +300,22 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationStatusList or the result of cls(response) +<<<<<<< HEAD :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.OperationStatusList] +======= + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.OperationStatusList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusList"] @@ -233,6 +323,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -264,6 +355,40 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("OperationStatusList", pipeline_response) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationStatusList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -276,13 +401,21 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_operations.py index c047a8d76ca..fbbea927ccb 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_operations.py @@ -5,13 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +======= +from typing import TYPE_CHECKING +>>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -49,6 +54,19 @@ def build_list_request( headers=header_parameters, **kwargs ) +======= +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +>>>>>>> 331f997c (updating to the latest vendored sdk) class Operations(object): """Operations operations. @@ -72,6 +90,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace def list( self, @@ -84,6 +103,18 @@ def list( cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ResourceProviderOperationList] +======= + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceProviderOperationList"] + """List all the available operations the KubernetesConfiguration resource provider supports. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ResourceProviderOperationList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -91,6 +122,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -112,6 +144,32 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,13 +182,21 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_source_control_configurations_operations.py index 4fe01af8220..b12392e527c 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_source_control_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_source_control_configurations_operations.py @@ -5,13 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +======= +from typing import TYPE_CHECKING +>>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest @@ -198,6 +203,21 @@ def build_list_request( headers=header_parameters, **kwargs ) +======= +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +>>>>>>> 331f997c (updating to the latest vendored sdk) class SourceControlConfigurationsOperations(object): """SourceControlConfigurationsOperations operations. @@ -221,6 +241,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config +<<<<<<< HEAD @distributed_trace def get( self, @@ -231,6 +252,18 @@ def get( source_control_configuration_name: str, **kwargs: Any ) -> "_models.SourceControlConfiguration": +======= + def get( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + source_control_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SourceControlConfiguration" +>>>>>>> 331f997c (updating to the latest vendored sdk) """Gets details of the Source Control Configuration. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -240,16 +273,24 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) +<<<<<<< HEAD :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration +======= + :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -257,6 +298,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_get_request( @@ -271,12 +313,42 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) @@ -285,6 +357,7 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -300,6 +373,21 @@ def create_or_update( source_control_configuration: "_models.SourceControlConfiguration", **kwargs: Any ) -> "_models.SourceControlConfiguration": +======= + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + source_control_configuration_name, # type: str + source_control_configuration, # type: "_models.SourceControlConfiguration" + **kwargs # type: Any + ): + # type: (...) -> "_models.SourceControlConfiguration" +>>>>>>> 331f997c (updating to the latest vendored sdk) """Create a new Kubernetes Source Control Configuration. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -309,19 +397,30 @@ def create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. +<<<<<<< HEAD :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration +======= + :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -329,6 +428,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -348,12 +448,47 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -366,6 +501,7 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized +<<<<<<< HEAD create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -379,11 +515,26 @@ def _delete_initial( source_control_configuration_name: str, **kwargs: Any ) -> None: +======= + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + source_control_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD request = build_delete_request_initial( @@ -398,18 +549,50 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) +>>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) +<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) +>>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore +<<<<<<< HEAD @distributed_trace def begin_delete( @@ -421,6 +604,18 @@ def begin_delete( source_control_configuration_name: str, **kwargs: Any ) -> LROPoller[None]: +======= + def begin_delete( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + source_control_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] +>>>>>>> 331f997c (updating to the latest vendored sdk) """This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from the source repo. @@ -431,14 +626,19 @@ def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 +>>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. +<<<<<<< HEAD :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -450,6 +650,17 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] +======= + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] +>>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -466,14 +677,33 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) +<<<<<<< HEAD kwargs.pop('error_map', None) +======= + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) +>>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) +<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) +======= + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) +>>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -485,6 +715,7 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) +<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -497,6 +728,19 @@ def list( cluster_name: str, **kwargs: Any ) -> Iterable["_models.SourceControlConfigurationList"]: +======= + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + cluster_rp, # type: Union[str, "_models.Enum0"] + cluster_resource_name, # type: Union[str, "_models.Enum1"] + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SourceControlConfigurationList"] +>>>>>>> 331f997c (updating to the latest vendored sdk) """List all Source Control Configurations. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -506,6 +750,7 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). +<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -515,6 +760,14 @@ def list( cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfigurationList] +======= + :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SourceControlConfigurationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfigurationList] +>>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfigurationList"] @@ -522,6 +775,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) +<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -553,6 +807,40 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("SourceControlConfigurationList", pipeline_response) +======= + api_version = "2021-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SourceControlConfigurationList', pipeline_response) +>>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -565,13 +853,21 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: +<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) +======= + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) +>>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response +<<<<<<< HEAD +======= +>>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) From 7cee8579067ef07d2bea8b6864fb796217039930 Mon Sep 17 00:00:00 2001 From: Deeksha Sharma Date: Thu, 11 Nov 2021 09:18:05 -0800 Subject: [PATCH 04/20] tested location based call successfully --- .../azext_k8s_extension/_client_factory.py | 12 ++++++------ src/k8s-extension/azext_k8s_extension/_help.py | 4 ++-- src/k8s-extension/azext_k8s_extension/commands.py | 9 ++++----- src/k8s-extension/azext_k8s_extension/custom.py | 10 +++++----- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/k8s-extension/azext_k8s_extension/_client_factory.py b/src/k8s-extension/azext_k8s_extension/_client_factory.py index c4d465256f0..fb592a2bc23 100644 --- a/src/k8s-extension/azext_k8s_extension/_client_factory.py +++ b/src/k8s-extension/azext_k8s_extension/_client_factory.py @@ -7,9 +7,9 @@ from azure.cli.core.profiles import ResourceType -def cf_k8s_extension(cli_ctx, *_): +def cf_k8s_extension(cli_ctx, **kwargs): from .vendored_sdks import SourceControlConfigurationClient - return get_mgmt_service_client(cli_ctx, SourceControlConfigurationClient) + return get_mgmt_service_client(cli_ctx, SourceControlConfigurationClient, **kwargs) def cf_k8s_extension_operation(cli_ctx, _): @@ -17,19 +17,19 @@ def cf_k8s_extension_operation(cli_ctx, _): def cf_k8s_cluster_extension_types_operation(cli_ctx, _): - return cf_k8s_extension(cli_ctx).cluster_extension_types + return cf_k8s_extension(cli_ctx, api_version='2021-05-01-preview').cluster_extension_types def cf_k8s_cluster_extension_type_operation(cli_ctx, _): - return cf_k8s_extension(cli_ctx).cluster_extension_type + return cf_k8s_extension(cli_ctx, api_version='2021-05-01-preview').cluster_extension_type def cf_k8s_location_extension_types_operation(cli_ctx, _): - return cf_k8s_extension(cli_ctx).location_extension_types + return cf_k8s_extension(cli_ctx, api_version='2021-05-01-preview').location_extension_types def cf_k8s_extension_type_versions_operation(cli_ctx, _): - return cf_k8s_extension(cli_ctx).extension_type_version + return cf_k8s_extension(cli_ctx, api_version='2021-05-01-preview').extension_type_versions def cf_resource_groups(cli_ctx, subscription_id=None): diff --git a/src/k8s-extension/azext_k8s_extension/_help.py b/src/k8s-extension/azext_k8s_extension/_help.py index ab08c9aa2a6..6abbcf8bbb1 100644 --- a/src/k8s-extension/azext_k8s_extension/_help.py +++ b/src/k8s-extension/azext_k8s_extension/_help.py @@ -98,7 +98,7 @@ - name: Show Kubernetes Extension Type text: |- az {consts.EXTENSION_NAME} extension-types show --resource-group my-resource-group \ ---cluster-name mycluster --cluster-type connectedClusters --extension-type cassandradatacenteroperator +--cluster-name mycluster --cluster-type connectedClusters --name cassandradatacenteroperator """ helps[f'{consts.EXTENSION_NAME} extension-types versions list'] = f""" @@ -108,5 +108,5 @@ - name: List versions for an Extension Type text: |- az {consts.EXTENSION_NAME} extension-types versions list --location eastus2euap \ ---extension-type cassandradatacenteroperator +--name cassandradatacenteroperator """ diff --git a/src/k8s-extension/azext_k8s_extension/commands.py b/src/k8s-extension/azext_k8s_extension/commands.py index b8cd84a0f68..1360b4811b4 100644 --- a/src/k8s-extension/azext_k8s_extension/commands.py +++ b/src/k8s-extension/azext_k8s_extension/commands.py @@ -26,29 +26,28 @@ def load_command_table(self, _): # Subgroup - k8s-extension extension-types k8s_cluster_extension_type_sdk = CliCommandType( - operations_tmpl=consts.EXTENSION_PACKAGE_NAME + '.vendored_sdks.operations._cluster_extension_type_operations#ClusterExtensionTypeOperations.{}', + operations_tmpl=consts.EXTENSION_PACKAGE_NAME + '.vendored_sdks.operations#ClusterExtensionTypeOperations.{}', client_factory=cf_k8s_cluster_extension_type_operation) with self.command_group(consts.EXTENSION_NAME + " extension-types", k8s_cluster_extension_type_sdk, client_factory=cf_k8s_cluster_extension_type_operation) \ as g: g.custom_show_command('show', 'show_k8s_cluster_extension_type', table_transformer=k8s_extension_type_show_table_format) k8s_cluster_extension_types_sdk = CliCommandType( - operations_tmpl=consts.EXTENSION_PACKAGE_NAME + '.vendored_sdks.operations._cluster_extension_types_operations#ClusterExtensionTypesOperations.{}', + operations_tmpl=consts.EXTENSION_PACKAGE_NAME + '.vendored_sdks.operations.#ClusterExtensionTypesOperations.{}', client_factory=cf_k8s_cluster_extension_types_operation) with self.command_group(consts.EXTENSION_NAME + " extension-types", k8s_cluster_extension_types_sdk, client_factory=cf_k8s_cluster_extension_types_operation, is_experimental=True) \ as g: g.custom_command('list', 'list_k8s_cluster_extension_types', table_transformer=k8s_extension_types_list_table_format) k8s_location_extension_types_sdk = CliCommandType( - operations_tmpl=consts.EXTENSION_PACKAGE_NAME + '.vendored_sdks.operations._location_extension_types_operations#LocationExtensionTypesOperations.{}', + operations_tmpl=consts.EXTENSION_PACKAGE_NAME + '.vendored_sdks.operations.#LocationExtensionTypesOperations.{}', client_factory=cf_k8s_location_extension_types_operation) with self.command_group(consts.EXTENSION_NAME + " extension-types", k8s_location_extension_types_sdk, client_factory=cf_k8s_location_extension_types_operation, is_experimental=True) \ as g: g.custom_command('list-by-location', 'list_k8s_location_extension_types', table_transformer=k8s_extension_types_list_table_format) - # Sub-group - k8s-extension extension-types versions k8s_extension_type_versions_sdk = CliCommandType( - operations_tmpl=consts.EXTENSION_PACKAGE_NAME + '.vendored_sdks.operations._extension_type_versions_operations#ExtensionTypeVersionsOperations.{}', + operations_tmpl=consts.EXTENSION_PACKAGE_NAME + '.vendored_sdks.operations.#ExtensionTypeVersionsOperations.{}', client_factory=cf_k8s_extension_type_versions_operation) with self.command_group(consts.EXTENSION_NAME + " extension-types", k8s_extension_type_versions_sdk, client_factory=cf_k8s_extension_type_versions_operation, is_experimental=True) \ as g: diff --git a/src/k8s-extension/azext_k8s_extension/custom.py b/src/k8s-extension/azext_k8s_extension/custom.py index f68eaa5687a..39ebd8dc877 100644 --- a/src/k8s-extension/azext_k8s_extension/custom.py +++ b/src/k8s-extension/azext_k8s_extension/custom.py @@ -358,10 +358,10 @@ def delete_k8s_extension( ) -def list_k8s_extension_type_versions(client, location, extension_type): +def list_k8s_extension_type_versions(client, location, name): """ List available extension type versions """ - return client.list(location, extension_type) + return client.list(location, name) def list_k8s_cluster_extension_types(client, resource_group_name, cluster_name, cluster_type): @@ -377,7 +377,7 @@ def list_k8s_location_extension_types(client, location): return client.list(location) -def show_k8s_cluster_extension_type(client, resource_group_name, cluster_type, cluster_name, extension_type): +def show_k8s_cluster_extension_type(client, resource_group_name, cluster_type, cluster_name, name): """Get an existing Extension Type. """ # Determine ClusterRP @@ -385,7 +385,7 @@ def show_k8s_cluster_extension_type(client, resource_group_name, cluster_type, c try: extension_type = client.get(resource_group_name, - cluster_rp, cluster_type, cluster_name, extension_type) + cluster_rp, cluster_type, cluster_name, name) return extension_type except HttpResponseError as ex: # Customize the error message for resources not found @@ -398,7 +398,7 @@ def show_k8s_cluster_extension_type(client, resource_group_name, cluster_type, c elif ex.message.__contains__("Operation returned an invalid status code 'Not Found'"): message = "(ExtensionNotFound) The Resource {0}/{1}/{2}/Microsoft.KubernetesConfiguration/" \ "extensions/{3} could not be found!".format( - cluster_rp, cluster_type, cluster_name, extension_type) + cluster_rp, cluster_type, cluster_name, name) else: message = ex.message raise ResourceNotFoundError(message) from ex From 0887ecf66bf4be26d6fc2d409482a304cce2e502 Mon Sep 17 00:00:00 2001 From: Deeksha Sharma Date: Thu, 11 Nov 2021 17:17:35 -0800 Subject: [PATCH 05/20] updated the formating and clyster type in models --- .../azext_k8s_extension/_format.py | 43 +++++++++++++------ .../azext_k8s_extension/_help.py | 4 +- .../azext_k8s_extension/_params.py | 4 +- .../azext_k8s_extension/commands.py | 8 ++-- .../azext_k8s_extension/custom.py | 16 ++++--- .../v2021_05_01_preview/models/_models.py | 2 +- .../v2021_05_01_preview/models/_models_py3.py | 2 +- 7 files changed, 49 insertions(+), 30 deletions(-) diff --git a/src/k8s-extension/azext_k8s_extension/_format.py b/src/k8s-extension/azext_k8s_extension/_format.py index f1511635704..78bf9536833 100644 --- a/src/k8s-extension/azext_k8s_extension/_format.py +++ b/src/k8s-extension/azext_k8s_extension/_format.py @@ -25,22 +25,36 @@ def __get_table_row(result): def k8s_extension_types_list_table_format(results): - return [__get_extension_type_table_row(result) for result in results] + return [__get_extension_type_table_row(result, False) for result in results] def k8s_extension_type_show_table_format(result): - return __get_extension_type_table_row(result) - - -def __get_extension_type_table_row(result): - return OrderedDict([ - ('name', result['name']), - ('default_scope', result.get('default_scope', '')), - ('release_trains', result.get('release_trains', '')), - ('cluster_types', result.get('cluster_types', '')), - ('allow_multiple_instances', result.get('allow_multiple_instances', '')), - ('default_release_namespace', result.get('default_release_namespace', '')) + return __get_extension_type_table_row(result, True) + + +def __get_extension_type_table_row(result, showReleaseTrains): + # Populate the values to be returned if they are not undefined + clusterTypes = ', '.join(result['clusterTypes']) + defaultScope, name, allowMultipleInstances, defaultReleaseNamespace = '','','','' + if result['supportedScopes']: + defaultScope = result['supportedScopes']['defaultScope'] + if result['supportedScopes']['clusterScopeSettings']: + name = result['supportedScopes']['clusterScopeSettings']['name'] + allowMultipleInstances = result['supportedScopes']['clusterScopeSettings']['allowMultipleInstances'] + defaultReleaseNamespace = result['supportedScopes']['clusterScopeSettings']['defaultReleaseNamespace'] + + retVal = OrderedDict([ + ('name', name), + ('defaultScope', defaultScope), + ('clusterTypes', clusterTypes), + ('allowMultipleInstances', allowMultipleInstances), + ('defaultReleaseNamespace', defaultReleaseNamespace) ]) + if showReleaseTrains: + releaseTrains = ', '.join(result['releaseTrains']) + retVal['releaseTrains'] = releaseTrains + + return retVal def k8s_extension_type_versions_list_table_format(results): @@ -48,7 +62,8 @@ def k8s_extension_type_versions_list_table_format(results): def __get_extension_type_versions_table_row(result): + versions = ", ".join(result['versions']) return OrderedDict([ - ('release_train', result['release_train']), - ('versions', result['versions']) + ('releaseTrain', result['releaseTrain']), + ('versions', versions) ]) diff --git a/src/k8s-extension/azext_k8s_extension/_help.py b/src/k8s-extension/azext_k8s_extension/_help.py index 6abbcf8bbb1..47e8046e0c7 100644 --- a/src/k8s-extension/azext_k8s_extension/_help.py +++ b/src/k8s-extension/azext_k8s_extension/_help.py @@ -98,7 +98,7 @@ - name: Show Kubernetes Extension Type text: |- az {consts.EXTENSION_NAME} extension-types show --resource-group my-resource-group \ ---cluster-name mycluster --cluster-type connectedClusters --name cassandradatacenteroperator +--cluster-name mycluster --cluster-type connectedClusters --extension_type cassandradatacenteroperator """ helps[f'{consts.EXTENSION_NAME} extension-types versions list'] = f""" @@ -108,5 +108,5 @@ - name: List versions for an Extension Type text: |- az {consts.EXTENSION_NAME} extension-types versions list --location eastus2euap \ ---name cassandradatacenteroperator +--extension_type cassandradatacenteroperator """ diff --git a/src/k8s-extension/azext_k8s_extension/_params.py b/src/k8s-extension/azext_k8s_extension/_params.py index c8088a09c8f..100059d3c25 100644 --- a/src/k8s-extension/azext_k8s_extension/_params.py +++ b/src/k8s-extension/azext_k8s_extension/_params.py @@ -99,7 +99,7 @@ def load_arguments(self, _): validator=get_default_location_from_resource_group) with self.argument_context(f"{consts.EXTENSION_NAME} extension-types show") as c: - c.argument('name', + c.argument('extension_type', help='Name of the extension type.') c.argument('cluster_name', options_list=['--cluster-name', '-c'], @@ -110,7 +110,7 @@ def load_arguments(self, _): help='Specify Arc clusters or AKS managed clusters or Arc appliances.') with self.argument_context(f"{consts.EXTENSION_NAME} extension-types versions list") as c: - c.argument('name', + c.argument('extension_type', help='Name of the extension type.') c.argument('location', validator=get_default_location_from_resource_group) diff --git a/src/k8s-extension/azext_k8s_extension/commands.py b/src/k8s-extension/azext_k8s_extension/commands.py index 1360b4811b4..981635e9883 100644 --- a/src/k8s-extension/azext_k8s_extension/commands.py +++ b/src/k8s-extension/azext_k8s_extension/commands.py @@ -28,27 +28,27 @@ def load_command_table(self, _): k8s_cluster_extension_type_sdk = CliCommandType( operations_tmpl=consts.EXTENSION_PACKAGE_NAME + '.vendored_sdks.operations#ClusterExtensionTypeOperations.{}', client_factory=cf_k8s_cluster_extension_type_operation) - with self.command_group(consts.EXTENSION_NAME + " extension-types", k8s_cluster_extension_type_sdk, client_factory=cf_k8s_cluster_extension_type_operation) \ + with self.command_group(consts.EXTENSION_NAME + " extension-types", k8s_cluster_extension_type_sdk, client_factory=cf_k8s_cluster_extension_type_operation, is_preview=True) \ as g: g.custom_show_command('show', 'show_k8s_cluster_extension_type', table_transformer=k8s_extension_type_show_table_format) k8s_cluster_extension_types_sdk = CliCommandType( operations_tmpl=consts.EXTENSION_PACKAGE_NAME + '.vendored_sdks.operations.#ClusterExtensionTypesOperations.{}', client_factory=cf_k8s_cluster_extension_types_operation) - with self.command_group(consts.EXTENSION_NAME + " extension-types", k8s_cluster_extension_types_sdk, client_factory=cf_k8s_cluster_extension_types_operation, is_experimental=True) \ + with self.command_group(consts.EXTENSION_NAME + " extension-types", k8s_cluster_extension_types_sdk, client_factory=cf_k8s_cluster_extension_types_operation, is_preview=True) \ as g: g.custom_command('list', 'list_k8s_cluster_extension_types', table_transformer=k8s_extension_types_list_table_format) k8s_location_extension_types_sdk = CliCommandType( operations_tmpl=consts.EXTENSION_PACKAGE_NAME + '.vendored_sdks.operations.#LocationExtensionTypesOperations.{}', client_factory=cf_k8s_location_extension_types_operation) - with self.command_group(consts.EXTENSION_NAME + " extension-types", k8s_location_extension_types_sdk, client_factory=cf_k8s_location_extension_types_operation, is_experimental=True) \ + with self.command_group(consts.EXTENSION_NAME + " extension-types", k8s_location_extension_types_sdk, client_factory=cf_k8s_location_extension_types_operation, is_preview=True) \ as g: g.custom_command('list-by-location', 'list_k8s_location_extension_types', table_transformer=k8s_extension_types_list_table_format) k8s_extension_type_versions_sdk = CliCommandType( operations_tmpl=consts.EXTENSION_PACKAGE_NAME + '.vendored_sdks.operations.#ExtensionTypeVersionsOperations.{}', client_factory=cf_k8s_extension_type_versions_operation) - with self.command_group(consts.EXTENSION_NAME + " extension-types", k8s_extension_type_versions_sdk, client_factory=cf_k8s_extension_type_versions_operation, is_experimental=True) \ + with self.command_group(consts.EXTENSION_NAME + " extension-types", k8s_extension_type_versions_sdk, client_factory=cf_k8s_extension_type_versions_operation, is_preview=True) \ as g: g.custom_command('list-versions', 'list_k8s_extension_type_versions', table_transformer=k8s_extension_type_versions_list_table_format) diff --git a/src/k8s-extension/azext_k8s_extension/custom.py b/src/k8s-extension/azext_k8s_extension/custom.py index 39ebd8dc877..8d537535146 100644 --- a/src/k8s-extension/azext_k8s_extension/custom.py +++ b/src/k8s-extension/azext_k8s_extension/custom.py @@ -358,10 +358,14 @@ def delete_k8s_extension( ) -def list_k8s_extension_type_versions(client, location, name): +def list_k8s_extension_type_versions(client, location, extension_type): """ List available extension type versions """ - return client.list(location, name) + versions_list = client.list(location, extension_type) + # if not versions_list.__dict__['_kwargs']: + # # versions_list returned null + # message = "Extension Type {0} does not have any supported versions.".format(extension_type) + return [] def list_k8s_cluster_extension_types(client, resource_group_name, cluster_name, cluster_type): @@ -377,7 +381,7 @@ def list_k8s_location_extension_types(client, location): return client.list(location) -def show_k8s_cluster_extension_type(client, resource_group_name, cluster_type, cluster_name, name): +def show_k8s_cluster_extension_type(client, resource_group_name, cluster_type, cluster_name, extension_type): """Get an existing Extension Type. """ # Determine ClusterRP @@ -385,20 +389,20 @@ def show_k8s_cluster_extension_type(client, resource_group_name, cluster_type, c try: extension_type = client.get(resource_group_name, - cluster_rp, cluster_type, cluster_name, name) + cluster_rp, cluster_type, cluster_name, extension_type) return extension_type except HttpResponseError as ex: # Customize the error message for resources not found if ex.response.status_code == 404: # If Cluster not found if ex.message.__contains__("(ResourceNotFound)"): - message = "{0} Verify that the cluster-type is correct and the resource exists.".format( + message = "{0} Verify that the extension type is correct and the resource exists.".format( ex.message) # If Configuration not found elif ex.message.__contains__("Operation returned an invalid status code 'Not Found'"): message = "(ExtensionNotFound) The Resource {0}/{1}/{2}/Microsoft.KubernetesConfiguration/" \ "extensions/{3} could not be found!".format( - cluster_rp, cluster_type, cluster_name, name) + cluster_rp, cluster_type, cluster_name, extension_type) else: message = ex.message raise ResourceNotFoundError(message) from ex diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models.py index 9a722f97fbb..8755200562d 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models.py @@ -460,7 +460,7 @@ class ExtensionType(msrest.serialization.Model): _attribute_map = { 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'release_trains': {'key': 'properties.releaseTrains', 'type': '[str]'}, - 'cluster_types': {'key': 'properties.clusterTypes', 'type': 'str'}, + 'cluster_types': {'key': 'properties.clusterTypes', 'type': '[str]'}, 'supported_scopes': {'key': 'properties.supportedScopes', 'type': 'SupportedScopes'}, } diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models_py3.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models_py3.py index c497f1a38c5..f11ed94346c 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models_py3.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models_py3.py @@ -663,7 +663,7 @@ class ExtensionType(msrest.serialization.Model): _attribute_map = { 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'release_trains': {'key': 'properties.releaseTrains', 'type': '[str]'}, - 'cluster_types': {'key': 'properties.clusterTypes', 'type': 'str'}, + 'cluster_types': {'key': 'properties.clusterTypes', 'type': '[str]'}, 'supported_scopes': {'key': 'properties.supportedScopes', 'type': 'SupportedScopes'}, } From a0c4c56b480bf5768304d6ccfaf4555cd97ca7c3 Mon Sep 17 00:00:00 2001 From: Deeksha Sharma Date: Mon, 15 Nov 2021 18:25:16 -0800 Subject: [PATCH 06/20] update custom.py list versions call method --- src/k8s-extension/azext_k8s_extension/custom.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/k8s-extension/azext_k8s_extension/custom.py b/src/k8s-extension/azext_k8s_extension/custom.py index 8d537535146..daa2f6ed6e9 100644 --- a/src/k8s-extension/azext_k8s_extension/custom.py +++ b/src/k8s-extension/azext_k8s_extension/custom.py @@ -357,15 +357,11 @@ def delete_k8s_extension( force_delete=force, ) - -def list_k8s_extension_type_versions(client, location, extension_type): +def list_k8s_extension_type_versions(cmd, client, location, extension_type): """ List available extension type versions """ versions_list = client.list(location, extension_type) - # if not versions_list.__dict__['_kwargs']: - # # versions_list returned null - # message = "Extension Type {0} does not have any supported versions.".format(extension_type) - return [] + return versions_list def list_k8s_cluster_extension_types(client, resource_group_name, cluster_name, cluster_type): From cdd15f85f83a002a36d33a5e8981961c9c385d31 Mon Sep 17 00:00:00 2001 From: Deeksha Sharma Date: Tue, 21 Jun 2022 16:58:46 -0700 Subject: [PATCH 07/20] importing new vendored sdk folder --- .../_source_control_configuration_client.py | 184 +- .../vendored_sdks/_version.py | 6 +- .../_source_control_configuration_client.py | 169 +- .../vendored_sdks/models.py | 7 +- .../v2020_07_01_preview/__init__.py | 8 - .../v2020_07_01_preview/_configuration.py | 29 - .../_source_control_configuration_client.py | 79 - .../v2020_07_01_preview/aio/__init__.py | 3 - .../v2020_07_01_preview/aio/_configuration.py | 15 - .../_source_control_configuration_client.py | 72 - .../aio/operations/_extensions_operations.py | 242 -- .../aio/operations/_operations.py | 54 - ...ource_control_configurations_operations.py | 238 -- .../v2020_07_01_preview/models/__init__.py | 47 - .../v2020_07_01_preview/models/_models.py | 817 ------ .../v2020_07_01_preview/models/_models_py3.py | 252 -- ...urce_control_configuration_client_enums.py | 60 - .../operations/_extensions_operations.py | 300 -- .../operations/_operations.py | 66 - ...ource_control_configurations_operations.py | 499 ++-- .../v2020_10_01_preview/__init__.py | 8 - .../v2020_10_01_preview/_configuration.py | 29 - .../_source_control_configuration_client.py | 74 - .../v2020_10_01_preview/aio/__init__.py | 3 - .../v2020_10_01_preview/aio/_configuration.py | 15 - .../_source_control_configuration_client.py | 67 - .../aio/operations/_operations.py | 54 - ...ource_control_configurations_operations.py | 238 -- .../v2020_10_01_preview/models/__init__.py | 31 - .../v2020_10_01_preview/models/_models.py | 506 ---- .../v2020_10_01_preview/models/_models_py3.py | 139 - ...urce_control_configuration_client_enums.py | 48 - .../operations/_operations.py | 66 - ...ource_control_configurations_operations.py | 296 -- .../vendored_sdks/v2021_03_01/__init__.py | 8 - .../v2021_03_01/_configuration.py | 29 - .../_source_control_configuration_client.py | 73 - .../vendored_sdks/v2021_03_01/aio/__init__.py | 3 - .../v2021_03_01/aio/_configuration.py | 15 - .../_source_control_configuration_client.py | 66 - .../v2021_03_01/aio/operations/_operations.py | 54 - ...ource_control_configurations_operations.py | 231 -- .../v2021_03_01/models/__init__.py | 31 - .../v2021_03_01/models/_models.py | 495 ---- .../v2021_03_01/models/_models_py3.py | 142 - ...urce_control_configuration_client_enums.py | 52 - .../v2021_03_01/operations/_operations.py | 66 - ...ource_control_configurations_operations.py | 289 -- .../v2021_05_01_preview/__init__.py | 8 - .../v2021_05_01_preview/_configuration.py | 29 - .../_source_control_configuration_client.py | 103 - .../v2021_05_01_preview/aio/__init__.py | 3 - .../v2021_05_01_preview/aio/_configuration.py | 15 - .../_source_control_configuration_client.py | 96 - .../_cluster_extension_type_operations.py | 47 +- .../_cluster_extension_types_operations.py | 64 +- .../_extension_type_versions_operations.py | 64 +- .../aio/operations/_extensions_operations.py | 269 -- .../_location_extension_types_operations.py | 58 +- .../_operation_status_operations.py | 108 - .../aio/operations/_operations.py | 54 - ...ource_control_configurations_operations.py | 238 -- .../v2021_05_01_preview/models/__init__.py | 61 - .../v2021_05_01_preview/models/_models.py | 1056 ------- .../v2021_05_01_preview/models/_models_py3.py | 306 +- ...urce_control_configuration_client_enums.py | 68 - .../_cluster_extension_type_operations.py | 115 +- .../_cluster_extension_types_operations.py | 123 +- .../_extension_type_versions_operations.py | 119 +- .../operations/_extensions_operations.py | 341 --- .../_location_extension_types_operations.py | 109 +- .../_operation_status_operations.py | 135 - .../operations/_operations.py | 66 - ...ource_control_configurations_operations.py | 296 -- .../vendored_sdks/v2021_09_01/__init__.py | 8 - .../v2021_09_01/_configuration.py | 29 - .../_source_control_configuration_client.py | 76 - .../vendored_sdks/v2021_09_01/aio/__init__.py | 3 - .../v2021_09_01/aio/_configuration.py | 15 - .../_source_control_configuration_client.py | 69 - .../aio/operations/_extensions_operations.py | 358 ++- .../_operation_status_operations.py | 114 +- .../v2021_09_01/aio/operations/_operations.py | 54 - .../v2021_09_01/models/__init__.py | 63 +- .../v2021_09_01/models/_models.py | 739 ----- .../v2021_09_01/models/_models_py3.py | 349 ++- ...urce_control_configuration_client_enums.py | 29 +- .../operations/_extensions_operations.py | 719 +++-- .../_operation_status_operations.py | 233 +- .../v2021_09_01/operations/_operations.py | 91 +- .../v2021_11_01_preview/__init__.py | 8 - .../v2021_11_01_preview/_configuration.py | 29 - .../_source_control_configuration_client.py | 113 - .../v2021_11_01_preview/aio/__init__.py | 3 - .../v2021_11_01_preview/aio/_configuration.py | 15 - .../_source_control_configuration_client.py | 106 - .../_cluster_extension_type_operations.py | 53 - .../_cluster_extension_types_operations.py | 65 - .../_extension_type_versions_operations.py | 60 - .../aio/operations/_extensions_operations.py | 364 --- ...flux_config_operation_status_operations.py | 54 - .../_flux_configurations_operations.py | 374 --- .../_location_extension_types_operations.py | 58 - .../_operation_status_operations.py | 106 - .../aio/operations/_operations.py | 54 - ...ource_control_configurations_operations.py | 238 -- .../v2021_11_01_preview/models/__init__.py | 87 - .../v2021_11_01_preview/models/_models.py | 1639 ----------- .../v2021_11_01_preview/models/_models_py3.py | 545 ---- ...urce_control_configuration_client_enums.py | 80 - .../_cluster_extension_type_operations.py | 70 - .../_cluster_extension_types_operations.py | 81 - .../_extension_type_versions_operations.py | 74 - .../operations/_extensions_operations.py | 458 --- ...flux_config_operation_status_operations.py | 72 - .../_flux_configurations_operations.py | 467 --- .../_location_extension_types_operations.py | 71 - .../_operation_status_operations.py | 133 - .../operations/_operations.py | 66 - ...ource_control_configurations_operations.py | 296 -- .../v2022_01_15_preview/__init__.py | 18 + .../v2022_01_15_preview/_configuration.py | 67 + .../v2022_01_15_preview/_patch.py | 31 + .../_source_control_configuration_client.py | 130 + .../v2022_01_15_preview/_vendor.py | 27 + .../_version.py} | 8 +- .../v2022_01_15_preview/aio/__init__.py | 15 + .../v2022_01_15_preview/aio/_configuration.py | 66 + .../v2022_01_15_preview/aio/_patch.py | 31 + .../_source_control_configuration_client.py | 127 + .../aio/operations/__init__.py | 31 + .../_cluster_extension_type_operations.py | 113 + .../_cluster_extension_types_operations.py | 136 + .../_extension_type_versions_operations.py | 123 + .../aio/operations/_extensions_operations.py | 615 ++++ ...flux_config_operation_status_operations.py | 117 + .../_flux_configurations_operations.py | 617 ++++ .../_location_extension_types_operations.py | 117 + .../_operation_status_operations.py | 208 ++ .../aio/operations/_operations.py | 55 +- ...ource_control_configurations_operations.py | 293 +- .../v2022_01_15_preview/models/__init__.py | 133 + .../v2022_01_15_preview/models/_models_py3.py | 2525 +++++++++++++++++ ...urce_control_configuration_client_enums.py | 124 + .../operations/__init__.py | 31 + .../_cluster_extension_type_operations.py | 156 + .../_cluster_extension_types_operations.py | 176 ++ .../_extension_type_versions_operations.py | 159 ++ .../operations/_extensions_operations.py | 840 ++++++ ...flux_config_operation_status_operations.py | 162 ++ .../_flux_configurations_operations.py | 844 ++++++ .../_location_extension_types_operations.py | 151 + .../_operation_status_operations.py | 291 ++ .../operations/_operations.py | 137 + ...ource_control_configurations_operations.py | 582 ++++ .../v2022_03_01/models/_models_py3.py | 17 +- .../v2022_04_02_preview/__init__.py | 18 + .../v2022_04_02_preview/_configuration.py | 68 + .../v2022_04_02_preview/_patch.py | 31 + .../_source_control_configuration_client.py | 110 + .../v2022_04_02_preview/_vendor.py | 27 + .../v2022_04_02_preview/_version.py | 9 + .../v2022_04_02_preview/aio/__init__.py | 15 + .../v2022_04_02_preview/aio/_configuration.py | 67 + .../v2022_04_02_preview/aio/_patch.py | 31 + .../_source_control_configuration_client.py | 107 + .../aio/operations/__init__.py | 21 + .../aio/operations/_extensions_operations.py | 605 ++++ .../_operation_status_operations.py | 115 + ...private_endpoint_connections_operations.py | 388 +++ .../_private_link_resources_operations.py | 154 + .../_private_link_scopes_operations.py | 467 +++ .../v2022_04_02_preview/models/__init__.py | 87 + .../v2022_04_02_preview/models/_models_py3.py | 1437 ++++++++++ ...urce_control_configuration_client_enums.py | 76 + .../operations/__init__.py | 21 + .../operations/_extensions_operations.py | 830 ++++++ .../_operation_status_operations.py | 160 ++ ...private_endpoint_connections_operations.py | 546 ++++ .../_private_link_resources_operations.py | 228 ++ .../_private_link_scopes_operations.py | 691 +++++ 181 files changed, 17487 insertions(+), 17109 deletions(-) delete mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_models.py delete mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_models.py delete mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_models.py delete mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models.py delete mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_models.py delete mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_models.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/__init__.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/_configuration.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/_patch.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/_source_control_configuration_client.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/_vendor.py rename src/k8s-extension/azext_k8s_extension/vendored_sdks/{aio/operations/__init__.py => v2022_01_15_preview/_version.py} (69%) create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/__init__.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/_configuration.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/_patch.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/_source_control_configuration_client.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/__init__.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_cluster_extension_type_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_cluster_extension_types_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_extension_type_versions_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_extensions_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_flux_config_operation_status_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_flux_configurations_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_location_extension_types_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_operation_status_operations.py rename src/k8s-extension/azext_k8s_extension/vendored_sdks/{ => v2022_01_15_preview}/aio/operations/_operations.py (69%) rename src/k8s-extension/azext_k8s_extension/vendored_sdks/{ => v2022_01_15_preview}/aio/operations/_source_control_configurations_operations.py (59%) create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/models/__init__.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/models/_models_py3.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/models/_source_control_configuration_client_enums.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/__init__.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_cluster_extension_type_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_cluster_extension_types_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_extension_type_versions_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_extensions_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_flux_config_operation_status_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_flux_configurations_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_location_extension_types_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_operation_status_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_source_control_configurations_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/__init__.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/_configuration.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/_patch.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/_source_control_configuration_client.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/_vendor.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/_version.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/__init__.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/_configuration.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/_patch.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/_source_control_configuration_client.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/__init__.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/_extensions_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/_operation_status_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/_private_endpoint_connections_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/_private_link_resources_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/_private_link_scopes_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/models/__init__.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/models/_models_py3.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/models/_source_control_configuration_client_enums.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/__init__.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/_extensions_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/_operation_status_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/_private_endpoint_connections_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/_private_link_resources_operations.py create mode 100644 src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/_private_link_scopes_operations.py diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/_source_control_configuration_client.py index 7bb8d92893a..f388fba3815 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/_source_control_configuration_client.py @@ -23,21 +23,7 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential - from azure.core.pipeline.transport import HttpRequest, HttpResponse -<<<<<<< HEAD -from ._configuration import SourceControlConfigurationClientConfiguration -from .operations import ExtensionsOperations -from .operations import OperationStatusOperations -from .operations import Operations -from .operations import ClusterExtensionTypeOperations -from .operations import ClusterExtensionTypesOperations -from .operations import ExtensionTypeVersionsOperations -from .operations import LocationExtensionTypesOperations -from . import models - -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) class _SDKClient(object): def __init__(self, *args, **kwargs): """This is a fake class to support current implemetation of MultiApiClientMixin." @@ -69,23 +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. """ -<<<<<<< HEAD DEFAULT_API_VERSION = '2022-03-01' -======= - DEFAULT_API_VERSION = '2021-09-01' ->>>>>>> 331f997c (updating to the latest vendored sdk) _PROFILE_TAG = "azure.mgmt.kubernetesconfiguration.SourceControlConfigurationClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { None: DEFAULT_API_VERSION, -<<<<<<< HEAD - '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', -======= - 'source_control_configurations': '2021-03-01', ->>>>>>> 331f997c (updating to the latest vendored sdk) + 'cluster_extension_type': '2022-01-15-preview', + 'cluster_extension_types': '2022-01-15-preview', + 'extension_type_versions': '2022-01-15-preview', + 'location_extension_types': '2022-01-15-preview', }}, _PROFILE_TAG + " latest" ) @@ -95,16 +73,10 @@ def __init__( credential, # type: "TokenCredential" subscription_id, # type: str api_version=None, # type: Optional[str] -<<<<<<< HEAD base_url="https://management.azure.com", # type: str -======= - base_url=None, # type: Optional[str] ->>>>>>> 331f997c (updating to the latest vendored sdk) 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__( @@ -126,11 +98,10 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2021-05-01-preview: :mod:`v2021_05_01_preview.models` * 2021-09-01: :mod:`v2021_09_01.models` * 2021-11-01-preview: :mod:`v2021_11_01_preview.models` -<<<<<<< HEAD * 2022-01-01-preview: :mod:`v2022_01_01_preview.models` + * 2022-01-15-preview: :mod:`v2022_01_15_preview.models` * 2022-03-01: :mod:`v2022_03_01.models` -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + * 2022-04-02-preview: :mod:`v2022_04_02_preview.models` """ if api_version == '2020-07-01-preview': from .v2020_07_01_preview import models @@ -150,15 +121,18 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-11-01-preview': from .v2021_11_01_preview import models return models -<<<<<<< HEAD elif api_version == '2022-01-01-preview': from .v2022_01_01_preview import models return models + elif api_version == '2022-01-15-preview': + from .v2022_01_15_preview import models + return models elif api_version == '2022-03-01': from .v2022_03_01 import models return models -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + elif api_version == '2022-04-02-preview': + from .v2022_04_02_preview import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -167,21 +141,18 @@ def cluster_extension_type(self): * 2021-05-01-preview: :class:`ClusterExtensionTypeOperations` * 2021-11-01-preview: :class:`ClusterExtensionTypeOperations` -<<<<<<< HEAD * 2022-01-01-preview: :class:`ClusterExtensionTypeOperations` -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + * 2022-01-15-preview: :class:`ClusterExtensionTypeOperations` """ api_version = self._get_api_version('cluster_extension_type') if api_version == '2021-05-01-preview': from .v2021_05_01_preview.operations import ClusterExtensionTypeOperations as OperationClass elif api_version == '2021-11-01-preview': from .v2021_11_01_preview.operations import ClusterExtensionTypeOperations as OperationClass -<<<<<<< HEAD elif api_version == '2022-01-01-preview': from .v2022_01_01_preview.operations import ClusterExtensionTypeOperations as OperationClass -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + elif api_version == '2022-01-15-preview': + from .v2022_01_15_preview.operations import ClusterExtensionTypeOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'cluster_extension_type'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -192,21 +163,18 @@ def cluster_extension_types(self): * 2021-05-01-preview: :class:`ClusterExtensionTypesOperations` * 2021-11-01-preview: :class:`ClusterExtensionTypesOperations` -<<<<<<< HEAD * 2022-01-01-preview: :class:`ClusterExtensionTypesOperations` -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + * 2022-01-15-preview: :class:`ClusterExtensionTypesOperations` """ api_version = self._get_api_version('cluster_extension_types') if api_version == '2021-05-01-preview': from .v2021_05_01_preview.operations import ClusterExtensionTypesOperations as OperationClass elif api_version == '2021-11-01-preview': from .v2021_11_01_preview.operations import ClusterExtensionTypesOperations as OperationClass -<<<<<<< HEAD elif api_version == '2022-01-01-preview': from .v2022_01_01_preview.operations import ClusterExtensionTypesOperations as OperationClass -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + elif api_version == '2022-01-15-preview': + from .v2022_01_15_preview.operations import ClusterExtensionTypesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'cluster_extension_types'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -217,21 +185,18 @@ def extension_type_versions(self): * 2021-05-01-preview: :class:`ExtensionTypeVersionsOperations` * 2021-11-01-preview: :class:`ExtensionTypeVersionsOperations` -<<<<<<< HEAD * 2022-01-01-preview: :class:`ExtensionTypeVersionsOperations` -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + * 2022-01-15-preview: :class:`ExtensionTypeVersionsOperations` """ api_version = self._get_api_version('extension_type_versions') if api_version == '2021-05-01-preview': from .v2021_05_01_preview.operations import ExtensionTypeVersionsOperations as OperationClass elif api_version == '2021-11-01-preview': from .v2021_11_01_preview.operations import ExtensionTypeVersionsOperations as OperationClass -<<<<<<< HEAD elif api_version == '2022-01-01-preview': from .v2022_01_01_preview.operations import ExtensionTypeVersionsOperations as OperationClass -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + elif api_version == '2022-01-15-preview': + from .v2022_01_15_preview.operations import ExtensionTypeVersionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'extension_type_versions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -244,6 +209,10 @@ def extensions(self): * 2021-05-01-preview: :class:`ExtensionsOperations` * 2021-09-01: :class:`ExtensionsOperations` * 2021-11-01-preview: :class:`ExtensionsOperations` + * 2022-01-01-preview: :class:`ExtensionsOperations` + * 2022-01-15-preview: :class:`ExtensionsOperations` + * 2022-03-01: :class:`ExtensionsOperations` + * 2022-04-02-preview: :class:`ExtensionsOperations` """ api_version = self._get_api_version('extensions') if api_version == '2020-07-01-preview': @@ -254,13 +223,14 @@ def extensions(self): from .v2021_09_01.operations import ExtensionsOperations as OperationClass elif api_version == '2021-11-01-preview': from .v2021_11_01_preview.operations import ExtensionsOperations as OperationClass -<<<<<<< HEAD elif api_version == '2022-01-01-preview': from .v2022_01_01_preview.operations import ExtensionsOperations as OperationClass + elif api_version == '2022-01-15-preview': + from .v2022_01_15_preview.operations import ExtensionsOperations as OperationClass elif api_version == '2022-03-01': from .v2022_03_01.operations import ExtensionsOperations as OperationClass -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + elif api_version == '2022-04-02-preview': + from .v2022_04_02_preview.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))) @@ -270,22 +240,19 @@ def flux_config_operation_status(self): """Instance depends on the API version: * 2021-11-01-preview: :class:`FluxConfigOperationStatusOperations` -<<<<<<< HEAD * 2022-01-01-preview: :class:`FluxConfigOperationStatusOperations` + * 2022-01-15-preview: :class:`FluxConfigOperationStatusOperations` * 2022-03-01: :class:`FluxConfigOperationStatusOperations` -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) """ 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 -<<<<<<< HEAD elif api_version == '2022-01-01-preview': from .v2022_01_01_preview.operations import FluxConfigOperationStatusOperations as OperationClass + elif api_version == '2022-01-15-preview': + from .v2022_01_15_preview.operations import FluxConfigOperationStatusOperations as OperationClass elif api_version == '2022-03-01': from .v2022_03_01.operations import FluxConfigOperationStatusOperations as OperationClass -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) 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))) @@ -295,22 +262,19 @@ def flux_configurations(self): """Instance depends on the API version: * 2021-11-01-preview: :class:`FluxConfigurationsOperations` -<<<<<<< HEAD * 2022-01-01-preview: :class:`FluxConfigurationsOperations` + * 2022-01-15-preview: :class:`FluxConfigurationsOperations` * 2022-03-01: :class:`FluxConfigurationsOperations` -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) """ 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 -<<<<<<< HEAD elif api_version == '2022-01-01-preview': from .v2022_01_01_preview.operations import FluxConfigurationsOperations as OperationClass + elif api_version == '2022-01-15-preview': + from .v2022_01_15_preview.operations import FluxConfigurationsOperations as OperationClass elif api_version == '2022-03-01': from .v2022_03_01.operations import FluxConfigurationsOperations as OperationClass -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) 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))) @@ -321,21 +285,18 @@ def location_extension_types(self): * 2021-05-01-preview: :class:`LocationExtensionTypesOperations` * 2021-11-01-preview: :class:`LocationExtensionTypesOperations` -<<<<<<< HEAD * 2022-01-01-preview: :class:`LocationExtensionTypesOperations` -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + * 2022-01-15-preview: :class:`LocationExtensionTypesOperations` """ api_version = self._get_api_version('location_extension_types') if api_version == '2021-05-01-preview': from .v2021_05_01_preview.operations import LocationExtensionTypesOperations as OperationClass elif api_version == '2021-11-01-preview': from .v2021_11_01_preview.operations import LocationExtensionTypesOperations as OperationClass -<<<<<<< HEAD elif api_version == '2022-01-01-preview': from .v2022_01_01_preview.operations import LocationExtensionTypesOperations as OperationClass -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + elif api_version == '2022-01-15-preview': + from .v2022_01_15_preview.operations import LocationExtensionTypesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'location_extension_types'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -347,11 +308,10 @@ def operation_status(self): * 2021-05-01-preview: :class:`OperationStatusOperations` * 2021-09-01: :class:`OperationStatusOperations` * 2021-11-01-preview: :class:`OperationStatusOperations` -<<<<<<< HEAD * 2022-01-01-preview: :class:`OperationStatusOperations` + * 2022-01-15-preview: :class:`OperationStatusOperations` * 2022-03-01: :class:`OperationStatusOperations` -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + * 2022-04-02-preview: :class:`OperationStatusOperations` """ api_version = self._get_api_version('operation_status') if api_version == '2021-05-01-preview': @@ -360,13 +320,14 @@ def operation_status(self): from .v2021_09_01.operations import OperationStatusOperations as OperationClass elif api_version == '2021-11-01-preview': from .v2021_11_01_preview.operations import OperationStatusOperations as OperationClass -<<<<<<< HEAD elif api_version == '2022-01-01-preview': from .v2022_01_01_preview.operations import OperationStatusOperations as OperationClass + elif api_version == '2022-01-15-preview': + from .v2022_01_15_preview.operations import OperationStatusOperations as OperationClass elif api_version == '2022-03-01': from .v2022_03_01.operations import OperationStatusOperations as OperationClass -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + elif api_version == '2022-04-02-preview': + from .v2022_04_02_preview.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))) @@ -381,11 +342,9 @@ def operations(self): * 2021-05-01-preview: :class:`Operations` * 2021-09-01: :class:`Operations` * 2021-11-01-preview: :class:`Operations` -<<<<<<< HEAD * 2022-01-01-preview: :class:`Operations` + * 2022-01-15-preview: :class:`Operations` * 2022-03-01: :class:`Operations` -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) """ api_version = self._get_api_version('operations') if api_version == '2020-07-01-preview': @@ -400,17 +359,55 @@ def operations(self): from .v2021_09_01.operations import Operations as OperationClass elif api_version == '2021-11-01-preview': from .v2021_11_01_preview.operations import Operations as OperationClass -<<<<<<< HEAD elif api_version == '2022-01-01-preview': from .v2022_01_01_preview.operations import Operations as OperationClass + elif api_version == '2022-01-15-preview': + from .v2022_01_15_preview.operations import Operations as OperationClass elif api_version == '2022-03-01': from .v2022_03_01.operations import Operations as OperationClass -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) 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))) + @property + def private_endpoint_connections(self): + """Instance depends on the API version: + + * 2022-04-02-preview: :class:`PrivateEndpointConnectionsOperations` + """ + api_version = self._get_api_version('private_endpoint_connections') + if api_version == '2022-04-02-preview': + from .v2022_04_02_preview.operations import PrivateEndpointConnectionsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def private_link_resources(self): + """Instance depends on the API version: + + * 2022-04-02-preview: :class:`PrivateLinkResourcesOperations` + """ + api_version = self._get_api_version('private_link_resources') + if api_version == '2022-04-02-preview': + from .v2022_04_02_preview.operations import PrivateLinkResourcesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def private_link_scopes(self): + """Instance depends on the API version: + + * 2022-04-02-preview: :class:`PrivateLinkScopesOperations` + """ + api_version = self._get_api_version('private_link_scopes') + if api_version == '2022-04-02-preview': + from .v2022_04_02_preview.operations import PrivateLinkScopesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'private_link_scopes'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def source_control_configurations(self): """Instance depends on the API version: @@ -420,11 +417,9 @@ def source_control_configurations(self): * 2021-03-01: :class:`SourceControlConfigurationsOperations` * 2021-05-01-preview: :class:`SourceControlConfigurationsOperations` * 2021-11-01-preview: :class:`SourceControlConfigurationsOperations` -<<<<<<< HEAD * 2022-01-01-preview: :class:`SourceControlConfigurationsOperations` + * 2022-01-15-preview: :class:`SourceControlConfigurationsOperations` * 2022-03-01: :class:`SourceControlConfigurationsOperations` -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) """ api_version = self._get_api_version('source_control_configurations') if api_version == '2020-07-01-preview': @@ -437,13 +432,12 @@ def source_control_configurations(self): from .v2021_05_01_preview.operations import SourceControlConfigurationsOperations as OperationClass elif api_version == '2021-11-01-preview': from .v2021_11_01_preview.operations import SourceControlConfigurationsOperations as OperationClass -<<<<<<< HEAD elif api_version == '2022-01-01-preview': from .v2022_01_01_preview.operations import SourceControlConfigurationsOperations as OperationClass + elif api_version == '2022-01-15-preview': + from .v2022_01_15_preview.operations import SourceControlConfigurationsOperations as OperationClass elif api_version == '2022-03-01': from .v2022_03_01.operations import SourceControlConfigurationsOperations as OperationClass -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) 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))) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/_version.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/_version.py index a0e6f8fad0e..48944bf3938 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/_version.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/_version.py @@ -6,8 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD -VERSION = "1.0.0" -======= -VERSION = "1.0.0b1" ->>>>>>> 331f997c (updating to the latest vendored sdk) +VERSION = "2.0.0" diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/aio/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/aio/_source_control_configuration_client.py index 801336a166f..6f8f4649c82 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/aio/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/aio/_source_control_configuration_client.py @@ -54,23 +54,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. """ -<<<<<<< HEAD DEFAULT_API_VERSION = '2022-03-01' -======= - DEFAULT_API_VERSION = '2021-09-01' ->>>>>>> 331f997c (updating to the latest vendored sdk) _PROFILE_TAG = "azure.mgmt.kubernetesconfiguration.SourceControlConfigurationClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { None: DEFAULT_API_VERSION, -<<<<<<< HEAD - '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', -======= - 'source_control_configurations': '2021-03-01', ->>>>>>> 331f997c (updating to the latest vendored sdk) + 'cluster_extension_type': '2022-01-15-preview', + 'cluster_extension_types': '2022-01-15-preview', + 'extension_type_versions': '2022-01-15-preview', + 'location_extension_types': '2022-01-15-preview', }}, _PROFILE_TAG + " latest" ) @@ -80,11 +72,7 @@ def __init__( credential: "AsyncTokenCredential", subscription_id: str, api_version: Optional[str] = None, -<<<<<<< HEAD base_url: str = "https://management.azure.com", -======= - base_url: Optional[str] = None, ->>>>>>> 331f997c (updating to the latest vendored sdk) profile: KnownProfiles = KnownProfiles.default, **kwargs # type: Any ) -> None: @@ -109,11 +97,10 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2021-05-01-preview: :mod:`v2021_05_01_preview.models` * 2021-09-01: :mod:`v2021_09_01.models` * 2021-11-01-preview: :mod:`v2021_11_01_preview.models` -<<<<<<< HEAD * 2022-01-01-preview: :mod:`v2022_01_01_preview.models` + * 2022-01-15-preview: :mod:`v2022_01_15_preview.models` * 2022-03-01: :mod:`v2022_03_01.models` -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + * 2022-04-02-preview: :mod:`v2022_04_02_preview.models` """ if api_version == '2020-07-01-preview': from ..v2020_07_01_preview import models @@ -133,15 +120,18 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-11-01-preview': from ..v2021_11_01_preview import models return models -<<<<<<< HEAD elif api_version == '2022-01-01-preview': from ..v2022_01_01_preview import models return models + elif api_version == '2022-01-15-preview': + from ..v2022_01_15_preview import models + return models elif api_version == '2022-03-01': from ..v2022_03_01 import models return models -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + elif api_version == '2022-04-02-preview': + from ..v2022_04_02_preview import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -150,21 +140,18 @@ def cluster_extension_type(self): * 2021-05-01-preview: :class:`ClusterExtensionTypeOperations` * 2021-11-01-preview: :class:`ClusterExtensionTypeOperations` -<<<<<<< HEAD * 2022-01-01-preview: :class:`ClusterExtensionTypeOperations` -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + * 2022-01-15-preview: :class:`ClusterExtensionTypeOperations` """ api_version = self._get_api_version('cluster_extension_type') if api_version == '2021-05-01-preview': from ..v2021_05_01_preview.aio.operations import ClusterExtensionTypeOperations as OperationClass elif api_version == '2021-11-01-preview': from ..v2021_11_01_preview.aio.operations import ClusterExtensionTypeOperations as OperationClass -<<<<<<< HEAD elif api_version == '2022-01-01-preview': from ..v2022_01_01_preview.aio.operations import ClusterExtensionTypeOperations as OperationClass -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + elif api_version == '2022-01-15-preview': + from ..v2022_01_15_preview.aio.operations import ClusterExtensionTypeOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'cluster_extension_type'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -175,21 +162,18 @@ def cluster_extension_types(self): * 2021-05-01-preview: :class:`ClusterExtensionTypesOperations` * 2021-11-01-preview: :class:`ClusterExtensionTypesOperations` -<<<<<<< HEAD * 2022-01-01-preview: :class:`ClusterExtensionTypesOperations` -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + * 2022-01-15-preview: :class:`ClusterExtensionTypesOperations` """ api_version = self._get_api_version('cluster_extension_types') if api_version == '2021-05-01-preview': from ..v2021_05_01_preview.aio.operations import ClusterExtensionTypesOperations as OperationClass elif api_version == '2021-11-01-preview': from ..v2021_11_01_preview.aio.operations import ClusterExtensionTypesOperations as OperationClass -<<<<<<< HEAD elif api_version == '2022-01-01-preview': from ..v2022_01_01_preview.aio.operations import ClusterExtensionTypesOperations as OperationClass -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + elif api_version == '2022-01-15-preview': + from ..v2022_01_15_preview.aio.operations import ClusterExtensionTypesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'cluster_extension_types'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -200,21 +184,18 @@ def extension_type_versions(self): * 2021-05-01-preview: :class:`ExtensionTypeVersionsOperations` * 2021-11-01-preview: :class:`ExtensionTypeVersionsOperations` -<<<<<<< HEAD * 2022-01-01-preview: :class:`ExtensionTypeVersionsOperations` -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + * 2022-01-15-preview: :class:`ExtensionTypeVersionsOperations` """ api_version = self._get_api_version('extension_type_versions') if api_version == '2021-05-01-preview': from ..v2021_05_01_preview.aio.operations import ExtensionTypeVersionsOperations as OperationClass elif api_version == '2021-11-01-preview': from ..v2021_11_01_preview.aio.operations import ExtensionTypeVersionsOperations as OperationClass -<<<<<<< HEAD elif api_version == '2022-01-01-preview': from ..v2022_01_01_preview.aio.operations import ExtensionTypeVersionsOperations as OperationClass -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + elif api_version == '2022-01-15-preview': + from ..v2022_01_15_preview.aio.operations import ExtensionTypeVersionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'extension_type_versions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -227,11 +208,10 @@ def extensions(self): * 2021-05-01-preview: :class:`ExtensionsOperations` * 2021-09-01: :class:`ExtensionsOperations` * 2021-11-01-preview: :class:`ExtensionsOperations` -<<<<<<< HEAD * 2022-01-01-preview: :class:`ExtensionsOperations` + * 2022-01-15-preview: :class:`ExtensionsOperations` * 2022-03-01: :class:`ExtensionsOperations` -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + * 2022-04-02-preview: :class:`ExtensionsOperations` """ api_version = self._get_api_version('extensions') if api_version == '2020-07-01-preview': @@ -242,13 +222,14 @@ def extensions(self): from ..v2021_09_01.aio.operations import ExtensionsOperations as OperationClass elif api_version == '2021-11-01-preview': from ..v2021_11_01_preview.aio.operations import ExtensionsOperations as OperationClass -<<<<<<< HEAD elif api_version == '2022-01-01-preview': from ..v2022_01_01_preview.aio.operations import ExtensionsOperations as OperationClass + elif api_version == '2022-01-15-preview': + from ..v2022_01_15_preview.aio.operations import ExtensionsOperations as OperationClass elif api_version == '2022-03-01': from ..v2022_03_01.aio.operations import ExtensionsOperations as OperationClass -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + elif api_version == '2022-04-02-preview': + from ..v2022_04_02_preview.aio.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))) @@ -258,22 +239,19 @@ def flux_config_operation_status(self): """Instance depends on the API version: * 2021-11-01-preview: :class:`FluxConfigOperationStatusOperations` -<<<<<<< HEAD * 2022-01-01-preview: :class:`FluxConfigOperationStatusOperations` + * 2022-01-15-preview: :class:`FluxConfigOperationStatusOperations` * 2022-03-01: :class:`FluxConfigOperationStatusOperations` -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) """ api_version = self._get_api_version('flux_config_operation_status') if api_version == '2021-11-01-preview': from ..v2021_11_01_preview.aio.operations import FluxConfigOperationStatusOperations as OperationClass -<<<<<<< HEAD elif api_version == '2022-01-01-preview': from ..v2022_01_01_preview.aio.operations import FluxConfigOperationStatusOperations as OperationClass + elif api_version == '2022-01-15-preview': + from ..v2022_01_15_preview.aio.operations import FluxConfigOperationStatusOperations as OperationClass elif api_version == '2022-03-01': from ..v2022_03_01.aio.operations import FluxConfigOperationStatusOperations as OperationClass -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) 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))) @@ -283,22 +261,19 @@ def flux_configurations(self): """Instance depends on the API version: * 2021-11-01-preview: :class:`FluxConfigurationsOperations` -<<<<<<< HEAD * 2022-01-01-preview: :class:`FluxConfigurationsOperations` + * 2022-01-15-preview: :class:`FluxConfigurationsOperations` * 2022-03-01: :class:`FluxConfigurationsOperations` -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) """ api_version = self._get_api_version('flux_configurations') if api_version == '2021-11-01-preview': from ..v2021_11_01_preview.aio.operations import FluxConfigurationsOperations as OperationClass -<<<<<<< HEAD elif api_version == '2022-01-01-preview': from ..v2022_01_01_preview.aio.operations import FluxConfigurationsOperations as OperationClass + elif api_version == '2022-01-15-preview': + from ..v2022_01_15_preview.aio.operations import FluxConfigurationsOperations as OperationClass elif api_version == '2022-03-01': from ..v2022_03_01.aio.operations import FluxConfigurationsOperations as OperationClass -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) 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))) @@ -309,21 +284,18 @@ def location_extension_types(self): * 2021-05-01-preview: :class:`LocationExtensionTypesOperations` * 2021-11-01-preview: :class:`LocationExtensionTypesOperations` -<<<<<<< HEAD * 2022-01-01-preview: :class:`LocationExtensionTypesOperations` -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + * 2022-01-15-preview: :class:`LocationExtensionTypesOperations` """ api_version = self._get_api_version('location_extension_types') if api_version == '2021-05-01-preview': from ..v2021_05_01_preview.aio.operations import LocationExtensionTypesOperations as OperationClass elif api_version == '2021-11-01-preview': from ..v2021_11_01_preview.aio.operations import LocationExtensionTypesOperations as OperationClass -<<<<<<< HEAD elif api_version == '2022-01-01-preview': from ..v2022_01_01_preview.aio.operations import LocationExtensionTypesOperations as OperationClass -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + elif api_version == '2022-01-15-preview': + from ..v2022_01_15_preview.aio.operations import LocationExtensionTypesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'location_extension_types'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -335,11 +307,10 @@ def operation_status(self): * 2021-05-01-preview: :class:`OperationStatusOperations` * 2021-09-01: :class:`OperationStatusOperations` * 2021-11-01-preview: :class:`OperationStatusOperations` -<<<<<<< HEAD * 2022-01-01-preview: :class:`OperationStatusOperations` + * 2022-01-15-preview: :class:`OperationStatusOperations` * 2022-03-01: :class:`OperationStatusOperations` -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + * 2022-04-02-preview: :class:`OperationStatusOperations` """ api_version = self._get_api_version('operation_status') if api_version == '2021-05-01-preview': @@ -348,13 +319,14 @@ def operation_status(self): from ..v2021_09_01.aio.operations import OperationStatusOperations as OperationClass elif api_version == '2021-11-01-preview': from ..v2021_11_01_preview.aio.operations import OperationStatusOperations as OperationClass -<<<<<<< HEAD elif api_version == '2022-01-01-preview': from ..v2022_01_01_preview.aio.operations import OperationStatusOperations as OperationClass + elif api_version == '2022-01-15-preview': + from ..v2022_01_15_preview.aio.operations import OperationStatusOperations as OperationClass elif api_version == '2022-03-01': from ..v2022_03_01.aio.operations import OperationStatusOperations as OperationClass -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) + elif api_version == '2022-04-02-preview': + from ..v2022_04_02_preview.aio.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))) @@ -369,11 +341,9 @@ def operations(self): * 2021-05-01-preview: :class:`Operations` * 2021-09-01: :class:`Operations` * 2021-11-01-preview: :class:`Operations` -<<<<<<< HEAD * 2022-01-01-preview: :class:`Operations` + * 2022-01-15-preview: :class:`Operations` * 2022-03-01: :class:`Operations` -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) """ api_version = self._get_api_version('operations') if api_version == '2020-07-01-preview': @@ -388,17 +358,55 @@ def operations(self): from ..v2021_09_01.aio.operations import Operations as OperationClass elif api_version == '2021-11-01-preview': from ..v2021_11_01_preview.aio.operations import Operations as OperationClass -<<<<<<< HEAD elif api_version == '2022-01-01-preview': from ..v2022_01_01_preview.aio.operations import Operations as OperationClass + elif api_version == '2022-01-15-preview': + from ..v2022_01_15_preview.aio.operations import Operations as OperationClass elif api_version == '2022-03-01': from ..v2022_03_01.aio.operations import Operations as OperationClass -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) 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))) + @property + def private_endpoint_connections(self): + """Instance depends on the API version: + + * 2022-04-02-preview: :class:`PrivateEndpointConnectionsOperations` + """ + api_version = self._get_api_version('private_endpoint_connections') + if api_version == '2022-04-02-preview': + from ..v2022_04_02_preview.aio.operations import PrivateEndpointConnectionsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def private_link_resources(self): + """Instance depends on the API version: + + * 2022-04-02-preview: :class:`PrivateLinkResourcesOperations` + """ + api_version = self._get_api_version('private_link_resources') + if api_version == '2022-04-02-preview': + from ..v2022_04_02_preview.aio.operations import PrivateLinkResourcesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def private_link_scopes(self): + """Instance depends on the API version: + + * 2022-04-02-preview: :class:`PrivateLinkScopesOperations` + """ + api_version = self._get_api_version('private_link_scopes') + if api_version == '2022-04-02-preview': + from ..v2022_04_02_preview.aio.operations import PrivateLinkScopesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'private_link_scopes'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def source_control_configurations(self): """Instance depends on the API version: @@ -408,11 +416,9 @@ def source_control_configurations(self): * 2021-03-01: :class:`SourceControlConfigurationsOperations` * 2021-05-01-preview: :class:`SourceControlConfigurationsOperations` * 2021-11-01-preview: :class:`SourceControlConfigurationsOperations` -<<<<<<< HEAD * 2022-01-01-preview: :class:`SourceControlConfigurationsOperations` + * 2022-01-15-preview: :class:`SourceControlConfigurationsOperations` * 2022-03-01: :class:`SourceControlConfigurationsOperations` -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) """ api_version = self._get_api_version('source_control_configurations') if api_version == '2020-07-01-preview': @@ -425,13 +431,12 @@ def source_control_configurations(self): from ..v2021_05_01_preview.aio.operations import SourceControlConfigurationsOperations as OperationClass elif api_version == '2021-11-01-preview': from ..v2021_11_01_preview.aio.operations import SourceControlConfigurationsOperations as OperationClass -<<<<<<< HEAD elif api_version == '2022-01-01-preview': from ..v2022_01_01_preview.aio.operations import SourceControlConfigurationsOperations as OperationClass + elif api_version == '2022-01-15-preview': + from ..v2022_01_15_preview.aio.operations import SourceControlConfigurationsOperations as OperationClass elif api_version == '2022-03-01': from ..v2022_03_01.aio.operations import SourceControlConfigurationsOperations as OperationClass -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) 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))) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/models.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/models.py index 7da6cb48cc7..e16262f29fc 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/models.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/models.py @@ -4,10 +4,5 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -<<<<<<< HEAD -from .v2022_01_01_preview.models import * +from .v2022_01_15_preview.models import * from .v2022_03_01.models import * -======= -from .v2021_03_01.models import * -from .v2021_09_01.models import * ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/__init__.py index fc12f19c5a1..e9096303633 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/__init__.py @@ -12,15 +12,7 @@ __version__ = VERSION __all__ = ['SourceControlConfigurationClient'] -<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() -======= -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/_configuration.py index 834fd38a3f4..a175e772c24 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/_configuration.py @@ -6,29 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy -======= -from typing import TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy ->>>>>>> 331f997c (updating to the latest vendored sdk) from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports -<<<<<<< HEAD -======= - from typing import Any - ->>>>>>> 331f997c (updating to the latest vendored sdk) from azure.core.credentials import TokenCredential @@ -46,27 +33,15 @@ class SourceControlConfigurationClientConfiguration(Configuration): def __init__( self, -<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, **kwargs: Any ) -> None: super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) -======= - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None ->>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") -<<<<<<< HEAD -======= - super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -90,8 +65,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: -<<<<<<< HEAD self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) -======= - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/_source_control_configuration_client.py index da56fb362c1..4a2066e60af 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/_source_control_configuration_client.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from copy import deepcopy from typing import Any, Optional, TYPE_CHECKING @@ -43,69 +42,20 @@ class SourceControlConfigurationClient: :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. -======= -from typing import TYPE_CHECKING - -from azure.mgmt.core import ARMPipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - 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 SourceControlConfigurationsOperations -from .operations import Operations -from .operations import ExtensionsOperations -from . import models - - -class SourceControlConfigurationClient(object): - """KubernetesConfiguration Client. - - :ivar source_control_configurations: SourceControlConfigurationsOperations operations - :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.operations.SourceControlConfigurationsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.operations.Operations - :ivar extensions: ExtensionsOperations operations - :vartype extensions: azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.operations.ExtensionsOperations - :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). - :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. ->>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, -<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) -======= - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) -<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.source_control_configurations = SourceControlConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -138,35 +88,6 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) -======= - self._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - self.source_control_configurations = SourceControlConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.extensions = ExtensionsOperations( - 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 ->>>>>>> 331f997c (updating to the latest vendored sdk) def close(self): # type: () -> None diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/__init__.py index 5951024da8e..5f583276b4e 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/__init__.py @@ -8,11 +8,8 @@ from ._source_control_configuration_client import SourceControlConfigurationClient __all__ = ['SourceControlConfigurationClient'] -<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/_configuration.py index 46e00988c3e..5d42c644d80 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/_configuration.py @@ -10,11 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -<<<<<<< HEAD from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy -======= -from azure.mgmt.core.policies import ARMHttpLoggingPolicy ->>>>>>> 331f997c (updating to the latest vendored sdk) from .._version import VERSION @@ -41,18 +37,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: -<<<<<<< HEAD super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") -<<<<<<< HEAD -======= - super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -75,8 +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: -<<<<<<< HEAD self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) -======= - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/_source_control_configuration_client.py index 90ea8a10908..786354552c0 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/_source_control_configuration_client.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from copy import deepcopy from typing import Any, Awaitable, Optional, TYPE_CHECKING @@ -18,19 +17,10 @@ from ._configuration import SourceControlConfigurationClientConfiguration from .operations import ExtensionsOperations, Operations, SourceControlConfigurationsOperations -======= -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 - ->>>>>>> 331f997c (updating to the latest vendored sdk) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -<<<<<<< HEAD class SourceControlConfigurationClient: """KubernetesConfiguration Client. @@ -52,54 +42,20 @@ class SourceControlConfigurationClient: :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. -======= -from ._configuration import SourceControlConfigurationClientConfiguration -from .operations import SourceControlConfigurationsOperations -from .operations import Operations -from .operations import ExtensionsOperations -from .. import models - - -class SourceControlConfigurationClient(object): - """KubernetesConfiguration Client. - - :ivar source_control_configurations: SourceControlConfigurationsOperations operations - :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.aio.operations.SourceControlConfigurationsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.aio.operations.Operations - :ivar extensions: ExtensionsOperations operations - :vartype extensions: azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.aio.operations.ExtensionsOperations - :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). - :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. ->>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, -<<<<<<< HEAD base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) -======= - base_url: Optional[str] = None, - **kwargs: Any - ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) -<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.source_control_configurations = SourceControlConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -132,34 +88,6 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) -======= - self._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - self.source_control_configurations = SourceControlConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.extensions = ExtensionsOperations( - 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 ->>>>>>> 331f997c (updating to the latest vendored sdk) async def close(self) -> None: await self._client.close() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_extensions_operations.py index 699ace6936f..2cb12620a0e 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_extensions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_extensions_operations.py @@ -5,17 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -25,13 +21,6 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._extensions_operations import build_create_request, build_delete_request, build_get_request, build_list_request, build_update_request -======= -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - ->>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -57,10 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace_async -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) async def create( self, resource_group_name: str, @@ -80,23 +66,15 @@ async def create( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_instance_name: Name of an instance of the Extension. :type extension_instance_name: str :param extension_instance: Properties necessary to Create an Extension Instance. -<<<<<<< HEAD :type extension_instance: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstance -======= - :type extension_instance: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstance ->>>>>>> 331f997c (updating to the latest vendored sdk) :keyword callable cls: A custom type or function that will be passed the direct response :return: ExtensionInstance, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstance @@ -107,7 +85,6 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -127,47 +104,12 @@ async def create( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2020-07-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionInstanceName': self._serialize.url("extension_instance_name", extension_instance_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(extension_instance, 'ExtensionInstance') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExtensionInstance', pipeline_response) @@ -176,16 +118,11 @@ async def create( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore @distributed_trace_async -======= - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -204,12 +141,8 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_instance_name: Name of an instance of the Extension. @@ -224,7 +157,6 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -239,42 +171,12 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2020-07-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionInstanceName': self._serialize.url("extension_instance_name", extension_instance_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExtensionInstance', pipeline_response) @@ -283,16 +185,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore @distributed_trace_async -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) async def update( self, resource_group_name: str, @@ -312,23 +209,15 @@ async def update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_instance_name: Name of an instance of the Extension. :type extension_instance_name: str :param extension_instance: Properties to Update in the Extension Instance. -<<<<<<< HEAD :type extension_instance: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstanceUpdate -======= - :type extension_instance: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstanceUpdate ->>>>>>> 331f997c (updating to the latest vendored sdk) :keyword callable cls: A custom type or function that will be passed the direct response :return: ExtensionInstance, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstance @@ -339,7 +228,6 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -359,47 +247,12 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2020-07-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionInstanceName': self._serialize.url("extension_instance_name", extension_instance_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(extension_instance, 'ExtensionInstanceUpdate') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExtensionInstance', pipeline_response) @@ -408,16 +261,11 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore @distributed_trace_async -======= - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) async def delete( self, resource_group_name: str, @@ -437,12 +285,8 @@ async def delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_instance_name: Name of an instance of the Extension. @@ -457,7 +301,6 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_delete_request( @@ -472,42 +315,12 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2020-07-01-preview" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionInstanceName': self._serialize.url("extension_instance_name", extension_instance_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -515,11 +328,8 @@ async def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore -<<<<<<< HEAD @distributed_trace -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -537,7 +347,6 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -547,14 +356,6 @@ def list( cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstancesList] -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 - :param cluster_name: The name of the kubernetes cluster. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ExtensionInstancesList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstancesList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionInstancesList"] @@ -562,7 +363,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -594,40 +394,6 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionInstancesList", pipeline_response) -======= - api_version = "2020-07-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ExtensionInstancesList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -640,21 +406,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_operations.py index 5c444b474e1..15d34648a9c 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_operations.py @@ -5,17 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -25,13 +21,6 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operations import build_list_request -======= -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - ->>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -57,10 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, **kwargs: Any @@ -68,15 +54,10 @@ def list( """List all the available operations the KubernetesConfiguration resource provider supports. :keyword callable cls: A custom type or function that will be passed the direct response -<<<<<<< HEAD :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceProviderOperationList] -======= - :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceProviderOperationList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -84,7 +65,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -106,32 +86,6 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) -======= - api_version = "2020-07-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -144,21 +98,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_source_control_configurations_operations.py index 6bdf2775f7a..540d16d33ae 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_source_control_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/aio/operations/_source_control_configurations_operations.py @@ -5,36 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async -======= -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod ->>>>>>> 331f997c (updating to the latest vendored sdk) from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -<<<<<<< HEAD from ..._vendor import _convert_request from ...operations._source_control_configurations_operations import build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request -======= - ->>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -60,10 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace_async -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -82,24 +67,16 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) -<<<<<<< HEAD :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration -======= - :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -107,7 +84,6 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -122,42 +98,12 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2020-07-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) @@ -166,16 +112,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @distributed_trace_async -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) async def create_or_update( self, resource_group_name: str, @@ -195,30 +136,19 @@ async def create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. -<<<<<<< HEAD :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration -======= - :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SourceControlConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -226,7 +156,6 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -246,47 +175,12 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2020-07-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -299,15 +193,10 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore -======= - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) async def _delete_initial( self, resource_group_name: str, @@ -322,7 +211,6 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_delete_request_initial( @@ -337,54 +225,20 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2020-07-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore -<<<<<<< HEAD @distributed_trace_async -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_delete( self, resource_group_name: str, @@ -404,19 +258,14 @@ async def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. -<<<<<<< HEAD :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -428,17 +277,6 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] -======= - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -455,33 +293,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) -<<<<<<< HEAD kwargs.pop('error_map', None) -======= - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) ->>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) -<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -493,15 +312,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @distributed_trace -======= - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -519,7 +333,6 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -529,14 +342,6 @@ def list( cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfigurationList] -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 - :param cluster_name: The name of the kubernetes cluster. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SourceControlConfigurationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfigurationList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfigurationList"] @@ -544,7 +349,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -576,40 +380,6 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("SourceControlConfigurationList", pipeline_response) -======= - api_version = "2020-07-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('SourceControlConfigurationList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -622,21 +392,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/__init__.py index 75b7bcc2ae9..70c78dcb2d4 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/__init__.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from ._models_py3 import ComplianceStatus from ._models_py3 import ConfigurationIdentity from ._models_py3 import ErrorDefinition @@ -29,52 +28,6 @@ from ._models_py3 import SourceControlConfigurationList from ._models_py3 import SystemData -======= -try: - from ._models_py3 import ComplianceStatus - from ._models_py3 import ConfigurationIdentity - from ._models_py3 import ErrorDefinition - from ._models_py3 import ErrorResponse - from ._models_py3 import ExtensionInstance - from ._models_py3 import ExtensionInstanceUpdate - from ._models_py3 import ExtensionInstancesList - from ._models_py3 import ExtensionStatus - from ._models_py3 import HelmOperatorProperties - from ._models_py3 import ProxyResource - from ._models_py3 import Resource - from ._models_py3 import ResourceProviderOperation - from ._models_py3 import ResourceProviderOperationDisplay - from ._models_py3 import ResourceProviderOperationList - from ._models_py3 import Result - from ._models_py3 import Scope - from ._models_py3 import ScopeCluster - from ._models_py3 import ScopeNamespace - from ._models_py3 import SourceControlConfiguration - from ._models_py3 import SourceControlConfigurationList - from ._models_py3 import SystemData -except (SyntaxError, ImportError): - from ._models import ComplianceStatus # type: ignore - from ._models import ConfigurationIdentity # type: ignore - from ._models import ErrorDefinition # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import ExtensionInstance # type: ignore - from ._models import ExtensionInstanceUpdate # type: ignore - from ._models import ExtensionInstancesList # type: ignore - from ._models import ExtensionStatus # type: ignore - from ._models import HelmOperatorProperties # type: ignore - from ._models import ProxyResource # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceProviderOperation # type: ignore - from ._models import ResourceProviderOperationDisplay # type: ignore - from ._models import ResourceProviderOperationList # type: ignore - from ._models import Result # type: ignore - from ._models import Scope # type: ignore - from ._models import ScopeCluster # type: ignore - from ._models import ScopeNamespace # type: ignore - from ._models import SourceControlConfiguration # type: ignore - from ._models import SourceControlConfigurationList # type: ignore - from ._models import SystemData # type: ignore ->>>>>>> 331f997c (updating to the latest vendored sdk) from ._source_control_configuration_client_enums import ( ComplianceStateType, diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_models.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_models.py deleted file mode 100644 index ef31b453ddc..00000000000 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_models.py +++ /dev/null @@ -1,817 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class ComplianceStatus(msrest.serialization.Model): - """Compliance Status details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar compliance_state: The compliance state of the configuration. Possible values include: - "Pending", "Compliant", "Noncompliant", "Installed", "Failed". - :vartype compliance_state: str or - ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ComplianceStateType - :param last_config_applied: Datetime the configuration was last applied. - :type last_config_applied: ~datetime.datetime - :param message: Message from when the configuration was applied. - :type message: str - :param message_level: Level of the message. Possible values include: "Error", "Warning", - "Information". - :type message_level: str or - ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.MessageLevelType - """ - - _validation = { - 'compliance_state': {'readonly': True}, - } - - _attribute_map = { - 'compliance_state': {'key': 'complianceState', 'type': 'str'}, - 'last_config_applied': {'key': 'lastConfigApplied', 'type': 'iso-8601'}, - 'message': {'key': 'message', 'type': 'str'}, - 'message_level': {'key': 'messageLevel', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComplianceStatus, self).__init__(**kwargs) - self.compliance_state = None - self.last_config_applied = kwargs.get('last_config_applied', None) - self.message = kwargs.get('message', None) - self.message_level = kwargs.get('message_level', None) - - -class ConfigurationIdentity(msrest.serialization.Model): - """Identity for the managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of the system assigned identity which is used by the - configuration. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity which is used by the - configuration. - :vartype tenant_id: str - :param type: The type of identity used for the configuration. Type 'SystemAssigned' will use an - implicitly created identity. Type 'None' will not use Managed Identity for the configuration. - Possible values include: "SystemAssigned", "None". - :type type: str or - ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceIdentityType - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ConfigurationIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - - -class ErrorDefinition(msrest.serialization.Model): - """Error definition. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. Service specific error code which serves as the substatus for the HTTP - error code. - :type code: str - :param message: Required. Description of the error. - :type message: str - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorDefinition, self).__init__(**kwargs) - self.code = kwargs['code'] - self.message = kwargs['message'] - - -class ErrorResponse(msrest.serialization.Model): - """Error response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar error: Error definition. - :vartype error: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ErrorDefinition - """ - - _validation = { - 'error': {'readonly': True}, - } - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDefinition'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = None - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param system_data: Top level metadata - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = kwargs.get('system_data', None) - - -class ProxyResource(Resource): - """ARM proxy resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param system_data: Top level metadata - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - super(ProxyResource, self).__init__(**kwargs) - - -class ExtensionInstance(ProxyResource): - """The Extension Instance object. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param system_data: Top level metadata - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData - :param extension_type: Type of the Extension, of which this resource is an instance of. It - must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the - Extension publisher. - :type extension_type: str - :param auto_upgrade_minor_version: Flag to note if this instance participates in auto upgrade - of minor version, or not. - :type auto_upgrade_minor_version: bool - :param release_train: ReleaseTrain this extension instance participates in for auto-upgrade - (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. - :type release_train: str - :param version: Version of the extension for this extension instance, if it is 'pinned' to a - specific version. autoUpgradeMinorVersion must be 'false'. - :type version: str - :param scope: Scope at which the extension instance is installed. - :type scope: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Scope - :param configuration_settings: Configuration settings, as name-value pairs for configuring this - instance of the extension. - :type configuration_settings: dict[str, str] - :param configuration_protected_settings: Configuration settings that are sensitive, as - name-value pairs for configuring this instance of the extension. - :type configuration_protected_settings: dict[str, str] - :ivar install_state: Status of installation of this instance of the extension. Possible values - include: "Pending", "Installed", "Failed". - :vartype install_state: str or - ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.InstallStateType - :param statuses: Status from this instance of the extension. - :type statuses: - list[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionStatus] - :ivar creation_time: DateLiteral (per ISO8601) noting the time the resource was created by the - client (user). - :vartype creation_time: str - :ivar last_modified_time: DateLiteral (per ISO8601) noting the time the resource was modified - by the client (user). - :vartype last_modified_time: str - :ivar last_status_time: DateLiteral (per ISO8601) noting the time of last status from the - agent. - :vartype last_status_time: str - :ivar error_info: Error information from the Agent - e.g. errors during installation. - :vartype error_info: - ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ErrorDefinition - :param identity: The identity of the configuration. - :type identity: - ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ConfigurationIdentity - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'install_state': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'last_status_time': {'readonly': True}, - 'error_info': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'extension_type': {'key': 'properties.extensionType', 'type': 'str'}, - 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, - 'release_train': {'key': 'properties.releaseTrain', 'type': 'str'}, - 'version': {'key': 'properties.version', 'type': 'str'}, - 'scope': {'key': 'properties.scope', 'type': 'Scope'}, - 'configuration_settings': {'key': 'properties.configurationSettings', 'type': '{str}'}, - 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, - 'install_state': {'key': 'properties.installState', 'type': 'str'}, - 'statuses': {'key': 'properties.statuses', 'type': '[ExtensionStatus]'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'str'}, - 'last_status_time': {'key': 'properties.lastStatusTime', 'type': 'str'}, - 'error_info': {'key': 'properties.errorInfo', 'type': 'ErrorDefinition'}, - 'identity': {'key': 'properties.identity', 'type': 'ConfigurationIdentity'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtensionInstance, self).__init__(**kwargs) - self.extension_type = kwargs.get('extension_type', None) - self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) - self.release_train = kwargs.get('release_train', "Stable") - self.version = kwargs.get('version', None) - self.scope = kwargs.get('scope', None) - self.configuration_settings = kwargs.get('configuration_settings', None) - self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) - self.install_state = None - self.statuses = kwargs.get('statuses', None) - self.creation_time = None - self.last_modified_time = None - self.last_status_time = None - self.error_info = None - self.identity = kwargs.get('identity', None) - - -class ExtensionInstancesList(msrest.serialization.Model): - """Result of the request to list Extension Instances. It contains a list of ExtensionInstance objects and a URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Extension Instances within a Kubernetes cluster. - :vartype value: - list[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstance] - :ivar next_link: URL to get the next set of extension instance objects, if any. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ExtensionInstance]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtensionInstancesList, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ExtensionInstanceUpdate(msrest.serialization.Model): - """Update Extension Instance request object. - - :param auto_upgrade_minor_version: Flag to note if this instance participates in Extension - Lifecycle Management or not. - :type auto_upgrade_minor_version: bool - :param release_train: ReleaseTrain this extension instance participates in for auto-upgrade - (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. - :type release_train: str - :param version: Version number of extension, to 'pin' to a specific version. - autoUpgradeMinorVersion must be 'false'. - :type version: str - """ - - _attribute_map = { - 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, - 'release_train': {'key': 'properties.releaseTrain', 'type': 'str'}, - 'version': {'key': 'properties.version', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtensionInstanceUpdate, self).__init__(**kwargs) - self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', None) - self.release_train = kwargs.get('release_train', "Stable") - self.version = kwargs.get('version', None) - - -class ExtensionStatus(msrest.serialization.Model): - """Status from this instance of the extension. - - :param code: Status code provided by the Extension. - :type code: str - :param display_status: Short description of status of this instance of the extension. - :type display_status: str - :param level: Level of the status. Possible values include: "Error", "Warning", "Information". - Default value: "Information". - :type level: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.LevelType - :param message: Detailed message of the status from the Extension instance. - :type message: str - :param time: DateLiteral (per ISO8601) noting the time of installation status. - :type time: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'display_status': {'key': 'displayStatus', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'time': {'key': 'time', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtensionStatus, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.display_status = kwargs.get('display_status', None) - self.level = kwargs.get('level', "Information") - self.message = kwargs.get('message', None) - self.time = kwargs.get('time', None) - - -class HelmOperatorProperties(msrest.serialization.Model): - """Properties for Helm operator. - - :param chart_version: Version of the operator Helm chart. - :type chart_version: str - :param chart_values: Values override for the operator Helm chart. - :type chart_values: str - """ - - _attribute_map = { - 'chart_version': {'key': 'chartVersion', 'type': 'str'}, - 'chart_values': {'key': 'chartValues', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HelmOperatorProperties, self).__init__(**kwargs) - self.chart_version = kwargs.get('chart_version', None) - self.chart_values = kwargs.get('chart_values', None) - - -class ResourceProviderOperation(msrest.serialization.Model): - """Supported operation of this resource provider. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param name: Operation name, in format of {provider}/{resource}/{operation}. - :type name: str - :param display: Display metadata associated with the operation. - :type display: - ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceProviderOperationDisplay - :ivar is_data_action: The flag that indicates whether the operation applies to data plane. - :vartype is_data_action: bool - """ - - _validation = { - 'is_data_action': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderOperation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.is_data_action = None - - -class ResourceProviderOperationDisplay(msrest.serialization.Model): - """Display metadata associated with the operation. - - :param provider: Resource provider: Microsoft KubernetesConfiguration. - :type provider: str - :param resource: Resource on which the operation is performed. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of this operation. - :type description: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderOperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) - - -class ResourceProviderOperationList(msrest.serialization.Model): - """Result of the request to list operations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of operations supported by this resource provider. - :type value: - list[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceProviderOperation] - :ivar next_link: URL to the next set of results, if any. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderOperationList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class Result(msrest.serialization.Model): - """Sample result definition. - - :param sample_property: Sample property of type string. - :type sample_property: str - """ - - _attribute_map = { - 'sample_property': {'key': 'sampleProperty', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Result, self).__init__(**kwargs) - self.sample_property = kwargs.get('sample_property', None) - - -class Scope(msrest.serialization.Model): - """Scope of the extensionInstance. It can be either Cluster or Namespace; but not both. - - :param cluster: Specifies that the scope of the extensionInstance is Cluster. - :type cluster: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ScopeCluster - :param namespace: Specifies that the scope of the extensionInstance is Namespace. - :type namespace: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ScopeNamespace - """ - - _attribute_map = { - 'cluster': {'key': 'cluster', 'type': 'ScopeCluster'}, - 'namespace': {'key': 'namespace', 'type': 'ScopeNamespace'}, - } - - def __init__( - self, - **kwargs - ): - super(Scope, self).__init__(**kwargs) - self.cluster = kwargs.get('cluster', None) - self.namespace = kwargs.get('namespace', None) - - -class ScopeCluster(msrest.serialization.Model): - """Specifies that the scope of the extensionInstance is Cluster. - - :param release_namespace: Namespace where the extension Release must be placed, for a Cluster - scoped extensionInstance. If this namespace does not exist, it will be created. - :type release_namespace: str - """ - - _attribute_map = { - 'release_namespace': {'key': 'releaseNamespace', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ScopeCluster, self).__init__(**kwargs) - self.release_namespace = kwargs.get('release_namespace', None) - - -class ScopeNamespace(msrest.serialization.Model): - """Specifies that the scope of the extensionInstance is Namespace. - - :param target_namespace: Namespace where the extensionInstance will be created for an Namespace - scoped extensionInstance. If this namespace does not exist, it will be created. - :type target_namespace: str - """ - - _attribute_map = { - 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ScopeNamespace, self).__init__(**kwargs) - self.target_namespace = kwargs.get('target_namespace', None) - - -class SourceControlConfiguration(ProxyResource): - """The SourceControl Configuration object returned in Get & Put response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param system_data: Top level metadata - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData - :param repository_url: Url of the SourceControl Repository. - :type repository_url: str - :param operator_namespace: The namespace to which this operator is installed to. Maximum of 253 - lower case alphanumeric characters, hyphen and period only. - :type operator_namespace: str - :param operator_instance_name: Instance name of the operator - identifying the specific - configuration. - :type operator_instance_name: str - :param operator_type: Type of the operator. Possible values include: "Flux". - :type operator_type: str or - ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.OperatorType - :param operator_params: Any Parameters for the Operator instance in string format. - :type operator_params: str - :param configuration_protected_settings: Name-value pairs of protected configuration settings - for the configuration. - :type configuration_protected_settings: dict[str, str] - :param operator_scope: Scope at which the operator will be installed. Possible values include: - "cluster", "namespace". Default value: "cluster". - :type operator_scope: str or - ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.OperatorScopeType - :ivar repository_public_key: Public Key associated with this SourceControl configuration - (either generated within the cluster or provided by the user). - :vartype repository_public_key: str - :param ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys - required to access private Git instances. - :type ssh_known_hosts_contents: str - :param enable_helm_operator: Option to enable Helm Operator for this git configuration. - :type enable_helm_operator: bool - :param helm_operator_properties: Properties for Helm operator. - :type helm_operator_properties: - ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.HelmOperatorProperties - :ivar provisioning_state: The provisioning state of the resource provider. Possible values - include: "Accepted", "Deleting", "Running", "Succeeded", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ProvisioningStateType - :ivar compliance_status: Compliance Status of the Configuration. - :vartype compliance_status: - ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ComplianceStatus - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'repository_public_key': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'compliance_status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, - 'operator_namespace': {'key': 'properties.operatorNamespace', 'type': 'str'}, - 'operator_instance_name': {'key': 'properties.operatorInstanceName', 'type': 'str'}, - 'operator_type': {'key': 'properties.operatorType', 'type': 'str'}, - 'operator_params': {'key': 'properties.operatorParams', 'type': 'str'}, - 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, - 'operator_scope': {'key': 'properties.operatorScope', 'type': 'str'}, - 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, - 'ssh_known_hosts_contents': {'key': 'properties.sshKnownHostsContents', 'type': 'str'}, - 'enable_helm_operator': {'key': 'properties.enableHelmOperator', 'type': 'bool'}, - 'helm_operator_properties': {'key': 'properties.helmOperatorProperties', 'type': 'HelmOperatorProperties'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'compliance_status': {'key': 'properties.complianceStatus', 'type': 'ComplianceStatus'}, - } - - def __init__( - self, - **kwargs - ): - super(SourceControlConfiguration, self).__init__(**kwargs) - self.repository_url = kwargs.get('repository_url', None) - self.operator_namespace = kwargs.get('operator_namespace', "default") - self.operator_instance_name = kwargs.get('operator_instance_name', None) - self.operator_type = kwargs.get('operator_type', None) - self.operator_params = kwargs.get('operator_params', None) - self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) - self.operator_scope = kwargs.get('operator_scope', "cluster") - self.repository_public_key = None - self.ssh_known_hosts_contents = kwargs.get('ssh_known_hosts_contents', None) - self.enable_helm_operator = kwargs.get('enable_helm_operator', None) - self.helm_operator_properties = kwargs.get('helm_operator_properties', None) - self.provisioning_state = None - self.compliance_status = None - - -class SourceControlConfigurationList(msrest.serialization.Model): - """Result of the request to list Source Control Configurations. It contains a list of SourceControlConfiguration objects and a URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Source Control Configurations within a Kubernetes cluster. - :vartype value: - list[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration] - :ivar next_link: URL to get the next set of configuration objects, if any. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[SourceControlConfiguration]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SourceControlConfigurationList, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class SystemData(msrest.serialization.Model): - """Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar created_by: A string identifier for the identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource: user, application, - managedIdentity, key. - :vartype created_by_type: str - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: A string identifier for the identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource: user, - application, managedIdentity, key. - :vartype last_modified_by_type: str - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _validation = { - 'created_by': {'readonly': True}, - 'created_by_type': {'readonly': True}, - 'created_at': {'readonly': True}, - 'last_modified_by': {'readonly': True}, - 'last_modified_by_type': {'readonly': True}, - 'last_modified_at': {'readonly': True}, - } - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(SystemData, self).__init__(**kwargs) - self.created_by = None - self.created_by_type = None - self.created_at = None - self.last_modified_by = None - self.last_modified_by_type = None - self.last_modified_at = None diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_models_py3.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_models_py3.py index 17a02903590..d28c93715ed 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_models_py3.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_models_py3.py @@ -24,7 +24,6 @@ class ComplianceStatus(msrest.serialization.Model): "Pending", "Compliant", "Noncompliant", "Installed", "Failed". :vartype compliance_state: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ComplianceStateType -<<<<<<< HEAD :ivar last_config_applied: Datetime the configuration was last applied. :vartype last_config_applied: ~datetime.datetime :ivar message: Message from when the configuration was applied. @@ -32,15 +31,6 @@ class ComplianceStatus(msrest.serialization.Model): :ivar message_level: Level of the message. Possible values include: "Error", "Warning", "Information". :vartype message_level: str or -======= - :param last_config_applied: Datetime the configuration was last applied. - :type last_config_applied: ~datetime.datetime - :param message: Message from when the configuration was applied. - :type message: str - :param message_level: Level of the message. Possible values include: "Error", "Warning", - "Information". - :type message_level: str or ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.MessageLevelType """ @@ -63,7 +53,6 @@ def __init__( message_level: Optional[Union[str, "MessageLevelType"]] = None, **kwargs ): -<<<<<<< HEAD """ :keyword last_config_applied: Datetime the configuration was last applied. :paramtype last_config_applied: ~datetime.datetime @@ -74,8 +63,6 @@ def __init__( :paramtype message_level: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.MessageLevelType """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ComplianceStatus, self).__init__(**kwargs) self.compliance_state = None self.last_config_applied = last_config_applied @@ -94,17 +81,10 @@ class ConfigurationIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant id of the system assigned identity which is used by the configuration. :vartype tenant_id: str -<<<<<<< HEAD :ivar type: The type of identity used for the configuration. Type 'SystemAssigned' will use an implicitly created identity. Type 'None' will not use Managed Identity for the configuration. Possible values include: "SystemAssigned", "None". :vartype type: str or -======= - :param type: The type of identity used for the configuration. Type 'SystemAssigned' will use an - implicitly created identity. Type 'None' will not use Managed Identity for the configuration. - Possible values include: "SystemAssigned", "None". - :type type: str or ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceIdentityType """ @@ -125,7 +105,6 @@ def __init__( type: Optional[Union[str, "ResourceIdentityType"]] = None, **kwargs ): -<<<<<<< HEAD """ :keyword type: The type of identity used for the configuration. Type 'SystemAssigned' will use an implicitly created identity. Type 'None' will not use Managed Identity for the @@ -133,8 +112,6 @@ def __init__( :paramtype type: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceIdentityType """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ConfigurationIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -146,19 +123,11 @@ class ErrorDefinition(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. -<<<<<<< HEAD :ivar code: Required. Service specific error code which serves as the substatus for the HTTP error code. :vartype code: str :ivar message: Required. Description of the error. :vartype message: str -======= - :param code: Required. Service specific error code which serves as the substatus for the HTTP - error code. - :type code: str - :param message: Required. Description of the error. - :type message: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -178,7 +147,6 @@ def __init__( message: str, **kwargs ): -<<<<<<< HEAD """ :keyword code: Required. Service specific error code which serves as the substatus for the HTTP error code. @@ -186,8 +154,6 @@ def __init__( :keyword message: Required. Description of the error. :paramtype message: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorDefinition, self).__init__(**kwargs) self.code = code self.message = message @@ -214,11 +180,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorResponse, self).__init__(**kwargs) self.error = None @@ -234,15 +197,9 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str -<<<<<<< HEAD :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData -======= - :param system_data: Top level metadata - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -264,15 +221,12 @@ def __init__( system_data: Optional["SystemData"] = None, **kwargs ): -<<<<<<< HEAD """ :keyword system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :paramtype system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -291,15 +245,9 @@ class ProxyResource(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str -<<<<<<< HEAD :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData -======= - :param system_data: Top level metadata - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -321,15 +269,12 @@ def __init__( system_data: Optional["SystemData"] = None, **kwargs ): -<<<<<<< HEAD """ :keyword system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :paramtype system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ProxyResource, self).__init__(system_data=system_data, **kwargs) @@ -344,7 +289,6 @@ class ExtensionInstance(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str -<<<<<<< HEAD :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData @@ -369,43 +313,12 @@ class ExtensionInstance(ProxyResource): :ivar configuration_protected_settings: Configuration settings that are sensitive, as name-value pairs for configuring this instance of the extension. :vartype configuration_protected_settings: dict[str, str] -======= - :param system_data: Top level metadata - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData - :param extension_type: Type of the Extension, of which this resource is an instance of. It - must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the - Extension publisher. - :type extension_type: str - :param auto_upgrade_minor_version: Flag to note if this instance participates in auto upgrade - of minor version, or not. - :type auto_upgrade_minor_version: bool - :param release_train: ReleaseTrain this extension instance participates in for auto-upgrade - (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. - :type release_train: str - :param version: Version of the extension for this extension instance, if it is 'pinned' to a - specific version. autoUpgradeMinorVersion must be 'false'. - :type version: str - :param scope: Scope at which the extension instance is installed. - :type scope: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Scope - :param configuration_settings: Configuration settings, as name-value pairs for configuring this - instance of the extension. - :type configuration_settings: dict[str, str] - :param configuration_protected_settings: Configuration settings that are sensitive, as - name-value pairs for configuring this instance of the extension. - :type configuration_protected_settings: dict[str, str] ->>>>>>> 331f997c (updating to the latest vendored sdk) :ivar install_state: Status of installation of this instance of the extension. Possible values include: "Pending", "Installed", "Failed". :vartype install_state: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.InstallStateType -<<<<<<< HEAD :ivar statuses: Status from this instance of the extension. :vartype statuses: -======= - :param statuses: Status from this instance of the extension. - :type statuses: ->>>>>>> 331f997c (updating to the latest vendored sdk) list[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionStatus] :ivar creation_time: DateLiteral (per ISO8601) noting the time the resource was created by the client (user). @@ -419,13 +332,8 @@ class ExtensionInstance(ProxyResource): :ivar error_info: Error information from the Agent - e.g. errors during installation. :vartype error_info: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ErrorDefinition -<<<<<<< HEAD :ivar identity: The identity of the configuration. :vartype identity: -======= - :param identity: The identity of the configuration. - :type identity: ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ConfigurationIdentity """ @@ -476,7 +384,6 @@ def __init__( identity: Optional["ConfigurationIdentity"] = None, **kwargs ): -<<<<<<< HEAD """ :keyword system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. @@ -510,8 +417,6 @@ def __init__( :paramtype identity: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ConfigurationIdentity """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionInstance, self).__init__(system_data=system_data, **kwargs) self.extension_type = extension_type self.auto_upgrade_minor_version = auto_upgrade_minor_version @@ -555,11 +460,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionInstancesList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -568,7 +470,6 @@ def __init__( class ExtensionInstanceUpdate(msrest.serialization.Model): """Update Extension Instance request object. -<<<<<<< HEAD :ivar auto_upgrade_minor_version: Flag to note if this instance participates in Extension Lifecycle Management or not. :vartype auto_upgrade_minor_version: bool @@ -578,17 +479,6 @@ class ExtensionInstanceUpdate(msrest.serialization.Model): :ivar version: Version number of extension, to 'pin' to a specific version. autoUpgradeMinorVersion must be 'false'. :vartype version: str -======= - :param auto_upgrade_minor_version: Flag to note if this instance participates in Extension - Lifecycle Management or not. - :type auto_upgrade_minor_version: bool - :param release_train: ReleaseTrain this extension instance participates in for auto-upgrade - (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. - :type release_train: str - :param version: Version number of extension, to 'pin' to a specific version. - autoUpgradeMinorVersion must be 'false'. - :type version: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -605,7 +495,6 @@ def __init__( version: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword auto_upgrade_minor_version: Flag to note if this instance participates in Extension Lifecycle Management or not. @@ -617,8 +506,6 @@ def __init__( autoUpgradeMinorVersion must be 'false'. :paramtype version: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionInstanceUpdate, self).__init__(**kwargs) self.auto_upgrade_minor_version = auto_upgrade_minor_version self.release_train = release_train @@ -628,7 +515,6 @@ def __init__( class ExtensionStatus(msrest.serialization.Model): """Status from this instance of the extension. -<<<<<<< HEAD :ivar code: Status code provided by the Extension. :vartype code: str :ivar display_status: Short description of status of this instance of the extension. @@ -640,19 +526,6 @@ class ExtensionStatus(msrest.serialization.Model): :vartype message: str :ivar time: DateLiteral (per ISO8601) noting the time of installation status. :vartype time: str -======= - :param code: Status code provided by the Extension. - :type code: str - :param display_status: Short description of status of this instance of the extension. - :type display_status: str - :param level: Level of the status. Possible values include: "Error", "Warning", "Information". - Default value: "Information". - :type level: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.LevelType - :param message: Detailed message of the status from the Extension instance. - :type message: str - :param time: DateLiteral (per ISO8601) noting the time of installation status. - :type time: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -673,7 +546,6 @@ def __init__( time: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword code: Status code provided by the Extension. :paramtype code: str @@ -688,8 +560,6 @@ def __init__( :keyword time: DateLiteral (per ISO8601) noting the time of installation status. :paramtype time: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionStatus, self).__init__(**kwargs) self.code = code self.display_status = display_status @@ -701,17 +571,10 @@ def __init__( class HelmOperatorProperties(msrest.serialization.Model): """Properties for Helm operator. -<<<<<<< HEAD :ivar chart_version: Version of the operator Helm chart. :vartype chart_version: str :ivar chart_values: Values override for the operator Helm chart. :vartype chart_values: str -======= - :param chart_version: Version of the operator Helm chart. - :type chart_version: str - :param chart_values: Values override for the operator Helm chart. - :type chart_values: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -726,15 +589,12 @@ def __init__( chart_values: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword chart_version: Version of the operator Helm chart. :paramtype chart_version: str :keyword chart_values: Values override for the operator Helm chart. :paramtype chart_values: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(HelmOperatorProperties, self).__init__(**kwargs) self.chart_version = chart_version self.chart_values = chart_values @@ -745,17 +605,10 @@ class ResourceProviderOperation(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. -<<<<<<< HEAD :ivar name: Operation name, in format of {provider}/{resource}/{operation}. :vartype name: str :ivar display: Display metadata associated with the operation. :vartype display: -======= - :param name: Operation name, in format of {provider}/{resource}/{operation}. - :type name: str - :param display: Display metadata associated with the operation. - :type display: ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceProviderOperationDisplay :ivar is_data_action: The flag that indicates whether the operation applies to data plane. :vartype is_data_action: bool @@ -778,7 +631,6 @@ def __init__( display: Optional["ResourceProviderOperationDisplay"] = None, **kwargs ): -<<<<<<< HEAD """ :keyword name: Operation name, in format of {provider}/{resource}/{operation}. :paramtype name: str @@ -786,8 +638,6 @@ def __init__( :paramtype display: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceProviderOperationDisplay """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperation, self).__init__(**kwargs) self.name = name self.display = display @@ -797,7 +647,6 @@ def __init__( class ResourceProviderOperationDisplay(msrest.serialization.Model): """Display metadata associated with the operation. -<<<<<<< HEAD :ivar provider: Resource provider: Microsoft KubernetesConfiguration. :vartype provider: str :ivar resource: Resource on which the operation is performed. @@ -806,16 +655,6 @@ class ResourceProviderOperationDisplay(msrest.serialization.Model): :vartype operation: str :ivar description: Description of this operation. :vartype description: str -======= - :param provider: Resource provider: Microsoft KubernetesConfiguration. - :type provider: str - :param resource: Resource on which the operation is performed. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of this operation. - :type description: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -834,7 +673,6 @@ def __init__( description: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword provider: Resource provider: Microsoft KubernetesConfiguration. :paramtype provider: str @@ -845,8 +683,6 @@ def __init__( :keyword description: Description of this operation. :paramtype description: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperationDisplay, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -859,13 +695,8 @@ class ResourceProviderOperationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. -<<<<<<< HEAD :ivar value: List of operations supported by this resource provider. :vartype value: -======= - :param value: List of operations supported by this resource provider. - :type value: ->>>>>>> 331f997c (updating to the latest vendored sdk) list[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceProviderOperation] :ivar next_link: URL to the next set of results, if any. :vartype next_link: str @@ -886,14 +717,11 @@ def __init__( value: Optional[List["ResourceProviderOperation"]] = None, **kwargs ): -<<<<<<< HEAD """ :keyword value: List of operations supported by this resource provider. :paramtype value: list[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceProviderOperation] """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperationList, self).__init__(**kwargs) self.value = value self.next_link = None @@ -902,13 +730,8 @@ def __init__( class Result(msrest.serialization.Model): """Sample result definition. -<<<<<<< HEAD :ivar sample_property: Sample property of type string. :vartype sample_property: str -======= - :param sample_property: Sample property of type string. - :type sample_property: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -921,13 +744,10 @@ def __init__( sample_property: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword sample_property: Sample property of type string. :paramtype sample_property: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(Result, self).__init__(**kwargs) self.sample_property = sample_property @@ -935,18 +755,11 @@ def __init__( class Scope(msrest.serialization.Model): """Scope of the extensionInstance. It can be either Cluster or Namespace; but not both. -<<<<<<< HEAD :ivar cluster: Specifies that the scope of the extensionInstance is Cluster. :vartype cluster: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ScopeCluster :ivar namespace: Specifies that the scope of the extensionInstance is Namespace. :vartype namespace: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ScopeNamespace -======= - :param cluster: Specifies that the scope of the extensionInstance is Cluster. - :type cluster: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ScopeCluster - :param namespace: Specifies that the scope of the extensionInstance is Namespace. - :type namespace: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ScopeNamespace ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -961,7 +774,6 @@ def __init__( namespace: Optional["ScopeNamespace"] = None, **kwargs ): -<<<<<<< HEAD """ :keyword cluster: Specifies that the scope of the extensionInstance is Cluster. :paramtype cluster: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ScopeCluster @@ -969,8 +781,6 @@ def __init__( :paramtype namespace: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ScopeNamespace """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(Scope, self).__init__(**kwargs) self.cluster = cluster self.namespace = namespace @@ -979,15 +789,9 @@ def __init__( class ScopeCluster(msrest.serialization.Model): """Specifies that the scope of the extensionInstance is Cluster. -<<<<<<< HEAD :ivar release_namespace: Namespace where the extension Release must be placed, for a Cluster scoped extensionInstance. If this namespace does not exist, it will be created. :vartype release_namespace: str -======= - :param release_namespace: Namespace where the extension Release must be placed, for a Cluster - scoped extensionInstance. If this namespace does not exist, it will be created. - :type release_namespace: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1000,14 +804,11 @@ def __init__( release_namespace: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword release_namespace: Namespace where the extension Release must be placed, for a Cluster scoped extensionInstance. If this namespace does not exist, it will be created. :paramtype release_namespace: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ScopeCluster, self).__init__(**kwargs) self.release_namespace = release_namespace @@ -1015,15 +816,9 @@ def __init__( class ScopeNamespace(msrest.serialization.Model): """Specifies that the scope of the extensionInstance is Namespace. -<<<<<<< HEAD :ivar target_namespace: Namespace where the extensionInstance will be created for an Namespace scoped extensionInstance. If this namespace does not exist, it will be created. :vartype target_namespace: str -======= - :param target_namespace: Namespace where the extensionInstance will be created for an Namespace - scoped extensionInstance. If this namespace does not exist, it will be created. - :type target_namespace: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1036,14 +831,11 @@ def __init__( target_namespace: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword target_namespace: Namespace where the extensionInstance will be created for an Namespace scoped extensionInstance. If this namespace does not exist, it will be created. :paramtype target_namespace: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ScopeNamespace, self).__init__(**kwargs) self.target_namespace = target_namespace @@ -1059,7 +851,6 @@ class SourceControlConfiguration(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str -<<<<<<< HEAD :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData @@ -1082,35 +873,10 @@ class SourceControlConfiguration(ProxyResource): :ivar operator_scope: Scope at which the operator will be installed. Possible values include: "cluster", "namespace". Default value: "cluster". :vartype operator_scope: str or -======= - :param system_data: Top level metadata - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SystemData - :param repository_url: Url of the SourceControl Repository. - :type repository_url: str - :param operator_namespace: The namespace to which this operator is installed to. Maximum of 253 - lower case alphanumeric characters, hyphen and period only. - :type operator_namespace: str - :param operator_instance_name: Instance name of the operator - identifying the specific - configuration. - :type operator_instance_name: str - :param operator_type: Type of the operator. Possible values include: "Flux". - :type operator_type: str or - ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.OperatorType - :param operator_params: Any Parameters for the Operator instance in string format. - :type operator_params: str - :param configuration_protected_settings: Name-value pairs of protected configuration settings - for the configuration. - :type configuration_protected_settings: dict[str, str] - :param operator_scope: Scope at which the operator will be installed. Possible values include: - "cluster", "namespace". Default value: "cluster". - :type operator_scope: str or ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.OperatorScopeType :ivar repository_public_key: Public Key associated with this SourceControl configuration (either generated within the cluster or provided by the user). :vartype repository_public_key: str -<<<<<<< HEAD :ivar ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys required to access private Git instances. :vartype ssh_known_hosts_contents: str @@ -1118,15 +884,6 @@ class SourceControlConfiguration(ProxyResource): :vartype enable_helm_operator: bool :ivar helm_operator_properties: Properties for Helm operator. :vartype helm_operator_properties: -======= - :param ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys - required to access private Git instances. - :type ssh_known_hosts_contents: str - :param enable_helm_operator: Option to enable Helm Operator for this git configuration. - :type enable_helm_operator: bool - :param helm_operator_properties: Properties for Helm operator. - :type helm_operator_properties: ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.HelmOperatorProperties :ivar provisioning_state: The provisioning state of the resource provider. Possible values include: "Accepted", "Deleting", "Running", "Succeeded", "Failed". @@ -1182,7 +939,6 @@ def __init__( helm_operator_properties: Optional["HelmOperatorProperties"] = None, **kwargs ): -<<<<<<< HEAD """ :keyword system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. @@ -1217,8 +973,6 @@ def __init__( :paramtype helm_operator_properties: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.HelmOperatorProperties """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(SourceControlConfiguration, self).__init__(system_data=system_data, **kwargs) self.repository_url = repository_url self.operator_namespace = operator_namespace @@ -1261,11 +1015,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(SourceControlConfigurationList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -1314,11 +1065,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(SystemData, self).__init__(**kwargs) self.created_by = None self.created_by_type = None diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_source_control_configuration_client_enums.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_source_control_configuration_client_enums.py index 0f07aea7fd9..bae6382fbce 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_source_control_configuration_client_enums.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/models/_source_control_configuration_client_enums.py @@ -6,36 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from enum import Enum from six import with_metaclass from azure.core import CaseInsensitiveEnumMeta class ComplianceStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -from enum import Enum, EnumMeta -from six import with_metaclass - -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class ComplianceStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """The compliance state of the configuration. """ @@ -45,29 +21,17 @@ class ComplianceStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): INSTALLED = "Installed" FAILED = "Failed" -<<<<<<< HEAD class Enum0(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class Enum0(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) MICROSOFT_CONTAINER_SERVICE = "Microsoft.ContainerService" MICROSOFT_KUBERNETES = "Microsoft.Kubernetes" -<<<<<<< HEAD class Enum1(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class Enum1(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) MANAGED_CLUSTERS = "managedClusters" CONNECTED_CLUSTERS = "connectedClusters" -<<<<<<< HEAD class InstallStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class InstallStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Status of installation of this instance of the extension. """ @@ -75,11 +39,7 @@ class InstallStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): INSTALLED = "Installed" FAILED = "Failed" -<<<<<<< HEAD class LevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class LevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Level of the status. """ @@ -87,11 +47,7 @@ class LevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): WARNING = "Warning" INFORMATION = "Information" -<<<<<<< HEAD class MessageLevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class MessageLevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Level of the message. """ @@ -99,32 +55,20 @@ class MessageLevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): WARNING = "Warning" INFORMATION = "Information" -<<<<<<< HEAD class OperatorScopeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class OperatorScopeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Scope at which the operator will be installed. """ CLUSTER = "cluster" NAMESPACE = "namespace" -<<<<<<< HEAD class OperatorType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class OperatorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Type of the operator """ FLUX = "Flux" -<<<<<<< HEAD class ProvisioningStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class ProvisioningStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """The provisioning state of the resource provider. """ @@ -134,11 +78,7 @@ class ProvisioningStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) SUCCEEDED = "Succeeded" FAILED = "Failed" -<<<<<<< HEAD class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """The type of identity used for the configuration. Type 'SystemAssigned' will use an implicitly created identity. Type 'None' will not use Managed Identity for the configuration. """ diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_extensions_operations.py index 744e72b5f15..f0a15e102ca 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_extensions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_extensions_operations.py @@ -5,18 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -======= -from typing import TYPE_CHECKING ->>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -251,19 +246,6 @@ def build_list_request( headers=header_parameters, **kwargs ) -======= -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] ->>>>>>> 331f997c (updating to the latest vendored sdk) class ExtensionsOperations(object): """ExtensionsOperations operations. @@ -287,7 +269,6 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace def create( self, @@ -299,19 +280,6 @@ def create( extension_instance: "_models.ExtensionInstance", **kwargs: Any ) -> "_models.ExtensionInstance": -======= - def create( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_instance_name, # type: str - extension_instance, # type: "_models.ExtensionInstance" - **kwargs # type: Any - ): - # type: (...) -> "_models.ExtensionInstance" ->>>>>>> 331f997c (updating to the latest vendored sdk) """Create a new Kubernetes Cluster Extension Instance. :param resource_group_name: The name of the resource group. @@ -321,23 +289,15 @@ def create( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_instance_name: Name of an instance of the Extension. :type extension_instance_name: str :param extension_instance: Properties necessary to Create an Extension Instance. -<<<<<<< HEAD :type extension_instance: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstance -======= - :type extension_instance: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstance ->>>>>>> 331f997c (updating to the latest vendored sdk) :keyword callable cls: A custom type or function that will be passed the direct response :return: ExtensionInstance, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstance @@ -348,7 +308,6 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -368,47 +327,12 @@ def create( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2020-07-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionInstanceName': self._serialize.url("extension_instance_name", extension_instance_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(extension_instance, 'ExtensionInstance') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExtensionInstance', pipeline_response) @@ -417,7 +341,6 @@ def create( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore @@ -432,20 +355,6 @@ def get( extension_instance_name: str, **kwargs: Any ) -> "_models.ExtensionInstance": -======= - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_instance_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ExtensionInstance" ->>>>>>> 331f997c (updating to the latest vendored sdk) """Gets details of the Kubernetes Cluster Extension Instance. :param resource_group_name: The name of the resource group. @@ -455,12 +364,8 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_instance_name: Name of an instance of the Extension. @@ -475,7 +380,6 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -490,42 +394,12 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2020-07-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionInstanceName': self._serialize.url("extension_instance_name", extension_instance_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExtensionInstance', pipeline_response) @@ -534,7 +408,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore @@ -550,21 +423,6 @@ def update( extension_instance: "_models.ExtensionInstanceUpdate", **kwargs: Any ) -> "_models.ExtensionInstance": -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore - - def update( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_instance_name, # type: str - extension_instance, # type: "_models.ExtensionInstanceUpdate" - **kwargs # type: Any - ): - # type: (...) -> "_models.ExtensionInstance" ->>>>>>> 331f997c (updating to the latest vendored sdk) """Update an existing Kubernetes Cluster Extension Instance. :param resource_group_name: The name of the resource group. @@ -574,23 +432,15 @@ def update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_instance_name: Name of an instance of the Extension. :type extension_instance_name: str :param extension_instance: Properties to Update in the Extension Instance. -<<<<<<< HEAD :type extension_instance: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstanceUpdate -======= - :type extension_instance: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstanceUpdate ->>>>>>> 331f997c (updating to the latest vendored sdk) :keyword callable cls: A custom type or function that will be passed the direct response :return: ExtensionInstance, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstance @@ -601,7 +451,6 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -621,47 +470,12 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2020-07-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionInstanceName': self._serialize.url("extension_instance_name", extension_instance_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(extension_instance, 'ExtensionInstanceUpdate') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExtensionInstance', pipeline_response) @@ -670,7 +484,6 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore @@ -685,20 +498,6 @@ def delete( extension_instance_name: str, **kwargs: Any ) -> None: -======= - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore - - def delete( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_instance_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None ->>>>>>> 331f997c (updating to the latest vendored sdk) """Delete a Kubernetes Cluster Extension Instance. This will cause the Agent to Uninstall the extension instance from the cluster. @@ -709,12 +508,8 @@ def delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_instance_name: Name of an instance of the Extension. @@ -729,7 +524,6 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_delete_request( @@ -744,42 +538,12 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2020-07-01-preview" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionInstanceName': self._serialize.url("extension_instance_name", extension_instance_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -787,7 +551,6 @@ def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}'} # type: ignore -<<<<<<< HEAD @distributed_trace def list( @@ -798,17 +561,6 @@ def list( cluster_name: str, **kwargs: Any ) -> Iterable["_models.ExtensionInstancesList"]: -======= - def list( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ExtensionInstancesList"] ->>>>>>> 331f997c (updating to the latest vendored sdk) """List all Source Control Configurations. :param resource_group_name: The name of the resource group. @@ -818,7 +570,6 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -828,14 +579,6 @@ def list( cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstancesList] -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 - :param cluster_name: The name of the kubernetes cluster. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ExtensionInstancesList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ExtensionInstancesList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionInstancesList"] @@ -843,7 +586,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -875,40 +617,6 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionInstancesList", pipeline_response) -======= - api_version = "2020-07-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ExtensionInstancesList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -921,21 +629,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_operations.py index 01d15c71bd0..3e405e2ae48 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_operations.py @@ -5,18 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -======= -from typing import TYPE_CHECKING ->>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -54,19 +49,6 @@ def build_list_request( headers=header_parameters, **kwargs ) -======= -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] ->>>>>>> 331f997c (updating to the latest vendored sdk) class Operations(object): """Operations operations. @@ -90,7 +72,6 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace def list( self, @@ -103,18 +84,6 @@ def list( cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceProviderOperationList] -======= - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ResourceProviderOperationList"] - """List all the available operations the KubernetesConfiguration resource provider supports. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.ResourceProviderOperationList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -122,7 +91,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -144,32 +112,6 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) -======= - api_version = "2020-07-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -182,21 +124,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_source_control_configurations_operations.py index d192efa6d03..3a863680448 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_source_control_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_07_01_preview/operations/_source_control_configurations_operations.py @@ -5,25 +5,199 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + source_control_configuration_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-07-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "sourceControlConfigurationName": _SERIALIZER.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + source_control_configuration_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2020-07-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "sourceControlConfigurationName": _SERIALIZER.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + source_control_configuration_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-07-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "sourceControlConfigurationName": _SERIALIZER.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2020-07-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class SourceControlConfigurationsOperations(object): """SourceControlConfigurationsOperations operations. @@ -47,16 +221,16 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def get( self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - source_control_configuration_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.SourceControlConfiguration" + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + source_control_configuration_name: str, + **kwargs: Any + ) -> "_models.SourceControlConfiguration": """Gets details of the Source Control Configuration. :param resource_group_name: The name of the resource group. @@ -66,14 +240,16 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration + :rtype: + ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -81,36 +257,26 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + source_control_configuration_name=source_control_configuration_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) @@ -119,19 +285,21 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + + @distributed_trace def create_or_update( self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - source_control_configuration_name, # type: str - source_control_configuration, # type: "_models.SourceControlConfiguration" - **kwargs # type: Any - ): - # type: (...) -> "_models.SourceControlConfiguration" + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + source_control_configuration_name: str, + source_control_configuration: "_models.SourceControlConfiguration", + **kwargs: Any + ) -> "_models.SourceControlConfiguration": """Create a new Kubernetes Source Control Configuration. :param resource_group_name: The name of the resource group. @@ -141,16 +309,19 @@ def create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. - :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration + :type source_control_configuration: + ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration + :rtype: + ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -158,41 +329,31 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + source_control_configuration_name=source_control_configuration_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -205,70 +366,61 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + def _delete_initial( self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - source_control_configuration_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + source_control_configuration_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + source_control_configuration_name=source_control_configuration_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - source_control_configuration_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + source_control_configuration_name: str, + **kwargs: Any + ) -> LROPoller[None]: """This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from the source repo. @@ -279,22 +431,25 @@ def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -311,24 +466,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -340,17 +485,18 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + @distributed_trace def list( self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SourceControlConfigurationList"] + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + **kwargs: Any + ) -> Iterable["_models.SourceControlConfigurationList"]: """List all Source Control Configurations. :param resource_group_name: The name of the resource group. @@ -360,12 +506,15 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SourceControlConfigurationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfigurationList] + :return: An iterator like instance of either SourceControlConfigurationList or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_07_01_preview.models.SourceControlConfigurationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfigurationList"] @@ -373,38 +522,37 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-01-preview" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('SourceControlConfigurationList', pipeline_response) + deserialized = self._deserialize("SourceControlConfigurationList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -417,12 +565,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/__init__.py index fc12f19c5a1..e9096303633 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/__init__.py @@ -12,15 +12,7 @@ __version__ = VERSION __all__ = ['SourceControlConfigurationClient'] -<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() -======= -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/_configuration.py index 088f791fd39..7167f9bec31 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/_configuration.py @@ -6,29 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy -======= -from typing import TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy ->>>>>>> 331f997c (updating to the latest vendored sdk) from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports -<<<<<<< HEAD -======= - from typing import Any - ->>>>>>> 331f997c (updating to the latest vendored sdk) from azure.core.credentials import TokenCredential @@ -46,27 +33,15 @@ class SourceControlConfigurationClientConfiguration(Configuration): def __init__( self, -<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, **kwargs: Any ) -> None: super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) -======= - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None ->>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") -<<<<<<< HEAD -======= - super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -90,8 +65,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: -<<<<<<< HEAD self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) -======= - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/_source_control_configuration_client.py index 814be3d847b..435ce16a3a2 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/_source_control_configuration_client.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from copy import deepcopy from typing import Any, Optional, TYPE_CHECKING @@ -40,66 +39,20 @@ class SourceControlConfigurationClient: :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. -======= -from typing import TYPE_CHECKING - -from azure.mgmt.core import ARMPipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - 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 SourceControlConfigurationsOperations -from .operations import Operations -from . import models - - -class SourceControlConfigurationClient(object): - """KubernetesConfiguration Client. - - :ivar source_control_configurations: SourceControlConfigurationsOperations operations - :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.operations.SourceControlConfigurationsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.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). - :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. ->>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, -<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) -======= - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) -<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.source_control_configurations = SourceControlConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -131,33 +84,6 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) -======= - self._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - 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'), - } - 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 ->>>>>>> 331f997c (updating to the latest vendored sdk) def close(self): # type: () -> None diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/__init__.py index 5951024da8e..5f583276b4e 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/__init__.py @@ -8,11 +8,8 @@ from ._source_control_configuration_client import SourceControlConfigurationClient __all__ = ['SourceControlConfigurationClient'] -<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/_configuration.py index 6852289c2e3..2ea6b77035b 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/_configuration.py @@ -10,11 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -<<<<<<< HEAD from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy -======= -from azure.mgmt.core.policies import ARMHttpLoggingPolicy ->>>>>>> 331f997c (updating to the latest vendored sdk) from .._version import VERSION @@ -41,18 +37,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: -<<<<<<< HEAD super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") -<<<<<<< HEAD -======= - super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -75,8 +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: -<<<<<<< HEAD self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) -======= - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/_source_control_configuration_client.py index a5b1e5c640b..24c6800aa80 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/_source_control_configuration_client.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from copy import deepcopy from typing import Any, Awaitable, Optional, TYPE_CHECKING @@ -18,19 +17,10 @@ from ._configuration import SourceControlConfigurationClientConfiguration from .operations import Operations, SourceControlConfigurationsOperations -======= -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 - ->>>>>>> 331f997c (updating to the latest vendored sdk) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -<<<<<<< HEAD class SourceControlConfigurationClient: """KubernetesConfiguration Client. @@ -49,51 +39,20 @@ class SourceControlConfigurationClient: :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. -======= -from ._configuration import SourceControlConfigurationClientConfiguration -from .operations import SourceControlConfigurationsOperations -from .operations import Operations -from .. import models - - -class SourceControlConfigurationClient(object): - """KubernetesConfiguration Client. - - :ivar source_control_configurations: SourceControlConfigurationsOperations operations - :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.aio.operations.SourceControlConfigurationsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.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). - :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. ->>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, -<<<<<<< HEAD base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) -======= - base_url: Optional[str] = None, - **kwargs: Any - ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) -<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.source_control_configurations = SourceControlConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -125,32 +84,6 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) -======= - self._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - 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'), - } - 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 ->>>>>>> 331f997c (updating to the latest vendored sdk) async def close(self) -> None: await self._client.close() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/operations/_operations.py index 957c662360d..d10b2c945f2 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/operations/_operations.py @@ -5,17 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -25,13 +21,6 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operations import build_list_request -======= -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - ->>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -57,10 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, **kwargs: Any @@ -68,15 +54,10 @@ def list( """List all the available operations the KubernetesConfiguration resource provider supports. :keyword callable cls: A custom type or function that will be passed the direct response -<<<<<<< HEAD :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ResourceProviderOperationList] -======= - :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ResourceProviderOperationList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -84,7 +65,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -106,32 +86,6 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) -======= - api_version = "2020-10-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -144,21 +98,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/operations/_source_control_configurations_operations.py index b71798c1df5..1ff137c7cc0 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/operations/_source_control_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/aio/operations/_source_control_configurations_operations.py @@ -5,36 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async -======= -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod ->>>>>>> 331f997c (updating to the latest vendored sdk) from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -<<<<<<< HEAD from ..._vendor import _convert_request from ...operations._source_control_configurations_operations import build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request -======= - ->>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -60,10 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace_async -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -82,24 +67,16 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) -<<<<<<< HEAD :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration -======= - :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -107,7 +84,6 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -122,42 +98,12 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2020-10-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) @@ -166,16 +112,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @distributed_trace_async -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) async def create_or_update( self, resource_group_name: str, @@ -195,30 +136,19 @@ async def create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. -<<<<<<< HEAD :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration -======= - :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SourceControlConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -226,7 +156,6 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -246,47 +175,12 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2020-10-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -299,15 +193,10 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore -======= - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) async def _delete_initial( self, resource_group_name: str, @@ -322,7 +211,6 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_delete_request_initial( @@ -337,54 +225,20 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2020-10-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore -<<<<<<< HEAD @distributed_trace_async -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_delete( self, resource_group_name: str, @@ -404,19 +258,14 @@ async def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. -<<<<<<< HEAD :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -428,17 +277,6 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] -======= - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -455,33 +293,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) -<<<<<<< HEAD kwargs.pop('error_map', None) -======= - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) ->>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) -<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -493,15 +312,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @distributed_trace -======= - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -519,7 +333,6 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -529,14 +342,6 @@ def list( cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfigurationList] -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 - :param cluster_name: The name of the kubernetes cluster. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SourceControlConfigurationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfigurationList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfigurationList"] @@ -544,7 +349,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -576,40 +380,6 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("SourceControlConfigurationList", pipeline_response) -======= - api_version = "2020-10-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('SourceControlConfigurationList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -622,21 +392,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/__init__.py index 19fac6841ff..f851a5fd806 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/__init__.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from ._models_py3 import ComplianceStatus from ._models_py3 import ErrorDefinition from ._models_py3 import ErrorResponse @@ -21,36 +20,6 @@ from ._models_py3 import SourceControlConfigurationList from ._models_py3 import SystemData -======= -try: - from ._models_py3 import ComplianceStatus - from ._models_py3 import ErrorDefinition - from ._models_py3 import ErrorResponse - from ._models_py3 import HelmOperatorProperties - from ._models_py3 import ProxyResource - from ._models_py3 import Resource - from ._models_py3 import ResourceProviderOperation - from ._models_py3 import ResourceProviderOperationDisplay - from ._models_py3 import ResourceProviderOperationList - from ._models_py3 import Result - from ._models_py3 import SourceControlConfiguration - from ._models_py3 import SourceControlConfigurationList - from ._models_py3 import SystemData -except (SyntaxError, ImportError): - from ._models import ComplianceStatus # type: ignore - from ._models import ErrorDefinition # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import HelmOperatorProperties # type: ignore - from ._models import ProxyResource # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceProviderOperation # type: ignore - from ._models import ResourceProviderOperationDisplay # type: ignore - from ._models import ResourceProviderOperationList # type: ignore - from ._models import Result # type: ignore - from ._models import SourceControlConfiguration # type: ignore - from ._models import SourceControlConfigurationList # type: ignore - from ._models import SystemData # type: ignore ->>>>>>> 331f997c (updating to the latest vendored sdk) from ._source_control_configuration_client_enums import ( ComplianceStateType, diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_models.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_models.py deleted file mode 100644 index 12ebfd16f6d..00000000000 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_models.py +++ /dev/null @@ -1,506 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class ComplianceStatus(msrest.serialization.Model): - """Compliance Status details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar compliance_state: The compliance state of the configuration. Possible values include: - "Pending", "Compliant", "Noncompliant", "Installed", "Failed". - :vartype compliance_state: str or - ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ComplianceStateType - :param last_config_applied: Datetime the configuration was last applied. - :type last_config_applied: ~datetime.datetime - :param message: Message from when the configuration was applied. - :type message: str - :param message_level: Level of the message. Possible values include: "Error", "Warning", - "Information". - :type message_level: str or - ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.MessageLevelType - """ - - _validation = { - 'compliance_state': {'readonly': True}, - } - - _attribute_map = { - 'compliance_state': {'key': 'complianceState', 'type': 'str'}, - 'last_config_applied': {'key': 'lastConfigApplied', 'type': 'iso-8601'}, - 'message': {'key': 'message', 'type': 'str'}, - 'message_level': {'key': 'messageLevel', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComplianceStatus, self).__init__(**kwargs) - self.compliance_state = None - self.last_config_applied = kwargs.get('last_config_applied', None) - self.message = kwargs.get('message', None) - self.message_level = kwargs.get('message_level', None) - - -class ErrorDefinition(msrest.serialization.Model): - """Error definition. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. Service specific error code which serves as the substatus for the HTTP - error code. - :type code: str - :param message: Required. Description of the error. - :type message: str - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorDefinition, self).__init__(**kwargs) - self.code = kwargs['code'] - self.message = kwargs['message'] - - -class ErrorResponse(msrest.serialization.Model): - """Error response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar error: Error definition. - :vartype error: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ErrorDefinition - """ - - _validation = { - 'error': {'readonly': True}, - } - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDefinition'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = None - - -class HelmOperatorProperties(msrest.serialization.Model): - """Properties for Helm operator. - - :param chart_version: Version of the operator Helm chart. - :type chart_version: str - :param chart_values: Values override for the operator Helm chart. - :type chart_values: str - """ - - _attribute_map = { - 'chart_version': {'key': 'chartVersion', 'type': 'str'}, - 'chart_values': {'key': 'chartValues', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HelmOperatorProperties, self).__init__(**kwargs) - self.chart_version = kwargs.get('chart_version', None) - self.chart_values = kwargs.get('chart_values', None) - - -class Resource(msrest.serialization.Model): - """The Resource model definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param system_data: Top level metadata - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = kwargs.get('system_data', None) - - -class ProxyResource(Resource): - """ARM proxy resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param system_data: Top level metadata - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - super(ProxyResource, self).__init__(**kwargs) - - -class ResourceProviderOperation(msrest.serialization.Model): - """Supported operation of this resource provider. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param name: Operation name, in format of {provider}/{resource}/{operation}. - :type name: str - :param display: Display metadata associated with the operation. - :type display: - ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ResourceProviderOperationDisplay - :ivar is_data_action: The flag that indicates whether the operation applies to data plane. - :vartype is_data_action: bool - """ - - _validation = { - 'is_data_action': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderOperation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.is_data_action = None - - -class ResourceProviderOperationDisplay(msrest.serialization.Model): - """Display metadata associated with the operation. - - :param provider: Resource provider: Microsoft KubernetesConfiguration. - :type provider: str - :param resource: Resource on which the operation is performed. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of this operation. - :type description: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderOperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) - - -class ResourceProviderOperationList(msrest.serialization.Model): - """Result of the request to list operations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of operations supported by this resource provider. - :type value: - list[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ResourceProviderOperation] - :ivar next_link: URL to the next set of results, if any. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderOperationList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class Result(msrest.serialization.Model): - """Sample result definition. - - :param sample_property: Sample property of type string. - :type sample_property: str - """ - - _attribute_map = { - 'sample_property': {'key': 'sampleProperty', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Result, self).__init__(**kwargs) - self.sample_property = kwargs.get('sample_property', None) - - -class SourceControlConfiguration(ProxyResource): - """The SourceControl Configuration object returned in Get & Put response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param system_data: Top level metadata - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SystemData - :param repository_url: Url of the SourceControl Repository. - :type repository_url: str - :param operator_namespace: The namespace to which this operator is installed to. Maximum of 253 - lower case alphanumeric characters, hyphen and period only. - :type operator_namespace: str - :param operator_instance_name: Instance name of the operator - identifying the specific - configuration. - :type operator_instance_name: str - :param operator_type: Type of the operator. Possible values include: "Flux". - :type operator_type: str or - ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.OperatorType - :param operator_params: Any Parameters for the Operator instance in string format. - :type operator_params: str - :param configuration_protected_settings: Name-value pairs of protected configuration settings - for the configuration. - :type configuration_protected_settings: dict[str, str] - :param operator_scope: Scope at which the operator will be installed. Possible values include: - "cluster", "namespace". Default value: "cluster". - :type operator_scope: str or - ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.OperatorScopeType - :ivar repository_public_key: Public Key associated with this SourceControl configuration - (either generated within the cluster or provided by the user). - :vartype repository_public_key: str - :param ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys - required to access private Git instances. - :type ssh_known_hosts_contents: str - :param enable_helm_operator: Option to enable Helm Operator for this git configuration. - :type enable_helm_operator: bool - :param helm_operator_properties: Properties for Helm operator. - :type helm_operator_properties: - ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.HelmOperatorProperties - :ivar provisioning_state: The provisioning state of the resource provider. Possible values - include: "Accepted", "Deleting", "Running", "Succeeded", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ProvisioningStateType - :ivar compliance_status: Compliance Status of the Configuration. - :vartype compliance_status: - ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ComplianceStatus - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'repository_public_key': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'compliance_status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, - 'operator_namespace': {'key': 'properties.operatorNamespace', 'type': 'str'}, - 'operator_instance_name': {'key': 'properties.operatorInstanceName', 'type': 'str'}, - 'operator_type': {'key': 'properties.operatorType', 'type': 'str'}, - 'operator_params': {'key': 'properties.operatorParams', 'type': 'str'}, - 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, - 'operator_scope': {'key': 'properties.operatorScope', 'type': 'str'}, - 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, - 'ssh_known_hosts_contents': {'key': 'properties.sshKnownHostsContents', 'type': 'str'}, - 'enable_helm_operator': {'key': 'properties.enableHelmOperator', 'type': 'bool'}, - 'helm_operator_properties': {'key': 'properties.helmOperatorProperties', 'type': 'HelmOperatorProperties'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'compliance_status': {'key': 'properties.complianceStatus', 'type': 'ComplianceStatus'}, - } - - def __init__( - self, - **kwargs - ): - super(SourceControlConfiguration, self).__init__(**kwargs) - self.repository_url = kwargs.get('repository_url', None) - self.operator_namespace = kwargs.get('operator_namespace', "default") - self.operator_instance_name = kwargs.get('operator_instance_name', None) - self.operator_type = kwargs.get('operator_type', None) - self.operator_params = kwargs.get('operator_params', None) - self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) - self.operator_scope = kwargs.get('operator_scope', "cluster") - self.repository_public_key = None - self.ssh_known_hosts_contents = kwargs.get('ssh_known_hosts_contents', None) - self.enable_helm_operator = kwargs.get('enable_helm_operator', None) - self.helm_operator_properties = kwargs.get('helm_operator_properties', None) - self.provisioning_state = None - self.compliance_status = None - - -class SourceControlConfigurationList(msrest.serialization.Model): - """Result of the request to list Source Control Configurations. It contains a list of SourceControlConfiguration objects and a URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Source Control Configurations within a Kubernetes cluster. - :vartype value: - list[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration] - :ivar next_link: URL to get the next set of configuration objects, if any. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[SourceControlConfiguration]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SourceControlConfigurationList, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class SystemData(msrest.serialization.Model): - """Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar created_by: A string identifier for the identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource: user, application, - managedIdentity, key. - :vartype created_by_type: str - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: A string identifier for the identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource: user, - application, managedIdentity, key. - :vartype last_modified_by_type: str - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _validation = { - 'created_by': {'readonly': True}, - 'created_by_type': {'readonly': True}, - 'created_at': {'readonly': True}, - 'last_modified_by': {'readonly': True}, - 'last_modified_by_type': {'readonly': True}, - 'last_modified_at': {'readonly': True}, - } - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(SystemData, self).__init__(**kwargs) - self.created_by = None - self.created_by_type = None - self.created_at = None - self.last_modified_by = None - self.last_modified_by_type = None - self.last_modified_at = None diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_models_py3.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_models_py3.py index dedf54b286c..b3ea2a3dcc4 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_models_py3.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_models_py3.py @@ -24,7 +24,6 @@ class ComplianceStatus(msrest.serialization.Model): "Pending", "Compliant", "Noncompliant", "Installed", "Failed". :vartype compliance_state: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ComplianceStateType -<<<<<<< HEAD :ivar last_config_applied: Datetime the configuration was last applied. :vartype last_config_applied: ~datetime.datetime :ivar message: Message from when the configuration was applied. @@ -32,15 +31,6 @@ class ComplianceStatus(msrest.serialization.Model): :ivar message_level: Level of the message. Possible values include: "Error", "Warning", "Information". :vartype message_level: str or -======= - :param last_config_applied: Datetime the configuration was last applied. - :type last_config_applied: ~datetime.datetime - :param message: Message from when the configuration was applied. - :type message: str - :param message_level: Level of the message. Possible values include: "Error", "Warning", - "Information". - :type message_level: str or ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.MessageLevelType """ @@ -63,7 +53,6 @@ def __init__( message_level: Optional[Union[str, "MessageLevelType"]] = None, **kwargs ): -<<<<<<< HEAD """ :keyword last_config_applied: Datetime the configuration was last applied. :paramtype last_config_applied: ~datetime.datetime @@ -74,8 +63,6 @@ def __init__( :paramtype message_level: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.MessageLevelType """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ComplianceStatus, self).__init__(**kwargs) self.compliance_state = None self.last_config_applied = last_config_applied @@ -88,19 +75,11 @@ class ErrorDefinition(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. -<<<<<<< HEAD :ivar code: Required. Service specific error code which serves as the substatus for the HTTP error code. :vartype code: str :ivar message: Required. Description of the error. :vartype message: str -======= - :param code: Required. Service specific error code which serves as the substatus for the HTTP - error code. - :type code: str - :param message: Required. Description of the error. - :type message: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -120,7 +99,6 @@ def __init__( message: str, **kwargs ): -<<<<<<< HEAD """ :keyword code: Required. Service specific error code which serves as the substatus for the HTTP error code. @@ -128,8 +106,6 @@ def __init__( :keyword message: Required. Description of the error. :paramtype message: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorDefinition, self).__init__(**kwargs) self.code = code self.message = message @@ -156,11 +132,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorResponse, self).__init__(**kwargs) self.error = None @@ -168,17 +141,10 @@ def __init__( class HelmOperatorProperties(msrest.serialization.Model): """Properties for Helm operator. -<<<<<<< HEAD :ivar chart_version: Version of the operator Helm chart. :vartype chart_version: str :ivar chart_values: Values override for the operator Helm chart. :vartype chart_values: str -======= - :param chart_version: Version of the operator Helm chart. - :type chart_version: str - :param chart_values: Values override for the operator Helm chart. - :type chart_values: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -193,15 +159,12 @@ def __init__( chart_values: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword chart_version: Version of the operator Helm chart. :paramtype chart_version: str :keyword chart_values: Values override for the operator Helm chart. :paramtype chart_values: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(HelmOperatorProperties, self).__init__(**kwargs) self.chart_version = chart_version self.chart_values = chart_values @@ -218,15 +181,9 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource type. :vartype type: str -<<<<<<< HEAD :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SystemData -======= - :param system_data: Top level metadata - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SystemData ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -248,15 +205,12 @@ def __init__( system_data: Optional["SystemData"] = None, **kwargs ): -<<<<<<< HEAD """ :keyword system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :paramtype system_data: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SystemData """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -275,15 +229,9 @@ class ProxyResource(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str -<<<<<<< HEAD :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SystemData -======= - :param system_data: Top level metadata - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SystemData ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -305,15 +253,12 @@ def __init__( system_data: Optional["SystemData"] = None, **kwargs ): -<<<<<<< HEAD """ :keyword system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :paramtype system_data: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SystemData """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ProxyResource, self).__init__(system_data=system_data, **kwargs) @@ -322,17 +267,10 @@ class ResourceProviderOperation(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. -<<<<<<< HEAD :ivar name: Operation name, in format of {provider}/{resource}/{operation}. :vartype name: str :ivar display: Display metadata associated with the operation. :vartype display: -======= - :param name: Operation name, in format of {provider}/{resource}/{operation}. - :type name: str - :param display: Display metadata associated with the operation. - :type display: ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ResourceProviderOperationDisplay :ivar is_data_action: The flag that indicates whether the operation applies to data plane. :vartype is_data_action: bool @@ -355,7 +293,6 @@ def __init__( display: Optional["ResourceProviderOperationDisplay"] = None, **kwargs ): -<<<<<<< HEAD """ :keyword name: Operation name, in format of {provider}/{resource}/{operation}. :paramtype name: str @@ -363,8 +300,6 @@ def __init__( :paramtype display: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ResourceProviderOperationDisplay """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperation, self).__init__(**kwargs) self.name = name self.display = display @@ -374,7 +309,6 @@ def __init__( class ResourceProviderOperationDisplay(msrest.serialization.Model): """Display metadata associated with the operation. -<<<<<<< HEAD :ivar provider: Resource provider: Microsoft KubernetesConfiguration. :vartype provider: str :ivar resource: Resource on which the operation is performed. @@ -383,16 +317,6 @@ class ResourceProviderOperationDisplay(msrest.serialization.Model): :vartype operation: str :ivar description: Description of this operation. :vartype description: str -======= - :param provider: Resource provider: Microsoft KubernetesConfiguration. - :type provider: str - :param resource: Resource on which the operation is performed. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of this operation. - :type description: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -411,7 +335,6 @@ def __init__( description: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword provider: Resource provider: Microsoft KubernetesConfiguration. :paramtype provider: str @@ -422,8 +345,6 @@ def __init__( :keyword description: Description of this operation. :paramtype description: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperationDisplay, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -436,13 +357,8 @@ class ResourceProviderOperationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. -<<<<<<< HEAD :ivar value: List of operations supported by this resource provider. :vartype value: -======= - :param value: List of operations supported by this resource provider. - :type value: ->>>>>>> 331f997c (updating to the latest vendored sdk) list[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ResourceProviderOperation] :ivar next_link: URL to the next set of results, if any. :vartype next_link: str @@ -463,14 +379,11 @@ def __init__( value: Optional[List["ResourceProviderOperation"]] = None, **kwargs ): -<<<<<<< HEAD """ :keyword value: List of operations supported by this resource provider. :paramtype value: list[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ResourceProviderOperation] """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperationList, self).__init__(**kwargs) self.value = value self.next_link = None @@ -479,13 +392,8 @@ def __init__( class Result(msrest.serialization.Model): """Sample result definition. -<<<<<<< HEAD :ivar sample_property: Sample property of type string. :vartype sample_property: str -======= - :param sample_property: Sample property of type string. - :type sample_property: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -498,13 +406,10 @@ def __init__( sample_property: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword sample_property: Sample property of type string. :paramtype sample_property: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(Result, self).__init__(**kwargs) self.sample_property = sample_property @@ -520,7 +425,6 @@ class SourceControlConfiguration(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str -<<<<<<< HEAD :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SystemData @@ -543,35 +447,10 @@ class SourceControlConfiguration(ProxyResource): :ivar operator_scope: Scope at which the operator will be installed. Possible values include: "cluster", "namespace". Default value: "cluster". :vartype operator_scope: str or -======= - :param system_data: Top level metadata - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - :type system_data: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SystemData - :param repository_url: Url of the SourceControl Repository. - :type repository_url: str - :param operator_namespace: The namespace to which this operator is installed to. Maximum of 253 - lower case alphanumeric characters, hyphen and period only. - :type operator_namespace: str - :param operator_instance_name: Instance name of the operator - identifying the specific - configuration. - :type operator_instance_name: str - :param operator_type: Type of the operator. Possible values include: "Flux". - :type operator_type: str or - ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.OperatorType - :param operator_params: Any Parameters for the Operator instance in string format. - :type operator_params: str - :param configuration_protected_settings: Name-value pairs of protected configuration settings - for the configuration. - :type configuration_protected_settings: dict[str, str] - :param operator_scope: Scope at which the operator will be installed. Possible values include: - "cluster", "namespace". Default value: "cluster". - :type operator_scope: str or ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.OperatorScopeType :ivar repository_public_key: Public Key associated with this SourceControl configuration (either generated within the cluster or provided by the user). :vartype repository_public_key: str -<<<<<<< HEAD :ivar ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys required to access private Git instances. :vartype ssh_known_hosts_contents: str @@ -579,15 +458,6 @@ class SourceControlConfiguration(ProxyResource): :vartype enable_helm_operator: bool :ivar helm_operator_properties: Properties for Helm operator. :vartype helm_operator_properties: -======= - :param ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys - required to access private Git instances. - :type ssh_known_hosts_contents: str - :param enable_helm_operator: Option to enable Helm Operator for this git configuration. - :type enable_helm_operator: bool - :param helm_operator_properties: Properties for Helm operator. - :type helm_operator_properties: ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.HelmOperatorProperties :ivar provisioning_state: The provisioning state of the resource provider. Possible values include: "Accepted", "Deleting", "Running", "Succeeded", "Failed". @@ -643,7 +513,6 @@ def __init__( helm_operator_properties: Optional["HelmOperatorProperties"] = None, **kwargs ): -<<<<<<< HEAD """ :keyword system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. @@ -678,8 +547,6 @@ def __init__( :paramtype helm_operator_properties: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.HelmOperatorProperties """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(SourceControlConfiguration, self).__init__(system_data=system_data, **kwargs) self.repository_url = repository_url self.operator_namespace = operator_namespace @@ -722,11 +589,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(SourceControlConfigurationList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -775,11 +639,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(SystemData, self).__init__(**kwargs) self.created_by = None self.created_by_type = None diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_source_control_configuration_client_enums.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_source_control_configuration_client_enums.py index 48b2b93d6d8..f15af9df3a0 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_source_control_configuration_client_enums.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/models/_source_control_configuration_client_enums.py @@ -6,36 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from enum import Enum from six import with_metaclass from azure.core import CaseInsensitiveEnumMeta class ComplianceStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -from enum import Enum, EnumMeta -from six import with_metaclass - -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class ComplianceStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """The compliance state of the configuration. """ @@ -45,29 +21,17 @@ class ComplianceStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): INSTALLED = "Installed" FAILED = "Failed" -<<<<<<< HEAD class Enum0(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class Enum0(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) MICROSOFT_CONTAINER_SERVICE = "Microsoft.ContainerService" MICROSOFT_KUBERNETES = "Microsoft.Kubernetes" -<<<<<<< HEAD class Enum1(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class Enum1(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) MANAGED_CLUSTERS = "managedClusters" CONNECTED_CLUSTERS = "connectedClusters" -<<<<<<< HEAD class MessageLevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class MessageLevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Level of the message. """ @@ -75,32 +39,20 @@ class MessageLevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): WARNING = "Warning" INFORMATION = "Information" -<<<<<<< HEAD class OperatorScopeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class OperatorScopeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Scope at which the operator will be installed. """ CLUSTER = "cluster" NAMESPACE = "namespace" -<<<<<<< HEAD class OperatorType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class OperatorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Type of the operator """ FLUX = "Flux" -<<<<<<< HEAD class ProvisioningStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class ProvisioningStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """The provisioning state of the resource provider. """ diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/operations/_operations.py index bec332a7d13..04f675b2f5e 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/operations/_operations.py @@ -5,18 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -======= -from typing import TYPE_CHECKING ->>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -54,19 +49,6 @@ def build_list_request( headers=header_parameters, **kwargs ) -======= -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] ->>>>>>> 331f997c (updating to the latest vendored sdk) class Operations(object): """Operations operations. @@ -90,7 +72,6 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace def list( self, @@ -103,18 +84,6 @@ def list( cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ResourceProviderOperationList] -======= - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ResourceProviderOperationList"] - """List all the available operations the KubernetesConfiguration resource provider supports. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.ResourceProviderOperationList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -122,7 +91,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -144,32 +112,6 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) -======= - api_version = "2020-10-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -182,21 +124,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/operations/_source_control_configurations_operations.py index 5593b374bff..8eebc483790 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/operations/_source_control_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2020_10_01_preview/operations/_source_control_configurations_operations.py @@ -5,18 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -======= -from typing import TYPE_CHECKING ->>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest @@ -203,21 +198,6 @@ def build_list_request( headers=header_parameters, **kwargs ) -======= -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] ->>>>>>> 331f997c (updating to the latest vendored sdk) class SourceControlConfigurationsOperations(object): """SourceControlConfigurationsOperations operations. @@ -241,7 +221,6 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace def get( self, @@ -252,18 +231,6 @@ def get( source_control_configuration_name: str, **kwargs: Any ) -> "_models.SourceControlConfiguration": -======= - def get( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - source_control_configuration_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.SourceControlConfiguration" ->>>>>>> 331f997c (updating to the latest vendored sdk) """Gets details of the Source Control Configuration. :param resource_group_name: The name of the resource group. @@ -273,24 +240,16 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) -<<<<<<< HEAD :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration -======= - :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -298,7 +257,6 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -313,42 +271,12 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2020-10-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) @@ -357,7 +285,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -373,21 +300,6 @@ def create_or_update( source_control_configuration: "_models.SourceControlConfiguration", **kwargs: Any ) -> "_models.SourceControlConfiguration": -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - - def create_or_update( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - source_control_configuration_name, # type: str - source_control_configuration, # type: "_models.SourceControlConfiguration" - **kwargs # type: Any - ): - # type: (...) -> "_models.SourceControlConfiguration" ->>>>>>> 331f997c (updating to the latest vendored sdk) """Create a new Kubernetes Source Control Configuration. :param resource_group_name: The name of the resource group. @@ -397,30 +309,19 @@ def create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. -<<<<<<< HEAD :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration -======= - :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SourceControlConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfiguration ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -428,7 +329,6 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -448,47 +348,12 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2020-10-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -501,7 +366,6 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -515,26 +379,11 @@ def _delete_initial( source_control_configuration_name: str, **kwargs: Any ) -> None: -======= - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - source_control_configuration_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_delete_request_initial( @@ -549,50 +398,18 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2020-10-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore -<<<<<<< HEAD @distributed_trace def begin_delete( @@ -604,18 +421,6 @@ def begin_delete( source_control_configuration_name: str, **kwargs: Any ) -> LROPoller[None]: -======= - def begin_delete( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - source_control_configuration_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] ->>>>>>> 331f997c (updating to the latest vendored sdk) """This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from the source repo. @@ -626,19 +431,14 @@ def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. -<<<<<<< HEAD :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -650,17 +450,6 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] -======= - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -677,33 +466,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) -<<<<<<< HEAD kwargs.pop('error_map', None) -======= - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) ->>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) -<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -715,7 +485,6 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -728,19 +497,6 @@ def list( cluster_name: str, **kwargs: Any ) -> Iterable["_models.SourceControlConfigurationList"]: -======= - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SourceControlConfigurationList"] ->>>>>>> 331f997c (updating to the latest vendored sdk) """List all Source Control Configurations. :param resource_group_name: The name of the resource group. @@ -750,7 +506,6 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -760,14 +515,6 @@ def list( cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfigurationList] -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.Enum1 - :param cluster_name: The name of the kubernetes cluster. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SourceControlConfigurationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2020_10_01_preview.models.SourceControlConfigurationList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfigurationList"] @@ -775,7 +522,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -807,40 +553,6 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("SourceControlConfigurationList", pipeline_response) -======= - api_version = "2020-10-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('SourceControlConfigurationList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -853,21 +565,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/__init__.py index fc12f19c5a1..e9096303633 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/__init__.py @@ -12,15 +12,7 @@ __version__ = VERSION __all__ = ['SourceControlConfigurationClient'] -<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() -======= -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/_configuration.py index c438a8ccff7..d1e0dc4fffe 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/_configuration.py @@ -6,29 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy -======= -from typing import TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy ->>>>>>> 331f997c (updating to the latest vendored sdk) from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports -<<<<<<< HEAD -======= - from typing import Any - ->>>>>>> 331f997c (updating to the latest vendored sdk) from azure.core.credentials import TokenCredential @@ -46,27 +33,15 @@ class SourceControlConfigurationClientConfiguration(Configuration): def __init__( self, -<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, **kwargs: Any ) -> None: super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) -======= - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None ->>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") -<<<<<<< HEAD -======= - super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -90,8 +65,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: -<<<<<<< HEAD self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) -======= - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/_source_control_configuration_client.py index d67db32db0a..d88edd7b180 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/_source_control_configuration_client.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from copy import deepcopy from typing import Any, Optional, TYPE_CHECKING @@ -28,36 +27,10 @@ class SourceControlConfigurationClient: :ivar source_control_configurations: SourceControlConfigurationsOperations operations :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2021_03_01.operations.SourceControlConfigurationsOperations -======= -from typing import TYPE_CHECKING - -from azure.mgmt.core import ARMPipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - 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 SourceControlConfigurationsOperations -from .operations import Operations -from . import models - - -class SourceControlConfigurationClient(object): - """KubernetesConfiguration Client. - - :ivar source_control_configurations: SourceControlConfigurationsOperations operations - :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2021_03_01.operations.SourceControlConfigurationsOperations ->>>>>>> 331f997c (updating to the latest vendored sdk) :ivar operations: Operations operations :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_03_01.operations.Operations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential -<<<<<<< HEAD :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). :type subscription_id: str @@ -65,39 +38,20 @@ class SourceControlConfigurationClient(object): :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. -======= - :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - :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. ->>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, -<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) -======= - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) -<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.source_control_configurations = SourceControlConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -129,33 +83,6 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) -======= - self._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - 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'), - } - 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 ->>>>>>> 331f997c (updating to the latest vendored sdk) def close(self): # type: () -> None diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/__init__.py index 5951024da8e..5f583276b4e 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/__init__.py @@ -8,11 +8,8 @@ from ._source_control_configuration_client import SourceControlConfigurationClient __all__ = ['SourceControlConfigurationClient'] -<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/_configuration.py index abec5d981db..6e8d28ce1ac 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/_configuration.py @@ -10,11 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -<<<<<<< HEAD from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy -======= -from azure.mgmt.core.policies import ARMHttpLoggingPolicy ->>>>>>> 331f997c (updating to the latest vendored sdk) from .._version import VERSION @@ -41,18 +37,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: -<<<<<<< HEAD super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") -<<<<<<< HEAD -======= - super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -75,8 +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: -<<<<<<< HEAD self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) -======= - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/_source_control_configuration_client.py index 550afee6397..ebbe4381c95 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/_source_control_configuration_client.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from copy import deepcopy from typing import Any, Awaitable, Optional, TYPE_CHECKING @@ -18,43 +17,20 @@ from ._configuration import SourceControlConfigurationClientConfiguration from .operations import Operations, SourceControlConfigurationsOperations -======= -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 - ->>>>>>> 331f997c (updating to the latest vendored sdk) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -<<<<<<< HEAD class SourceControlConfigurationClient: """KubernetesConfiguration Client. :ivar source_control_configurations: SourceControlConfigurationsOperations operations :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2021_03_01.aio.operations.SourceControlConfigurationsOperations -======= -from ._configuration import SourceControlConfigurationClientConfiguration -from .operations import SourceControlConfigurationsOperations -from .operations import Operations -from .. import models - - -class SourceControlConfigurationClient(object): - """KubernetesConfiguration Client. - - :ivar source_control_configurations: SourceControlConfigurationsOperations operations - :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2021_03_01.aio.operations.SourceControlConfigurationsOperations ->>>>>>> 331f997c (updating to the latest vendored sdk) :ivar operations: Operations operations :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_03_01.aio.operations.Operations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential -<<<<<<< HEAD :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). :type subscription_id: str @@ -62,36 +38,20 @@ class SourceControlConfigurationClient(object): :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. -======= - :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - :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. ->>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, -<<<<<<< HEAD base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) -======= - base_url: Optional[str] = None, - **kwargs: Any - ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) -<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.source_control_configurations = SourceControlConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -123,32 +83,6 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) -======= - self._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - 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'), - } - 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 ->>>>>>> 331f997c (updating to the latest vendored sdk) async def close(self) -> None: await self._client.close() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/operations/_operations.py index e831c28485c..ced61c24199 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/operations/_operations.py @@ -5,17 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -25,13 +21,6 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operations import build_list_request -======= -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - ->>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -57,10 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, **kwargs: Any @@ -68,15 +54,10 @@ def list( """List all the available operations the KubernetesConfiguration resource provider supports. :keyword callable cls: A custom type or function that will be passed the direct response -<<<<<<< HEAD :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ResourceProviderOperationList] -======= - :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ResourceProviderOperationList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -84,7 +65,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -106,32 +86,6 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) -======= - api_version = "2021-03-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -144,21 +98,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/operations/_source_control_configurations_operations.py index a24f403d844..8ca4a2f361a 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/operations/_source_control_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/aio/operations/_source_control_configurations_operations.py @@ -5,36 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async -======= -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod ->>>>>>> 331f997c (updating to the latest vendored sdk) from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -<<<<<<< HEAD from ..._vendor import _convert_request from ...operations._source_control_configurations_operations import build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request -======= - ->>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -60,10 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace_async -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -82,12 +67,8 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. @@ -102,7 +83,6 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -117,42 +97,12 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) @@ -161,16 +111,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @distributed_trace_async -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) async def create_or_update( self, resource_group_name: str, @@ -190,23 +135,15 @@ async def create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. -<<<<<<< HEAD :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SourceControlConfiguration -======= - :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SourceControlConfiguration ->>>>>>> 331f997c (updating to the latest vendored sdk) :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SourceControlConfiguration @@ -217,7 +154,6 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -237,47 +173,12 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -290,15 +191,10 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore -======= - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) async def _delete_initial( self, resource_group_name: str, @@ -313,7 +209,6 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_delete_request_initial( @@ -328,54 +223,20 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore -<<<<<<< HEAD @distributed_trace_async -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_delete( self, resource_group_name: str, @@ -395,19 +256,14 @@ async def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. -<<<<<<< HEAD :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -419,17 +275,6 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] -======= - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -446,33 +291,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) -<<<<<<< HEAD - kwargs.pop('error_map', None) -======= - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) ->>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) -<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -484,15 +310,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @distributed_trace -======= - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -510,7 +331,6 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -520,14 +340,6 @@ def list( cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SourceControlConfigurationList] -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 - :param cluster_name: The name of the kubernetes cluster. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SourceControlConfigurationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SourceControlConfigurationList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfigurationList"] @@ -535,7 +347,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -567,40 +378,6 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("SourceControlConfigurationList", pipeline_response) -======= - api_version = "2021-03-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('SourceControlConfigurationList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -613,21 +390,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/__init__.py index d86f79d26e0..ec901c15835 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/__init__.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from ._models_py3 import ComplianceStatus from ._models_py3 import ErrorDefinition from ._models_py3 import ErrorResponse @@ -21,36 +20,6 @@ from ._models_py3 import SourceControlConfigurationList from ._models_py3 import SystemData -======= -try: - from ._models_py3 import ComplianceStatus - from ._models_py3 import ErrorDefinition - from ._models_py3 import ErrorResponse - from ._models_py3 import HelmOperatorProperties - from ._models_py3 import ProxyResource - from ._models_py3 import Resource - from ._models_py3 import ResourceProviderOperation - from ._models_py3 import ResourceProviderOperationDisplay - from ._models_py3 import ResourceProviderOperationList - from ._models_py3 import Result - from ._models_py3 import SourceControlConfiguration - from ._models_py3 import SourceControlConfigurationList - from ._models_py3 import SystemData -except (SyntaxError, ImportError): - from ._models import ComplianceStatus # type: ignore - from ._models import ErrorDefinition # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import HelmOperatorProperties # type: ignore - from ._models import ProxyResource # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceProviderOperation # type: ignore - from ._models import ResourceProviderOperationDisplay # type: ignore - from ._models import ResourceProviderOperationList # type: ignore - from ._models import Result # type: ignore - from ._models import SourceControlConfiguration # type: ignore - from ._models import SourceControlConfigurationList # type: ignore - from ._models import SystemData # type: ignore ->>>>>>> 331f997c (updating to the latest vendored sdk) from ._source_control_configuration_client_enums import ( ComplianceStateType, diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_models.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_models.py deleted file mode 100644 index 00bd900ea10..00000000000 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_models.py +++ /dev/null @@ -1,495 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class ComplianceStatus(msrest.serialization.Model): - """Compliance Status details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar compliance_state: The compliance state of the configuration. Possible values include: - "Pending", "Compliant", "Noncompliant", "Installed", "Failed". - :vartype compliance_state: str or - ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ComplianceStateType - :param last_config_applied: Datetime the configuration was last applied. - :type last_config_applied: ~datetime.datetime - :param message: Message from when the configuration was applied. - :type message: str - :param message_level: Level of the message. Possible values include: "Error", "Warning", - "Information". - :type message_level: str or - ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.MessageLevelType - """ - - _validation = { - 'compliance_state': {'readonly': True}, - } - - _attribute_map = { - 'compliance_state': {'key': 'complianceState', 'type': 'str'}, - 'last_config_applied': {'key': 'lastConfigApplied', 'type': 'iso-8601'}, - 'message': {'key': 'message', 'type': 'str'}, - 'message_level': {'key': 'messageLevel', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComplianceStatus, self).__init__(**kwargs) - self.compliance_state = None - self.last_config_applied = kwargs.get('last_config_applied', None) - self.message = kwargs.get('message', None) - self.message_level = kwargs.get('message_level', None) - - -class ErrorDefinition(msrest.serialization.Model): - """Error definition. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. Service specific error code which serves as the substatus for the HTTP - error code. - :type code: str - :param message: Required. Description of the error. - :type message: str - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorDefinition, self).__init__(**kwargs) - self.code = kwargs['code'] - self.message = kwargs['message'] - - -class ErrorResponse(msrest.serialization.Model): - """Error response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar error: Error definition. - :vartype error: ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ErrorDefinition - """ - - _validation = { - 'error': {'readonly': True}, - } - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDefinition'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = None - - -class HelmOperatorProperties(msrest.serialization.Model): - """Properties for Helm operator. - - :param chart_version: Version of the operator Helm chart. - :type chart_version: str - :param chart_values: Values override for the operator Helm chart. - :type chart_values: str - """ - - _attribute_map = { - 'chart_version': {'key': 'chartVersion', 'type': 'str'}, - 'chart_values': {'key': 'chartValues', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HelmOperatorProperties, self).__init__(**kwargs) - self.chart_version = kwargs.get('chart_version', None) - self.chart_values = kwargs.get('chart_values', None) - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProxyResource, self).__init__(**kwargs) - - -class ResourceProviderOperation(msrest.serialization.Model): - """Supported operation of this resource provider. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param name: Operation name, in format of {provider}/{resource}/{operation}. - :type name: str - :param display: Display metadata associated with the operation. - :type display: - ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ResourceProviderOperationDisplay - :ivar is_data_action: The flag that indicates whether the operation applies to data plane. - :vartype is_data_action: bool - """ - - _validation = { - 'is_data_action': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderOperation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.is_data_action = None - - -class ResourceProviderOperationDisplay(msrest.serialization.Model): - """Display metadata associated with the operation. - - :param provider: Resource provider: Microsoft KubernetesConfiguration. - :type provider: str - :param resource: Resource on which the operation is performed. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of this operation. - :type description: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderOperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) - - -class ResourceProviderOperationList(msrest.serialization.Model): - """Result of the request to list operations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of operations supported by this resource provider. - :type value: - list[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ResourceProviderOperation] - :ivar next_link: URL to the next set of results, if any. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderOperationList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class Result(msrest.serialization.Model): - """Sample result definition. - - :param sample_property: Sample property of type string. - :type sample_property: str - """ - - _attribute_map = { - 'sample_property': {'key': 'sampleProperty', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Result, self).__init__(**kwargs) - self.sample_property = kwargs.get('sample_property', None) - - -class SourceControlConfiguration(ProxyResource): - """The SourceControl Configuration object returned in Get & Put response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Top level metadata - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SystemData - :param repository_url: Url of the SourceControl Repository. - :type repository_url: str - :param operator_namespace: The namespace to which this operator is installed to. Maximum of 253 - lower case alphanumeric characters, hyphen and period only. - :type operator_namespace: str - :param operator_instance_name: Instance name of the operator - identifying the specific - configuration. - :type operator_instance_name: str - :param operator_type: Type of the operator. Possible values include: "Flux". - :type operator_type: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.OperatorType - :param operator_params: Any Parameters for the Operator instance in string format. - :type operator_params: str - :param configuration_protected_settings: Name-value pairs of protected configuration settings - for the configuration. - :type configuration_protected_settings: dict[str, str] - :param operator_scope: Scope at which the operator will be installed. Possible values include: - "cluster", "namespace". Default value: "cluster". - :type operator_scope: str or - ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.OperatorScopeType - :ivar repository_public_key: Public Key associated with this SourceControl configuration - (either generated within the cluster or provided by the user). - :vartype repository_public_key: str - :param ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys - required to access private Git instances. - :type ssh_known_hosts_contents: str - :param enable_helm_operator: Option to enable Helm Operator for this git configuration. - :type enable_helm_operator: bool - :param helm_operator_properties: Properties for Helm operator. - :type helm_operator_properties: - ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.HelmOperatorProperties - :ivar provisioning_state: The provisioning state of the resource provider. Possible values - include: "Accepted", "Deleting", "Running", "Succeeded", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ProvisioningStateType - :ivar compliance_status: Compliance Status of the Configuration. - :vartype compliance_status: - ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ComplianceStatus - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'repository_public_key': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'compliance_status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, - 'operator_namespace': {'key': 'properties.operatorNamespace', 'type': 'str'}, - 'operator_instance_name': {'key': 'properties.operatorInstanceName', 'type': 'str'}, - 'operator_type': {'key': 'properties.operatorType', 'type': 'str'}, - 'operator_params': {'key': 'properties.operatorParams', 'type': 'str'}, - 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, - 'operator_scope': {'key': 'properties.operatorScope', 'type': 'str'}, - 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, - 'ssh_known_hosts_contents': {'key': 'properties.sshKnownHostsContents', 'type': 'str'}, - 'enable_helm_operator': {'key': 'properties.enableHelmOperator', 'type': 'bool'}, - 'helm_operator_properties': {'key': 'properties.helmOperatorProperties', 'type': 'HelmOperatorProperties'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'compliance_status': {'key': 'properties.complianceStatus', 'type': 'ComplianceStatus'}, - } - - def __init__( - self, - **kwargs - ): - super(SourceControlConfiguration, self).__init__(**kwargs) - self.system_data = None - self.repository_url = kwargs.get('repository_url', None) - self.operator_namespace = kwargs.get('operator_namespace', "default") - self.operator_instance_name = kwargs.get('operator_instance_name', None) - self.operator_type = kwargs.get('operator_type', None) - self.operator_params = kwargs.get('operator_params', None) - self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) - self.operator_scope = kwargs.get('operator_scope', "cluster") - self.repository_public_key = None - self.ssh_known_hosts_contents = kwargs.get('ssh_known_hosts_contents', None) - self.enable_helm_operator = kwargs.get('enable_helm_operator', None) - self.helm_operator_properties = kwargs.get('helm_operator_properties', None) - self.provisioning_state = None - self.compliance_status = None - - -class SourceControlConfigurationList(msrest.serialization.Model): - """Result of the request to list Source Control Configurations. It contains a list of SourceControlConfiguration objects and a URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Source Control Configurations within a Kubernetes cluster. - :vartype value: - list[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SourceControlConfiguration] - :ivar next_link: URL to get the next set of configuration objects, if any. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[SourceControlConfiguration]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SourceControlConfigurationList, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or - ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or - ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.CreatedByType - :param last_modified_at: The timestamp of resource last modification (UTC). - :type last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_models_py3.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_models_py3.py index 4f62c3a00f4..fb21995b82b 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_models_py3.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_models_py3.py @@ -24,7 +24,6 @@ class ComplianceStatus(msrest.serialization.Model): "Pending", "Compliant", "Noncompliant", "Installed", "Failed". :vartype compliance_state: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ComplianceStateType -<<<<<<< HEAD :ivar last_config_applied: Datetime the configuration was last applied. :vartype last_config_applied: ~datetime.datetime :ivar message: Message from when the configuration was applied. @@ -32,15 +31,6 @@ class ComplianceStatus(msrest.serialization.Model): :ivar message_level: Level of the message. Possible values include: "Error", "Warning", "Information". :vartype message_level: str or -======= - :param last_config_applied: Datetime the configuration was last applied. - :type last_config_applied: ~datetime.datetime - :param message: Message from when the configuration was applied. - :type message: str - :param message_level: Level of the message. Possible values include: "Error", "Warning", - "Information". - :type message_level: str or ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.MessageLevelType """ @@ -63,7 +53,6 @@ def __init__( message_level: Optional[Union[str, "MessageLevelType"]] = None, **kwargs ): -<<<<<<< HEAD """ :keyword last_config_applied: Datetime the configuration was last applied. :paramtype last_config_applied: ~datetime.datetime @@ -74,8 +63,6 @@ def __init__( :paramtype message_level: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.MessageLevelType """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ComplianceStatus, self).__init__(**kwargs) self.compliance_state = None self.last_config_applied = last_config_applied @@ -88,19 +75,11 @@ class ErrorDefinition(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. -<<<<<<< HEAD :ivar code: Required. Service specific error code which serves as the substatus for the HTTP error code. :vartype code: str :ivar message: Required. Description of the error. :vartype message: str -======= - :param code: Required. Service specific error code which serves as the substatus for the HTTP - error code. - :type code: str - :param message: Required. Description of the error. - :type message: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -120,7 +99,6 @@ def __init__( message: str, **kwargs ): -<<<<<<< HEAD """ :keyword code: Required. Service specific error code which serves as the substatus for the HTTP error code. @@ -128,8 +106,6 @@ def __init__( :keyword message: Required. Description of the error. :paramtype message: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorDefinition, self).__init__(**kwargs) self.code = code self.message = message @@ -156,11 +132,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorResponse, self).__init__(**kwargs) self.error = None @@ -168,17 +141,10 @@ def __init__( class HelmOperatorProperties(msrest.serialization.Model): """Properties for Helm operator. -<<<<<<< HEAD :ivar chart_version: Version of the operator Helm chart. :vartype chart_version: str :ivar chart_values: Values override for the operator Helm chart. :vartype chart_values: str -======= - :param chart_version: Version of the operator Helm chart. - :type chart_version: str - :param chart_values: Values override for the operator Helm chart. - :type chart_values: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -193,15 +159,12 @@ def __init__( chart_values: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword chart_version: Version of the operator Helm chart. :paramtype chart_version: str :keyword chart_values: Values override for the operator Helm chart. :paramtype chart_values: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(HelmOperatorProperties, self).__init__(**kwargs) self.chart_version = chart_version self.chart_values = chart_values @@ -238,11 +201,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -280,11 +240,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ProxyResource, self).__init__(**kwargs) @@ -293,17 +250,10 @@ class ResourceProviderOperation(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. -<<<<<<< HEAD :ivar name: Operation name, in format of {provider}/{resource}/{operation}. :vartype name: str :ivar display: Display metadata associated with the operation. :vartype display: -======= - :param name: Operation name, in format of {provider}/{resource}/{operation}. - :type name: str - :param display: Display metadata associated with the operation. - :type display: ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ResourceProviderOperationDisplay :ivar is_data_action: The flag that indicates whether the operation applies to data plane. :vartype is_data_action: bool @@ -326,7 +276,6 @@ def __init__( display: Optional["ResourceProviderOperationDisplay"] = None, **kwargs ): -<<<<<<< HEAD """ :keyword name: Operation name, in format of {provider}/{resource}/{operation}. :paramtype name: str @@ -334,8 +283,6 @@ def __init__( :paramtype display: ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ResourceProviderOperationDisplay """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperation, self).__init__(**kwargs) self.name = name self.display = display @@ -345,7 +292,6 @@ def __init__( class ResourceProviderOperationDisplay(msrest.serialization.Model): """Display metadata associated with the operation. -<<<<<<< HEAD :ivar provider: Resource provider: Microsoft KubernetesConfiguration. :vartype provider: str :ivar resource: Resource on which the operation is performed. @@ -354,16 +300,6 @@ class ResourceProviderOperationDisplay(msrest.serialization.Model): :vartype operation: str :ivar description: Description of this operation. :vartype description: str -======= - :param provider: Resource provider: Microsoft KubernetesConfiguration. - :type provider: str - :param resource: Resource on which the operation is performed. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of this operation. - :type description: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -382,7 +318,6 @@ def __init__( description: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword provider: Resource provider: Microsoft KubernetesConfiguration. :paramtype provider: str @@ -393,8 +328,6 @@ def __init__( :keyword description: Description of this operation. :paramtype description: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperationDisplay, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -407,13 +340,8 @@ class ResourceProviderOperationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. -<<<<<<< HEAD :ivar value: List of operations supported by this resource provider. :vartype value: -======= - :param value: List of operations supported by this resource provider. - :type value: ->>>>>>> 331f997c (updating to the latest vendored sdk) list[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ResourceProviderOperation] :ivar next_link: URL to the next set of results, if any. :vartype next_link: str @@ -434,14 +362,11 @@ def __init__( value: Optional[List["ResourceProviderOperation"]] = None, **kwargs ): -<<<<<<< HEAD """ :keyword value: List of operations supported by this resource provider. :paramtype value: list[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ResourceProviderOperation] """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperationList, self).__init__(**kwargs) self.value = value self.next_link = None @@ -450,13 +375,8 @@ def __init__( class Result(msrest.serialization.Model): """Sample result definition. -<<<<<<< HEAD :ivar sample_property: Sample property of type string. :vartype sample_property: str -======= - :param sample_property: Sample property of type string. - :type sample_property: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -469,13 +389,10 @@ def __init__( sample_property: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword sample_property: Sample property of type string. :paramtype sample_property: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(Result, self).__init__(**kwargs) self.sample_property = sample_property @@ -496,7 +413,6 @@ class SourceControlConfiguration(ProxyResource): :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SystemData -<<<<<<< HEAD :ivar repository_url: Url of the SourceControl Repository. :vartype repository_url: str :ivar operator_namespace: The namespace to which this operator is installed to. Maximum of 253 @@ -516,31 +432,10 @@ class SourceControlConfiguration(ProxyResource): :ivar operator_scope: Scope at which the operator will be installed. Possible values include: "cluster", "namespace". Default value: "cluster". :vartype operator_scope: str or -======= - :param repository_url: Url of the SourceControl Repository. - :type repository_url: str - :param operator_namespace: The namespace to which this operator is installed to. Maximum of 253 - lower case alphanumeric characters, hyphen and period only. - :type operator_namespace: str - :param operator_instance_name: Instance name of the operator - identifying the specific - configuration. - :type operator_instance_name: str - :param operator_type: Type of the operator. Possible values include: "Flux". - :type operator_type: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.OperatorType - :param operator_params: Any Parameters for the Operator instance in string format. - :type operator_params: str - :param configuration_protected_settings: Name-value pairs of protected configuration settings - for the configuration. - :type configuration_protected_settings: dict[str, str] - :param operator_scope: Scope at which the operator will be installed. Possible values include: - "cluster", "namespace". Default value: "cluster". - :type operator_scope: str or ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.OperatorScopeType :ivar repository_public_key: Public Key associated with this SourceControl configuration (either generated within the cluster or provided by the user). :vartype repository_public_key: str -<<<<<<< HEAD :ivar ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys required to access private Git instances. :vartype ssh_known_hosts_contents: str @@ -548,15 +443,6 @@ class SourceControlConfiguration(ProxyResource): :vartype enable_helm_operator: bool :ivar helm_operator_properties: Properties for Helm operator. :vartype helm_operator_properties: -======= - :param ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys - required to access private Git instances. - :type ssh_known_hosts_contents: str - :param enable_helm_operator: Option to enable Helm Operator for this git configuration. - :type enable_helm_operator: bool - :param helm_operator_properties: Properties for Helm operator. - :type helm_operator_properties: ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.HelmOperatorProperties :ivar provisioning_state: The provisioning state of the resource provider. Possible values include: "Accepted", "Deleting", "Running", "Succeeded", "Failed". @@ -612,7 +498,6 @@ def __init__( helm_operator_properties: Optional["HelmOperatorProperties"] = None, **kwargs ): -<<<<<<< HEAD """ :keyword repository_url: Url of the SourceControl Repository. :paramtype repository_url: str @@ -643,8 +528,6 @@ def __init__( :paramtype helm_operator_properties: ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.HelmOperatorProperties """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(SourceControlConfiguration, self).__init__(**kwargs) self.system_data = None self.repository_url = repository_url @@ -688,11 +571,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(SourceControlConfigurationList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -701,7 +581,6 @@ def __init__( class SystemData(msrest.serialization.Model): """Metadata pertaining to creation and last modification of the resource. -<<<<<<< HEAD :ivar created_by: The identity that created the resource. :vartype created_by: str :ivar created_by_type: The type of identity that created the resource. Possible values include: @@ -718,24 +597,6 @@ class SystemData(msrest.serialization.Model): ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.CreatedByType :ivar last_modified_at: The timestamp of resource last modification (UTC). :vartype last_modified_at: ~datetime.datetime -======= - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or - ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or - ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.CreatedByType - :param last_modified_at: The timestamp of resource last modification (UTC). - :type last_modified_at: ~datetime.datetime ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -758,7 +619,6 @@ def __init__( last_modified_at: Optional[datetime.datetime] = None, **kwargs ): -<<<<<<< HEAD """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -777,8 +637,6 @@ def __init__( :keyword last_modified_at: The timestamp of resource last modification (UTC). :paramtype last_modified_at: ~datetime.datetime """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(SystemData, self).__init__(**kwargs) self.created_by = created_by self.created_by_type = created_by_type diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_source_control_configuration_client_enums.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_source_control_configuration_client_enums.py index 1fa1a3dbb51..68b551afcbe 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_source_control_configuration_client_enums.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/models/_source_control_configuration_client_enums.py @@ -6,36 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from enum import Enum from six import with_metaclass from azure.core import CaseInsensitiveEnumMeta class ComplianceStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -from enum import Enum, EnumMeta -from six import with_metaclass - -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class ComplianceStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """The compliance state of the configuration. """ @@ -45,11 +21,7 @@ class ComplianceStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): INSTALLED = "Installed" FAILED = "Failed" -<<<<<<< HEAD class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """The type of identity that created the resource. """ @@ -58,29 +30,17 @@ class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" -<<<<<<< HEAD class Enum0(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class Enum0(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) MICROSOFT_CONTAINER_SERVICE = "Microsoft.ContainerService" MICROSOFT_KUBERNETES = "Microsoft.Kubernetes" -<<<<<<< HEAD class Enum1(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class Enum1(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) MANAGED_CLUSTERS = "managedClusters" CONNECTED_CLUSTERS = "connectedClusters" -<<<<<<< HEAD class MessageLevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class MessageLevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Level of the message. """ @@ -88,32 +48,20 @@ class MessageLevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): WARNING = "Warning" INFORMATION = "Information" -<<<<<<< HEAD class OperatorScopeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class OperatorScopeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Scope at which the operator will be installed. """ CLUSTER = "cluster" NAMESPACE = "namespace" -<<<<<<< HEAD class OperatorType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class OperatorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Type of the operator """ FLUX = "Flux" -<<<<<<< HEAD class ProvisioningStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class ProvisioningStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """The provisioning state of the resource provider. """ diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/operations/_operations.py index 0c6b00498ac..284e6510ab7 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/operations/_operations.py @@ -5,18 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -======= -from typing import TYPE_CHECKING ->>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -54,19 +49,6 @@ def build_list_request( headers=header_parameters, **kwargs ) -======= -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] ->>>>>>> 331f997c (updating to the latest vendored sdk) class Operations(object): """Operations operations. @@ -90,7 +72,6 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace def list( self, @@ -103,18 +84,6 @@ def list( cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ResourceProviderOperationList] -======= - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ResourceProviderOperationList"] - """List all the available operations the KubernetesConfiguration resource provider supports. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.ResourceProviderOperationList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -122,7 +91,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -144,32 +112,6 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) -======= - api_version = "2021-03-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -182,21 +124,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/operations/_source_control_configurations_operations.py index 131369370f8..a36d0e745c0 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/operations/_source_control_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_03_01/operations/_source_control_configurations_operations.py @@ -5,18 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -======= -from typing import TYPE_CHECKING ->>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest @@ -203,21 +198,6 @@ def build_list_request( headers=header_parameters, **kwargs ) -======= -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] ->>>>>>> 331f997c (updating to the latest vendored sdk) class SourceControlConfigurationsOperations(object): """SourceControlConfigurationsOperations operations. @@ -241,7 +221,6 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace def get( self, @@ -252,18 +231,6 @@ def get( source_control_configuration_name: str, **kwargs: Any ) -> "_models.SourceControlConfiguration": -======= - def get( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - source_control_configuration_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.SourceControlConfiguration" ->>>>>>> 331f997c (updating to the latest vendored sdk) """Gets details of the Source Control Configuration. :param resource_group_name: The name of the resource group. @@ -273,12 +240,8 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. @@ -293,7 +256,6 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -308,42 +270,12 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) @@ -352,7 +284,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -368,21 +299,6 @@ def create_or_update( source_control_configuration: "_models.SourceControlConfiguration", **kwargs: Any ) -> "_models.SourceControlConfiguration": -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - - def create_or_update( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - source_control_configuration_name, # type: str - source_control_configuration, # type: "_models.SourceControlConfiguration" - **kwargs # type: Any - ): - # type: (...) -> "_models.SourceControlConfiguration" ->>>>>>> 331f997c (updating to the latest vendored sdk) """Create a new Kubernetes Source Control Configuration. :param resource_group_name: The name of the resource group. @@ -392,23 +308,15 @@ def create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. -<<<<<<< HEAD :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SourceControlConfiguration -======= - :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SourceControlConfiguration ->>>>>>> 331f997c (updating to the latest vendored sdk) :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SourceControlConfiguration @@ -419,7 +327,6 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -439,47 +346,12 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -492,7 +364,6 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -506,26 +377,11 @@ def _delete_initial( source_control_configuration_name: str, **kwargs: Any ) -> None: -======= - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - source_control_configuration_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_delete_request_initial( @@ -540,50 +396,18 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore -<<<<<<< HEAD @distributed_trace def begin_delete( @@ -595,18 +419,6 @@ def begin_delete( source_control_configuration_name: str, **kwargs: Any ) -> LROPoller[None]: -======= - def begin_delete( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - source_control_configuration_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] ->>>>>>> 331f997c (updating to the latest vendored sdk) """This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from the source repo. @@ -617,19 +429,14 @@ def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. -<<<<<<< HEAD :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -641,17 +448,6 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] -======= - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -668,33 +464,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) -<<<<<<< HEAD kwargs.pop('error_map', None) -======= - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) ->>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) -<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -706,7 +483,6 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -719,19 +495,6 @@ def list( cluster_name: str, **kwargs: Any ) -> Iterable["_models.SourceControlConfigurationList"]: -======= - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SourceControlConfigurationList"] ->>>>>>> 331f997c (updating to the latest vendored sdk) """List all Source Control Configurations. :param resource_group_name: The name of the resource group. @@ -741,7 +504,6 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -751,14 +513,6 @@ def list( cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SourceControlConfigurationList] -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.Enum1 - :param cluster_name: The name of the kubernetes cluster. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SourceControlConfigurationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_03_01.models.SourceControlConfigurationList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfigurationList"] @@ -766,7 +520,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -798,40 +551,6 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("SourceControlConfigurationList", pipeline_response) -======= - api_version = "2021-03-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('SourceControlConfigurationList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -844,21 +563,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/__init__.py index fc12f19c5a1..e9096303633 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/__init__.py @@ -12,15 +12,7 @@ __version__ = VERSION __all__ = ['SourceControlConfigurationClient'] -<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() -======= -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/_configuration.py index c763d92ac9d..e0d799c1310 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/_configuration.py @@ -6,29 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy -======= -from typing import TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy ->>>>>>> 331f997c (updating to the latest vendored sdk) from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports -<<<<<<< HEAD -======= - from typing import Any - ->>>>>>> 331f997c (updating to the latest vendored sdk) from azure.core.credentials import TokenCredential @@ -46,27 +33,15 @@ class SourceControlConfigurationClientConfiguration(Configuration): def __init__( self, -<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, **kwargs: Any ) -> None: super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) -======= - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None ->>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") -<<<<<<< HEAD -======= - super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -90,8 +65,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: -<<<<<<< HEAD self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) -======= - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/_source_control_configuration_client.py index f3e5be5d38e..caa563f1320 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/_source_control_configuration_client.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from copy import deepcopy from typing import Any, Optional, TYPE_CHECKING @@ -49,91 +48,28 @@ class SourceControlConfigurationClient: :ivar operations: Operations operations :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.operations.Operations -======= -from typing import TYPE_CHECKING - -from azure.mgmt.core import ARMPipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - 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): - """KubernetesConfiguration Client. - - :ivar extensions: ExtensionsOperations operations - :vartype extensions: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.operations.ExtensionsOperations - :ivar operation_status: OperationStatusOperations operations - :vartype operation_status: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.operations.OperationStatusOperations - :ivar cluster_extension_type: ClusterExtensionTypeOperations operations - :vartype cluster_extension_type: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.operations.ClusterExtensionTypeOperations - :ivar cluster_extension_types: ClusterExtensionTypesOperations operations - :vartype cluster_extension_types: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.operations.ClusterExtensionTypesOperations - :ivar extension_type_versions: ExtensionTypeVersionsOperations operations - :vartype extension_type_versions: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.operations.ExtensionTypeVersionsOperations - :ivar location_extension_types: LocationExtensionTypesOperations operations - :vartype location_extension_types: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.operations.LocationExtensionTypesOperations - :ivar source_control_configurations: SourceControlConfigurationsOperations operations - :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.operations.SourceControlConfigurationsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.operations.Operations ->>>>>>> 331f997c (updating to the latest vendored sdk) :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str -<<<<<<< HEAD :param base_url: Service URL. Default value is 'https://management.azure.com'. :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. -======= - :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. ->>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, -<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) -======= - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) -<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -171,45 +107,6 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) -======= - 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 ->>>>>>> 331f997c (updating to the latest vendored sdk) def close(self): # type: () -> None diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/__init__.py index 5951024da8e..5f583276b4e 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/__init__.py @@ -8,11 +8,8 @@ from ._source_control_configuration_client import SourceControlConfigurationClient __all__ = ['SourceControlConfigurationClient'] -<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/_configuration.py index ab380ceff6e..d457ecaa974 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/_configuration.py @@ -10,11 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -<<<<<<< HEAD from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy -======= -from azure.mgmt.core.policies import ARMHttpLoggingPolicy ->>>>>>> 331f997c (updating to the latest vendored sdk) from .._version import VERSION @@ -41,18 +37,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: -<<<<<<< HEAD super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") -<<<<<<< HEAD -======= - super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -75,8 +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: -<<<<<<< HEAD self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) -======= - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/_source_control_configuration_client.py index 2891adbddeb..a2fbc1fdda5 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/_source_control_configuration_client.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from copy import deepcopy from typing import Any, Awaitable, Optional, TYPE_CHECKING @@ -18,19 +17,10 @@ from ._configuration import SourceControlConfigurationClientConfiguration from .operations import ClusterExtensionTypeOperations, ClusterExtensionTypesOperations, ExtensionTypeVersionsOperations, ExtensionsOperations, LocationExtensionTypesOperations, OperationStatusOperations, Operations, SourceControlConfigurationsOperations -======= -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 - ->>>>>>> 331f997c (updating to the latest vendored sdk) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -<<<<<<< HEAD class SourceControlConfigurationClient: """KubernetesConfiguration Client. @@ -58,76 +48,28 @@ class SourceControlConfigurationClient: :ivar operations: Operations operations :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.aio.operations.Operations -======= -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): - """KubernetesConfiguration Client. - - :ivar extensions: ExtensionsOperations operations - :vartype extensions: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.aio.operations.ExtensionsOperations - :ivar operation_status: OperationStatusOperations operations - :vartype operation_status: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.aio.operations.OperationStatusOperations - :ivar cluster_extension_type: ClusterExtensionTypeOperations operations - :vartype cluster_extension_type: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.aio.operations.ClusterExtensionTypeOperations - :ivar cluster_extension_types: ClusterExtensionTypesOperations operations - :vartype cluster_extension_types: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.aio.operations.ClusterExtensionTypesOperations - :ivar extension_type_versions: ExtensionTypeVersionsOperations operations - :vartype extension_type_versions: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.aio.operations.ExtensionTypeVersionsOperations - :ivar location_extension_types: LocationExtensionTypesOperations operations - :vartype location_extension_types: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.aio.operations.LocationExtensionTypesOperations - :ivar source_control_configurations: SourceControlConfigurationsOperations operations - :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.aio.operations.SourceControlConfigurationsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.aio.operations.Operations ->>>>>>> 331f997c (updating to the latest vendored sdk) :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str -<<<<<<< HEAD :param base_url: Service URL. Default value is 'https://management.azure.com'. :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. -======= - :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. ->>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, -<<<<<<< HEAD base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) -======= - base_url: Optional[str] = None, - **kwargs: Any - ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) -<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -165,44 +107,6 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) -======= - 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 ->>>>>>> 331f997c (updating to the latest vendored sdk) async def close(self) -> None: await self._client.close() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_cluster_extension_type_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_cluster_extension_type_operations.py index 224059db330..c77d6b31997 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_cluster_extension_type_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_cluster_extension_type_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._cluster_extension_type_operations import build_get_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def get( self, resource_group_name: str, @@ -73,36 +78,26 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterType': self._serialize.url("cluster_type", cluster_type, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionTypeName': self._serialize.url("extension_type_name", extension_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_type=cluster_type, + cluster_name=cluster_name, + extension_type_name=extension_type_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExtensionType', pipeline_response) @@ -111,4 +106,6 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterType}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{extensionTypeName}'} # type: ignore + diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_cluster_extension_types_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_cluster_extension_types_operations.py index b0eaf6af2f6..b99f307b6ad 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_cluster_extension_types_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_cluster_extension_types_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._cluster_extension_types_operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -59,7 +65,8 @@ def list( :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionTypeList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionTypeList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionTypeList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionTypeList"] @@ -67,37 +74,35 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_name=cluster_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_name=cluster_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ExtensionTypeList', pipeline_response) + deserialized = self._deserialize("ExtensionTypeList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -110,12 +115,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_extension_type_versions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_extension_type_versions_operations.py index bd9f2c220fc..0fd76dd062a 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_extension_type_versions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_extension_type_versions_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._extension_type_versions_operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, location: str, @@ -54,8 +60,10 @@ def list( :param extension_type_name: Extension type name. :type extension_type_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ExtensionVersionList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionVersionList] + :return: An iterator like instance of either ExtensionVersionList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionVersionList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionVersionList"] @@ -63,36 +71,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'location': self._serialize.url("location", location, 'str'), - 'extensionTypeName': self._serialize.url("extension_type_name", extension_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + location=location, + extension_type_name=extension_type_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + location=location, + extension_type_name=extension_type_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ExtensionVersionList', pipeline_response) + deserialized = self._deserialize("ExtensionVersionList", pipeline_response) list_of_elem = deserialized.versions if cls: list_of_elem = cls(list_of_elem) @@ -105,12 +110,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_extensions_operations.py index c7347034d3d..65591042bb2 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_extensions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_extensions_operations.py @@ -5,36 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async -======= -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod ->>>>>>> 331f997c (updating to the latest vendored sdk) from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -<<<<<<< HEAD from ..._vendor import _convert_request from ...operations._extensions_operations import build_create_request_initial, build_delete_request_initial, build_get_request, build_list_request -======= - ->>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,7 +63,6 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -95,48 +82,12 @@ async def _create_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-05-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(extension, 'Extension') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) if response.status_code == 200: deserialized = self._deserialize('Extension', pipeline_response) @@ -148,16 +99,11 @@ async def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @distributed_trace_async -======= - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_create( self, resource_group_name: str, @@ -177,12 +123,8 @@ async def begin_create( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -191,7 +133,6 @@ async def begin_create( :type extension: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Extension :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. -<<<<<<< HEAD :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -206,17 +147,6 @@ async def begin_create( """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] -======= - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Extension or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] lro_delay = kwargs.pop( 'polling_interval', @@ -231,7 +161,6 @@ async def begin_create( cluster_name=cluster_name, extension_name=extension_name, extension=extension, -<<<<<<< HEAD content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -241,37 +170,12 @@ async def begin_create( def get_long_running_output(pipeline_response): response = pipeline_response.http_response deserialized = self._deserialize('Extension', pipeline_response) -======= - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('Extension', pipeline_response) - ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -283,15 +187,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @distributed_trace_async -======= - begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -310,12 +209,8 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -330,7 +225,6 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -345,42 +239,12 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-05-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Extension', pipeline_response) @@ -389,15 +253,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) async def _delete_initial( self, resource_group_name: str, @@ -413,7 +272,6 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_delete_request_initial( @@ -429,56 +287,20 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-05-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if force_delete is not None: - query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore -<<<<<<< HEAD @distributed_trace_async -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_delete( self, resource_group_name: str, @@ -499,12 +321,8 @@ async def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -514,7 +332,6 @@ async def begin_delete( :type force_delete: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. -<<<<<<< HEAD :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -526,17 +343,6 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] -======= - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -554,33 +360,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) -<<<<<<< HEAD kwargs.pop('error_map', None) -======= - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) ->>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) -<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -592,15 +379,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @distributed_trace -======= - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -618,22 +400,14 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionsList or the result of cls(response) -<<<<<<< HEAD :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionsList] -======= - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionsList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionsList"] @@ -641,7 +415,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -673,40 +446,6 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionsList", pipeline_response) -======= - api_version = "2021-05-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ExtensionsList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -719,21 +458,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_location_extension_types_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_location_extension_types_operations.py index f435cdfdcb5..024729f2f0f 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_location_extension_types_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_location_extension_types_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._location_extension_types_operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, location: str, @@ -52,7 +58,8 @@ def list( :type location: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionTypeList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionTypeList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionTypeList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionTypeList"] @@ -60,35 +67,31 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + location=location, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + location=location, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ExtensionTypeList', pipeline_response) + deserialized = self._deserialize("ExtensionTypeList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -101,12 +104,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_operation_status_operations.py index 88cd876c5f9..2d99d5e6b2f 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_operation_status_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_operation_status_operations.py @@ -5,17 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -25,13 +21,6 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operation_status_operations import build_get_request, build_list_request -======= -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - ->>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -57,10 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -78,22 +64,14 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationStatusList or the result of cls(response) -<<<<<<< HEAD :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.OperationStatusList] -======= - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.OperationStatusList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusList"] @@ -101,7 +79,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -133,40 +110,6 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("OperationStatusList", pipeline_response) -======= - api_version = "2021-05-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationStatusList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -179,30 +122,19 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/operations'} # type: ignore -<<<<<<< HEAD @distributed_trace_async -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -222,12 +154,8 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -244,7 +172,6 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -260,43 +187,12 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-05-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OperationStatusResult', pipeline_response) @@ -305,10 +201,6 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_operations.py index 66240d4806d..d62dc62020b 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_operations.py @@ -5,17 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -25,13 +21,6 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operations import build_list_request -======= -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - ->>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -57,10 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, **kwargs: Any @@ -68,15 +54,10 @@ def list( """List all the available operations the KubernetesConfiguration resource provider supports. :keyword callable cls: A custom type or function that will be passed the direct response -<<<<<<< HEAD :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ResourceProviderOperationList] -======= - :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ResourceProviderOperationList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -84,7 +65,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -106,32 +86,6 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) -======= - api_version = "2021-05-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -144,21 +98,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_source_control_configurations_operations.py index 8b33eb991ab..d63c27542d2 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_source_control_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/aio/operations/_source_control_configurations_operations.py @@ -5,36 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async -======= -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod ->>>>>>> 331f997c (updating to the latest vendored sdk) from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -<<<<<<< HEAD from ..._vendor import _convert_request from ...operations._source_control_configurations_operations import build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request -======= - ->>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -60,10 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace_async -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -82,24 +67,16 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) -<<<<<<< HEAD :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration -======= - :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -107,7 +84,6 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -122,42 +98,12 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-05-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) @@ -166,16 +112,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @distributed_trace_async -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) async def create_or_update( self, resource_group_name: str, @@ -195,30 +136,19 @@ async def create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. -<<<<<<< HEAD :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration -======= - :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SourceControlConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -226,7 +156,6 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -246,47 +175,12 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-05-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -299,15 +193,10 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore -======= - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) async def _delete_initial( self, resource_group_name: str, @@ -322,7 +211,6 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_delete_request_initial( @@ -337,54 +225,20 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-05-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore -<<<<<<< HEAD @distributed_trace_async -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_delete( self, resource_group_name: str, @@ -404,19 +258,14 @@ async def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. -<<<<<<< HEAD :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -428,17 +277,6 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] -======= - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -455,33 +293,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) -<<<<<<< HEAD kwargs.pop('error_map', None) -======= - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) ->>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) -<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -493,15 +312,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @distributed_trace -======= - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -519,7 +333,6 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -529,14 +342,6 @@ def list( cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfigurationList] -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 - :param cluster_name: The name of the kubernetes cluster. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SourceControlConfigurationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfigurationList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfigurationList"] @@ -544,7 +349,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -576,40 +380,6 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("SourceControlConfigurationList", pipeline_response) -======= - api_version = "2021-05-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('SourceControlConfigurationList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -622,21 +392,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/__init__.py index ecffc1771f6..2b481eea8c9 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/__init__.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from ._models_py3 import ClusterScopeSettings from ._models_py3 import ComplianceStatus from ._models_py3 import ErrorAdditionalInfo @@ -36,66 +35,6 @@ from ._models_py3 import SupportedScopes from ._models_py3 import SystemData -======= -try: - from ._models_py3 import ClusterScopeSettings - from ._models_py3 import ComplianceStatus - from ._models_py3 import ErrorAdditionalInfo - from ._models_py3 import ErrorDetail - from ._models_py3 import ErrorResponse - from ._models_py3 import Extension - from ._models_py3 import ExtensionStatus - from ._models_py3 import ExtensionType - from ._models_py3 import ExtensionTypeList - from ._models_py3 import ExtensionVersionList - from ._models_py3 import ExtensionVersionListVersionsItem - from ._models_py3 import ExtensionsList - from ._models_py3 import HelmOperatorProperties - from ._models_py3 import Identity - from ._models_py3 import OperationStatusList - from ._models_py3 import OperationStatusResult - from ._models_py3 import ProxyResource - from ._models_py3 import Resource - from ._models_py3 import ResourceProviderOperation - from ._models_py3 import ResourceProviderOperationDisplay - from ._models_py3 import ResourceProviderOperationList - from ._models_py3 import Scope - from ._models_py3 import ScopeCluster - from ._models_py3 import ScopeNamespace - from ._models_py3 import SourceControlConfiguration - from ._models_py3 import SourceControlConfigurationList - from ._models_py3 import SupportedScopes - from ._models_py3 import SystemData -except (SyntaxError, ImportError): - from ._models import ClusterScopeSettings # type: ignore - from ._models import ComplianceStatus # type: ignore - from ._models import ErrorAdditionalInfo # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import Extension # type: ignore - from ._models import ExtensionStatus # type: ignore - from ._models import ExtensionType # type: ignore - from ._models import ExtensionTypeList # type: ignore - from ._models import ExtensionVersionList # type: ignore - from ._models import ExtensionVersionListVersionsItem # type: ignore - from ._models import ExtensionsList # type: ignore - from ._models import HelmOperatorProperties # type: ignore - from ._models import Identity # type: ignore - from ._models import OperationStatusList # type: ignore - from ._models import OperationStatusResult # type: ignore - from ._models import ProxyResource # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceProviderOperation # type: ignore - from ._models import ResourceProviderOperationDisplay # type: ignore - from ._models import ResourceProviderOperationList # type: ignore - from ._models import Scope # type: ignore - from ._models import ScopeCluster # type: ignore - from ._models import ScopeNamespace # type: ignore - from ._models import SourceControlConfiguration # type: ignore - from ._models import SourceControlConfigurationList # type: ignore - from ._models import SupportedScopes # type: ignore - from ._models import SystemData # type: ignore ->>>>>>> 331f997c (updating to the latest vendored sdk) from ._source_control_configuration_client_enums import ( ClusterTypes, diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models.py deleted file mode 100644 index 8755200562d..00000000000 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models.py +++ /dev/null @@ -1,1056 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProxyResource, self).__init__(**kwargs) - - -class ClusterScopeSettings(ProxyResource): - """Extension scope settings. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :param allow_multiple_instances: Describes if multiple instances of the extension are allowed. - :type allow_multiple_instances: bool - :param default_release_namespace: Default extension release namespace. - :type default_release_namespace: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'allow_multiple_instances': {'key': 'properties.allowMultipleInstances', 'type': 'bool'}, - 'default_release_namespace': {'key': 'properties.defaultReleaseNamespace', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ClusterScopeSettings, self).__init__(**kwargs) - self.allow_multiple_instances = kwargs.get('allow_multiple_instances', None) - self.default_release_namespace = kwargs.get('default_release_namespace', None) - - -class ComplianceStatus(msrest.serialization.Model): - """Compliance Status details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar compliance_state: The compliance state of the configuration. Possible values include: - "Pending", "Compliant", "Noncompliant", "Installed", "Failed". - :vartype compliance_state: str or - ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ComplianceStateType - :param last_config_applied: Datetime the configuration was last applied. - :type last_config_applied: ~datetime.datetime - :param message: Message from when the configuration was applied. - :type message: str - :param message_level: Level of the message. Possible values include: "Error", "Warning", - "Information". - :type message_level: str or - ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.MessageLevelType - """ - - _validation = { - 'compliance_state': {'readonly': True}, - } - - _attribute_map = { - 'compliance_state': {'key': 'complianceState', 'type': 'str'}, - 'last_config_applied': {'key': 'lastConfigApplied', 'type': 'iso-8601'}, - 'message': {'key': 'message', 'type': 'str'}, - 'message_level': {'key': 'messageLevel', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComplianceStatus, self).__init__(**kwargs) - self.compliance_state = None - self.last_config_applied = kwargs.get('last_config_applied', None) - self.message = kwargs.get('message', None) - self.message_level = kwargs.get('message_level', None) - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: - list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: - list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :param error: The error object. - :type error: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class Extension(ProxyResource): - """The Extension object. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :param identity: Identity of the Extension resource. - :type identity: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Identity - :ivar system_data: Top level metadata - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SystemData - :param extension_type: Type of the Extension, of which this resource is an instance of. It - must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the - Extension publisher. - :type extension_type: str - :param auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade - of minor version, or not. - :type auto_upgrade_minor_version: bool - :param release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. - Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. - :type release_train: str - :param version: Version of the extension for this extension, if it is 'pinned' to a specific - version. autoUpgradeMinorVersion must be 'false'. - :type version: str - :param scope: Scope at which the extension is installed. - :type scope: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Scope - :param configuration_settings: Configuration settings, as name-value pairs for configuring this - extension. - :type configuration_settings: dict[str, str] - :param configuration_protected_settings: Configuration settings that are sensitive, as - name-value pairs for configuring this extension. - :type configuration_protected_settings: dict[str, str] - :ivar provisioning_state: Status of installation of this extension. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ProvisioningState - :param statuses: Status from this extension. - :type statuses: - list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionStatus] - :ivar error_info: Error information from the Agent - e.g. errors during installation. - :vartype error_info: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ErrorDetail - :ivar custom_location_settings: Custom Location settings properties. - :vartype custom_location_settings: dict[str, str] - :ivar package_uri: Uri of the Helm package. - :vartype package_uri: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'error_info': {'readonly': True}, - 'custom_location_settings': {'readonly': True}, - 'package_uri': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'extension_type': {'key': 'properties.extensionType', 'type': 'str'}, - 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, - 'release_train': {'key': 'properties.releaseTrain', 'type': 'str'}, - 'version': {'key': 'properties.version', 'type': 'str'}, - 'scope': {'key': 'properties.scope', 'type': 'Scope'}, - 'configuration_settings': {'key': 'properties.configurationSettings', 'type': '{str}'}, - 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'statuses': {'key': 'properties.statuses', 'type': '[ExtensionStatus]'}, - 'error_info': {'key': 'properties.errorInfo', 'type': 'ErrorDetail'}, - 'custom_location_settings': {'key': 'properties.customLocationSettings', 'type': '{str}'}, - 'package_uri': {'key': 'properties.packageUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Extension, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.system_data = None - self.extension_type = kwargs.get('extension_type', None) - self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', True) - self.release_train = kwargs.get('release_train', "Stable") - self.version = kwargs.get('version', None) - self.scope = kwargs.get('scope', None) - self.configuration_settings = kwargs.get('configuration_settings', None) - self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) - self.provisioning_state = None - self.statuses = kwargs.get('statuses', None) - self.error_info = None - self.custom_location_settings = None - self.package_uri = None - - -class ExtensionsList(msrest.serialization.Model): - """Result of the request to list Extensions. It contains a list of Extension objects and a URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Extensions within a Kubernetes cluster. - :vartype value: list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Extension] - :ivar next_link: URL to get the next set of extension objects, if any. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Extension]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtensionsList, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ExtensionStatus(msrest.serialization.Model): - """Status from the extension. - - :param code: Status code provided by the Extension. - :type code: str - :param display_status: Short description of status of the extension. - :type display_status: str - :param level: Level of the status. Possible values include: "Error", "Warning", "Information". - Default value: "Information". - :type level: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.LevelType - :param message: Detailed message of the status from the Extension. - :type message: str - :param time: DateLiteral (per ISO8601) noting the time of installation status. - :type time: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'display_status': {'key': 'displayStatus', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'time': {'key': 'time', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtensionStatus, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.display_status = kwargs.get('display_status', None) - self.level = kwargs.get('level', "Information") - self.message = kwargs.get('message', None) - self.time = kwargs.get('time', None) - - -class ExtensionType(msrest.serialization.Model): - """Represents an Extension Type. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SystemData - :ivar release_trains: Extension release train: preview or stable. - :vartype release_trains: list[str] - :ivar cluster_types: Cluster types. Possible values include: "connectedClusters", - "managedClusters". - :vartype cluster_types: str or - ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ClusterTypes - :ivar supported_scopes: Extension scopes. - :vartype supported_scopes: - ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SupportedScopes - """ - - _validation = { - 'system_data': {'readonly': True}, - 'release_trains': {'readonly': True}, - 'cluster_types': {'readonly': True}, - 'supported_scopes': {'readonly': True}, - } - - _attribute_map = { - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'release_trains': {'key': 'properties.releaseTrains', 'type': '[str]'}, - 'cluster_types': {'key': 'properties.clusterTypes', 'type': '[str]'}, - 'supported_scopes': {'key': 'properties.supportedScopes', 'type': 'SupportedScopes'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtensionType, self).__init__(**kwargs) - self.system_data = None - self.release_trains = None - self.cluster_types = None - self.supported_scopes = None - - -class ExtensionTypeList(msrest.serialization.Model): - """List Extension Types. - - :param value: The list of Extension Types. - :type value: list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionType] - :param next_link: The link to fetch the next page of Extension Types. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ExtensionType]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtensionTypeList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class ExtensionVersionList(msrest.serialization.Model): - """List versions for an Extension. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param versions: Versions available for this Extension Type. - :type versions: - list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionVersionListVersionsItem] - :param next_link: The link to fetch the next page of Extension Types. - :type next_link: str - :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SystemData - """ - - _validation = { - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'versions': {'key': 'versions', 'type': '[ExtensionVersionListVersionsItem]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtensionVersionList, self).__init__(**kwargs) - self.versions = kwargs.get('versions', None) - self.next_link = kwargs.get('next_link', None) - self.system_data = None - - -class ExtensionVersionListVersionsItem(msrest.serialization.Model): - """ExtensionVersionListVersionsItem. - - :param release_train: The release train for this Extension Type. - :type release_train: str - :param versions: Versions available for this Extension Type and release train. - :type versions: list[str] - """ - - _attribute_map = { - 'release_train': {'key': 'releaseTrain', 'type': 'str'}, - 'versions': {'key': 'versions', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtensionVersionListVersionsItem, self).__init__(**kwargs) - self.release_train = kwargs.get('release_train', None) - self.versions = kwargs.get('versions', None) - - -class HelmOperatorProperties(msrest.serialization.Model): - """Properties for Helm operator. - - :param chart_version: Version of the operator Helm chart. - :type chart_version: str - :param chart_values: Values override for the operator Helm chart. - :type chart_values: str - """ - - _attribute_map = { - 'chart_version': {'key': 'chartVersion', 'type': 'str'}, - 'chart_values': {'key': 'chartValues', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HelmOperatorProperties, self).__init__(**kwargs) - self.chart_version = kwargs.get('chart_version', None) - self.chart_values = kwargs.get('chart_values', None) - - -class Identity(msrest.serialization.Model): - """Identity for the resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :param type: The identity type. The only acceptable values to pass in are None and - "SystemAssigned". The default value is None. - :type type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - - -class OperationStatusList(msrest.serialization.Model): - """The async operations in progress, in the cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of async operations in progress, in the cluster. - :vartype value: - list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.OperationStatusResult] - :ivar next_link: URL to get the next set of Operation Result objects, if any. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationStatusResult]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationStatusList, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class OperationStatusResult(msrest.serialization.Model): - """The current status of an async operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param id: Fully qualified ID for the async operation. - :type id: str - :param name: Name of the async operation. - :type name: str - :param status: Required. Operation status. - :type status: str - :param properties: Additional information, if available. - :type properties: dict[str, str] - :ivar error: If present, details of the operation error. - :vartype error: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ErrorDetail - """ - - _validation = { - 'status': {'required': True}, - 'error': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationStatusResult, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.status = kwargs['status'] - self.properties = kwargs.get('properties', None) - self.error = None - - -class ResourceProviderOperation(msrest.serialization.Model): - """Supported operation of this resource provider. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param name: Operation name, in format of {provider}/{resource}/{operation}. - :type name: str - :param display: Display metadata associated with the operation. - :type display: - ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ResourceProviderOperationDisplay - :param origin: The intended executor of the operation;governs the display of the operation in - the RBAC UX and the audit logs UX. - :type origin: str - :ivar is_data_action: The flag that indicates whether the operation applies to data plane. - :vartype is_data_action: bool - """ - - _validation = { - 'is_data_action': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderOperation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.origin = kwargs.get('origin', None) - self.is_data_action = None - - -class ResourceProviderOperationDisplay(msrest.serialization.Model): - """Display metadata associated with the operation. - - :param provider: Resource provider: Microsoft KubernetesConfiguration. - :type provider: str - :param resource: Resource on which the operation is performed. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of this operation. - :type description: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderOperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) - - -class ResourceProviderOperationList(msrest.serialization.Model): - """Result of the request to list operations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of operations supported by this resource provider. - :type value: - list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ResourceProviderOperation] - :ivar next_link: URL to the next set of results, if any. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderOperationList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class Scope(msrest.serialization.Model): - """Scope of the extension. It can be either Cluster or Namespace; but not both. - - :param cluster: Specifies that the scope of the extension is Cluster. - :type cluster: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ScopeCluster - :param namespace: Specifies that the scope of the extension is Namespace. - :type namespace: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ScopeNamespace - """ - - _attribute_map = { - 'cluster': {'key': 'cluster', 'type': 'ScopeCluster'}, - 'namespace': {'key': 'namespace', 'type': 'ScopeNamespace'}, - } - - def __init__( - self, - **kwargs - ): - super(Scope, self).__init__(**kwargs) - self.cluster = kwargs.get('cluster', None) - self.namespace = kwargs.get('namespace', None) - - -class ScopeCluster(msrest.serialization.Model): - """Specifies that the scope of the extension is Cluster. - - :param release_namespace: Namespace where the extension Release must be placed, for a Cluster - scoped extension. If this namespace does not exist, it will be created. - :type release_namespace: str - """ - - _attribute_map = { - 'release_namespace': {'key': 'releaseNamespace', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ScopeCluster, self).__init__(**kwargs) - self.release_namespace = kwargs.get('release_namespace', None) - - -class ScopeNamespace(msrest.serialization.Model): - """Specifies that the scope of the extension is Namespace. - - :param target_namespace: Namespace where the extension will be created for an Namespace scoped - extension. If this namespace does not exist, it will be created. - :type target_namespace: str - """ - - _attribute_map = { - 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ScopeNamespace, self).__init__(**kwargs) - self.target_namespace = kwargs.get('target_namespace', None) - - -class SourceControlConfiguration(ProxyResource): - """The SourceControl Configuration object returned in Get & Put response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Top level metadata - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SystemData - :param repository_url: Url of the SourceControl Repository. - :type repository_url: str - :param operator_namespace: The namespace to which this operator is installed to. Maximum of 253 - lower case alphanumeric characters, hyphen and period only. - :type operator_namespace: str - :param operator_instance_name: Instance name of the operator - identifying the specific - configuration. - :type operator_instance_name: str - :param operator_type: Type of the operator. Possible values include: "Flux". - :type operator_type: str or - ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.OperatorType - :param operator_params: Any Parameters for the Operator instance in string format. - :type operator_params: str - :param configuration_protected_settings: Name-value pairs of protected configuration settings - for the configuration. - :type configuration_protected_settings: dict[str, str] - :param operator_scope: Scope at which the operator will be installed. Possible values include: - "cluster", "namespace". Default value: "cluster". - :type operator_scope: str or - ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.OperatorScopeType - :ivar repository_public_key: Public Key associated with this SourceControl configuration - (either generated within the cluster or provided by the user). - :vartype repository_public_key: str - :param ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys - required to access private Git instances. - :type ssh_known_hosts_contents: str - :param enable_helm_operator: Option to enable Helm Operator for this git configuration. - :type enable_helm_operator: bool - :param helm_operator_properties: Properties for Helm operator. - :type helm_operator_properties: - ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.HelmOperatorProperties - :ivar provisioning_state: The provisioning state of the resource provider. Possible values - include: "Accepted", "Deleting", "Running", "Succeeded", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ProvisioningStateType - :ivar compliance_status: Compliance Status of the Configuration. - :vartype compliance_status: - ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ComplianceStatus - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'repository_public_key': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'compliance_status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, - 'operator_namespace': {'key': 'properties.operatorNamespace', 'type': 'str'}, - 'operator_instance_name': {'key': 'properties.operatorInstanceName', 'type': 'str'}, - 'operator_type': {'key': 'properties.operatorType', 'type': 'str'}, - 'operator_params': {'key': 'properties.operatorParams', 'type': 'str'}, - 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, - 'operator_scope': {'key': 'properties.operatorScope', 'type': 'str'}, - 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, - 'ssh_known_hosts_contents': {'key': 'properties.sshKnownHostsContents', 'type': 'str'}, - 'enable_helm_operator': {'key': 'properties.enableHelmOperator', 'type': 'bool'}, - 'helm_operator_properties': {'key': 'properties.helmOperatorProperties', 'type': 'HelmOperatorProperties'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'compliance_status': {'key': 'properties.complianceStatus', 'type': 'ComplianceStatus'}, - } - - def __init__( - self, - **kwargs - ): - super(SourceControlConfiguration, self).__init__(**kwargs) - self.system_data = None - self.repository_url = kwargs.get('repository_url', None) - self.operator_namespace = kwargs.get('operator_namespace', "default") - self.operator_instance_name = kwargs.get('operator_instance_name', None) - self.operator_type = kwargs.get('operator_type', None) - self.operator_params = kwargs.get('operator_params', None) - self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) - self.operator_scope = kwargs.get('operator_scope', "cluster") - self.repository_public_key = None - self.ssh_known_hosts_contents = kwargs.get('ssh_known_hosts_contents', None) - self.enable_helm_operator = kwargs.get('enable_helm_operator', None) - self.helm_operator_properties = kwargs.get('helm_operator_properties', None) - self.provisioning_state = None - self.compliance_status = None - - -class SourceControlConfigurationList(msrest.serialization.Model): - """Result of the request to list Source Control Configurations. It contains a list of SourceControlConfiguration objects and a URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Source Control Configurations within a Kubernetes cluster. - :vartype value: - list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration] - :ivar next_link: URL to get the next set of configuration objects, if any. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[SourceControlConfiguration]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SourceControlConfigurationList, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class SupportedScopes(msrest.serialization.Model): - """Extension scopes. - - :param default_scope: Default extension scopes: cluster or namespace. - :type default_scope: str - :param cluster_scope_settings: Scope settings. - :type cluster_scope_settings: - ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ClusterScopeSettings - """ - - _attribute_map = { - 'default_scope': {'key': 'defaultScope', 'type': 'str'}, - 'cluster_scope_settings': {'key': 'clusterScopeSettings', 'type': 'ClusterScopeSettings'}, - } - - def __init__( - self, - **kwargs - ): - super(SupportedScopes, self).__init__(**kwargs) - self.default_scope = kwargs.get('default_scope', None) - self.cluster_scope_settings = kwargs.get('cluster_scope_settings', None) - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or - ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or - ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.CreatedByType - :param last_modified_at: The timestamp of resource last modification (UTC). - :type last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models_py3.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models_py3.py index f11ed94346c..97597606978 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models_py3.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_models_py3.py @@ -46,11 +46,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -88,11 +85,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ProxyResource, self).__init__(**kwargs) @@ -109,17 +103,10 @@ class ClusterScopeSettings(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str -<<<<<<< HEAD :ivar allow_multiple_instances: Describes if multiple instances of the extension are allowed. :vartype allow_multiple_instances: bool :ivar default_release_namespace: Default extension release namespace. :vartype default_release_namespace: str -======= - :param allow_multiple_instances: Describes if multiple instances of the extension are allowed. - :type allow_multiple_instances: bool - :param default_release_namespace: Default extension release namespace. - :type default_release_namespace: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -143,7 +130,6 @@ def __init__( default_release_namespace: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword allow_multiple_instances: Describes if multiple instances of the extension are allowed. @@ -151,8 +137,6 @@ def __init__( :keyword default_release_namespace: Default extension release namespace. :paramtype default_release_namespace: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ClusterScopeSettings, self).__init__(**kwargs) self.allow_multiple_instances = allow_multiple_instances self.default_release_namespace = default_release_namespace @@ -167,7 +151,6 @@ class ComplianceStatus(msrest.serialization.Model): "Pending", "Compliant", "Noncompliant", "Installed", "Failed". :vartype compliance_state: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ComplianceStateType -<<<<<<< HEAD :ivar last_config_applied: Datetime the configuration was last applied. :vartype last_config_applied: ~datetime.datetime :ivar message: Message from when the configuration was applied. @@ -175,15 +158,6 @@ class ComplianceStatus(msrest.serialization.Model): :ivar message_level: Level of the message. Possible values include: "Error", "Warning", "Information". :vartype message_level: str or -======= - :param last_config_applied: Datetime the configuration was last applied. - :type last_config_applied: ~datetime.datetime - :param message: Message from when the configuration was applied. - :type message: str - :param message_level: Level of the message. Possible values include: "Error", "Warning", - "Information". - :type message_level: str or ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.MessageLevelType """ @@ -206,7 +180,6 @@ def __init__( message_level: Optional[Union[str, "MessageLevelType"]] = None, **kwargs ): -<<<<<<< HEAD """ :keyword last_config_applied: Datetime the configuration was last applied. :paramtype last_config_applied: ~datetime.datetime @@ -217,8 +190,6 @@ def __init__( :paramtype message_level: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.MessageLevelType """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ComplianceStatus, self).__init__(**kwargs) self.compliance_state = None self.last_config_applied = last_config_applied @@ -251,11 +222,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -300,11 +268,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorDetail, self).__init__(**kwargs) self.code = None self.message = None @@ -316,13 +281,8 @@ def __init__( class ErrorResponse(msrest.serialization.Model): """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). -<<<<<<< HEAD :ivar error: The error object. :vartype error: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ErrorDetail -======= - :param error: The error object. - :type error: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ErrorDetail ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -335,13 +295,10 @@ def __init__( error: Optional["ErrorDetail"] = None, **kwargs ): -<<<<<<< HEAD """ :keyword error: The error object. :paramtype error: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ErrorDetail """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorResponse, self).__init__(**kwargs) self.error = error @@ -359,7 +316,6 @@ class Extension(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str -<<<<<<< HEAD :ivar identity: Identity of the Extension resource. :vartype identity: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Identity :ivar system_data: Top level metadata @@ -386,45 +342,12 @@ class Extension(ProxyResource): :ivar configuration_protected_settings: Configuration settings that are sensitive, as name-value pairs for configuring this extension. :vartype configuration_protected_settings: dict[str, str] -======= - :param identity: Identity of the Extension resource. - :type identity: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Identity - :ivar system_data: Top level metadata - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SystemData - :param extension_type: Type of the Extension, of which this resource is an instance of. It - must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the - Extension publisher. - :type extension_type: str - :param auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade - of minor version, or not. - :type auto_upgrade_minor_version: bool - :param release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. - Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. - :type release_train: str - :param version: Version of the extension for this extension, if it is 'pinned' to a specific - version. autoUpgradeMinorVersion must be 'false'. - :type version: str - :param scope: Scope at which the extension is installed. - :type scope: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Scope - :param configuration_settings: Configuration settings, as name-value pairs for configuring this - extension. - :type configuration_settings: dict[str, str] - :param configuration_protected_settings: Configuration settings that are sensitive, as - name-value pairs for configuring this extension. - :type configuration_protected_settings: dict[str, str] ->>>>>>> 331f997c (updating to the latest vendored sdk) :ivar provisioning_state: Status of installation of this extension. Possible values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". :vartype provisioning_state: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ProvisioningState -<<<<<<< HEAD :ivar statuses: Status from this extension. :vartype statuses: -======= - :param statuses: Status from this extension. - :type statuses: ->>>>>>> 331f997c (updating to the latest vendored sdk) list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionStatus] :ivar error_info: Error information from the Agent - e.g. errors during installation. :vartype error_info: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ErrorDetail @@ -479,7 +402,6 @@ def __init__( statuses: Optional[List["ExtensionStatus"]] = None, **kwargs ): -<<<<<<< HEAD """ :keyword identity: Identity of the Extension resource. :paramtype identity: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Identity @@ -508,8 +430,6 @@ def __init__( :paramtype statuses: list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionStatus] """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(Extension, self).__init__(**kwargs) self.identity = identity self.system_data = None @@ -552,11 +472,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionsList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -565,7 +482,6 @@ def __init__( class ExtensionStatus(msrest.serialization.Model): """Status from the extension. -<<<<<<< HEAD :ivar code: Status code provided by the Extension. :vartype code: str :ivar display_status: Short description of status of the extension. @@ -577,19 +493,6 @@ class ExtensionStatus(msrest.serialization.Model): :vartype message: str :ivar time: DateLiteral (per ISO8601) noting the time of installation status. :vartype time: str -======= - :param code: Status code provided by the Extension. - :type code: str - :param display_status: Short description of status of the extension. - :type display_status: str - :param level: Level of the status. Possible values include: "Error", "Warning", "Information". - Default value: "Information". - :type level: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.LevelType - :param message: Detailed message of the status from the Extension. - :type message: str - :param time: DateLiteral (per ISO8601) noting the time of installation status. - :type time: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -610,7 +513,6 @@ def __init__( time: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword code: Status code provided by the Extension. :paramtype code: str @@ -625,8 +527,6 @@ def __init__( :keyword time: DateLiteral (per ISO8601) noting the time of installation status. :paramtype time: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionStatus, self).__init__(**kwargs) self.code = code self.display_status = display_status @@ -663,7 +563,7 @@ class ExtensionType(msrest.serialization.Model): _attribute_map = { 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'release_trains': {'key': 'properties.releaseTrains', 'type': '[str]'}, - 'cluster_types': {'key': 'properties.clusterTypes', 'type': '[str]'}, + 'cluster_types': {'key': 'properties.clusterTypes', 'type': 'str'}, 'supported_scopes': {'key': 'properties.supportedScopes', 'type': 'SupportedScopes'}, } @@ -671,11 +571,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionType, self).__init__(**kwargs) self.system_data = None self.release_trains = None @@ -686,18 +583,11 @@ def __init__( class ExtensionTypeList(msrest.serialization.Model): """List Extension Types. -<<<<<<< HEAD :ivar value: The list of Extension Types. :vartype value: list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionType] :ivar next_link: The link to fetch the next page of Extension Types. :vartype next_link: str -======= - :param value: The list of Extension Types. - :type value: list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionType] - :param next_link: The link to fetch the next page of Extension Types. - :type next_link: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -712,7 +602,6 @@ def __init__( next_link: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword value: The list of Extension Types. :paramtype value: @@ -720,8 +609,6 @@ def __init__( :keyword next_link: The link to fetch the next page of Extension Types. :paramtype next_link: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionTypeList, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -732,19 +619,11 @@ class ExtensionVersionList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. -<<<<<<< HEAD :ivar versions: Versions available for this Extension Type. :vartype versions: list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionVersionListVersionsItem] :ivar next_link: The link to fetch the next page of Extension Types. :vartype next_link: str -======= - :param versions: Versions available for this Extension Type. - :type versions: - list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionVersionListVersionsItem] - :param next_link: The link to fetch the next page of Extension Types. - :type next_link: str ->>>>>>> 331f997c (updating to the latest vendored sdk) :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SystemData """ @@ -766,7 +645,6 @@ def __init__( next_link: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword versions: Versions available for this Extension Type. :paramtype versions: @@ -774,8 +652,6 @@ def __init__( :keyword next_link: The link to fetch the next page of Extension Types. :paramtype next_link: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionVersionList, self).__init__(**kwargs) self.versions = versions self.next_link = next_link @@ -785,17 +661,10 @@ def __init__( class ExtensionVersionListVersionsItem(msrest.serialization.Model): """ExtensionVersionListVersionsItem. -<<<<<<< HEAD :ivar release_train: The release train for this Extension Type. :vartype release_train: str :ivar versions: Versions available for this Extension Type and release train. :vartype versions: list[str] -======= - :param release_train: The release train for this Extension Type. - :type release_train: str - :param versions: Versions available for this Extension Type and release train. - :type versions: list[str] ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -810,15 +679,12 @@ def __init__( versions: Optional[List[str]] = None, **kwargs ): -<<<<<<< HEAD """ :keyword release_train: The release train for this Extension Type. :paramtype release_train: str :keyword versions: Versions available for this Extension Type and release train. :paramtype versions: list[str] """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionVersionListVersionsItem, self).__init__(**kwargs) self.release_train = release_train self.versions = versions @@ -827,17 +693,10 @@ def __init__( class HelmOperatorProperties(msrest.serialization.Model): """Properties for Helm operator. -<<<<<<< HEAD :ivar chart_version: Version of the operator Helm chart. :vartype chart_version: str :ivar chart_values: Values override for the operator Helm chart. :vartype chart_values: str -======= - :param chart_version: Version of the operator Helm chart. - :type chart_version: str - :param chart_values: Values override for the operator Helm chart. - :type chart_values: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -852,15 +711,12 @@ def __init__( chart_values: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword chart_version: Version of the operator Helm chart. :paramtype chart_version: str :keyword chart_values: Values override for the operator Helm chart. :paramtype chart_values: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(HelmOperatorProperties, self).__init__(**kwargs) self.chart_version = chart_version self.chart_values = chart_values @@ -875,15 +731,9 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str -<<<<<<< HEAD :ivar type: The identity type. The only acceptable values to pass in are None and "SystemAssigned". The default value is None. :vartype type: str -======= - :param type: The identity type. The only acceptable values to pass in are None and - "SystemAssigned". The default value is None. - :type type: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -903,14 +753,11 @@ def __init__( type: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword type: The identity type. The only acceptable values to pass in are None and "SystemAssigned". The default value is None. :paramtype type: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(Identity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -943,11 +790,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(OperationStatusList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -960,7 +804,6 @@ class OperationStatusResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. -<<<<<<< HEAD :ivar id: Fully qualified ID for the async operation. :vartype id: str :ivar name: Name of the async operation. @@ -969,16 +812,6 @@ class OperationStatusResult(msrest.serialization.Model): :vartype status: str :ivar properties: Additional information, if available. :vartype properties: dict[str, str] -======= - :param id: Fully qualified ID for the async operation. - :type id: str - :param name: Name of the async operation. - :type name: str - :param status: Required. Operation status. - :type status: str - :param properties: Additional information, if available. - :type properties: dict[str, str] ->>>>>>> 331f997c (updating to the latest vendored sdk) :ivar error: If present, details of the operation error. :vartype error: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ErrorDetail """ @@ -1005,7 +838,6 @@ def __init__( properties: Optional[Dict[str, str]] = None, **kwargs ): -<<<<<<< HEAD """ :keyword id: Fully qualified ID for the async operation. :paramtype id: str @@ -1016,8 +848,6 @@ def __init__( :keyword properties: Additional information, if available. :paramtype properties: dict[str, str] """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(OperationStatusResult, self).__init__(**kwargs) self.id = id self.name = name @@ -1031,7 +861,6 @@ class ResourceProviderOperation(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. -<<<<<<< HEAD :ivar name: Operation name, in format of {provider}/{resource}/{operation}. :vartype name: str :ivar display: Display metadata associated with the operation. @@ -1040,16 +869,6 @@ class ResourceProviderOperation(msrest.serialization.Model): :ivar origin: The intended executor of the operation;governs the display of the operation in the RBAC UX and the audit logs UX. :vartype origin: str -======= - :param name: Operation name, in format of {provider}/{resource}/{operation}. - :type name: str - :param display: Display metadata associated with the operation. - :type display: - ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ResourceProviderOperationDisplay - :param origin: The intended executor of the operation;governs the display of the operation in - the RBAC UX and the audit logs UX. - :type origin: str ->>>>>>> 331f997c (updating to the latest vendored sdk) :ivar is_data_action: The flag that indicates whether the operation applies to data plane. :vartype is_data_action: bool """ @@ -1073,7 +892,6 @@ def __init__( origin: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword name: Operation name, in format of {provider}/{resource}/{operation}. :paramtype name: str @@ -1084,8 +902,6 @@ def __init__( the RBAC UX and the audit logs UX. :paramtype origin: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperation, self).__init__(**kwargs) self.name = name self.display = display @@ -1096,7 +912,6 @@ def __init__( class ResourceProviderOperationDisplay(msrest.serialization.Model): """Display metadata associated with the operation. -<<<<<<< HEAD :ivar provider: Resource provider: Microsoft KubernetesConfiguration. :vartype provider: str :ivar resource: Resource on which the operation is performed. @@ -1105,16 +920,6 @@ class ResourceProviderOperationDisplay(msrest.serialization.Model): :vartype operation: str :ivar description: Description of this operation. :vartype description: str -======= - :param provider: Resource provider: Microsoft KubernetesConfiguration. - :type provider: str - :param resource: Resource on which the operation is performed. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of this operation. - :type description: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1133,7 +938,6 @@ def __init__( description: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword provider: Resource provider: Microsoft KubernetesConfiguration. :paramtype provider: str @@ -1144,8 +948,6 @@ def __init__( :keyword description: Description of this operation. :paramtype description: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperationDisplay, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -1158,13 +960,8 @@ class ResourceProviderOperationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. -<<<<<<< HEAD :ivar value: List of operations supported by this resource provider. :vartype value: -======= - :param value: List of operations supported by this resource provider. - :type value: ->>>>>>> 331f997c (updating to the latest vendored sdk) list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ResourceProviderOperation] :ivar next_link: URL to the next set of results, if any. :vartype next_link: str @@ -1185,14 +982,11 @@ def __init__( value: Optional[List["ResourceProviderOperation"]] = None, **kwargs ): -<<<<<<< HEAD """ :keyword value: List of operations supported by this resource provider. :paramtype value: list[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ResourceProviderOperation] """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperationList, self).__init__(**kwargs) self.value = value self.next_link = None @@ -1201,18 +995,11 @@ def __init__( class Scope(msrest.serialization.Model): """Scope of the extension. It can be either Cluster or Namespace; but not both. -<<<<<<< HEAD :ivar cluster: Specifies that the scope of the extension is Cluster. :vartype cluster: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ScopeCluster :ivar namespace: Specifies that the scope of the extension is Namespace. :vartype namespace: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ScopeNamespace -======= - :param cluster: Specifies that the scope of the extension is Cluster. - :type cluster: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ScopeCluster - :param namespace: Specifies that the scope of the extension is Namespace. - :type namespace: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ScopeNamespace ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1227,7 +1014,6 @@ def __init__( namespace: Optional["ScopeNamespace"] = None, **kwargs ): -<<<<<<< HEAD """ :keyword cluster: Specifies that the scope of the extension is Cluster. :paramtype cluster: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ScopeCluster @@ -1235,8 +1021,6 @@ def __init__( :paramtype namespace: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ScopeNamespace """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(Scope, self).__init__(**kwargs) self.cluster = cluster self.namespace = namespace @@ -1245,15 +1029,9 @@ def __init__( class ScopeCluster(msrest.serialization.Model): """Specifies that the scope of the extension is Cluster. -<<<<<<< HEAD :ivar release_namespace: Namespace where the extension Release must be placed, for a Cluster scoped extension. If this namespace does not exist, it will be created. :vartype release_namespace: str -======= - :param release_namespace: Namespace where the extension Release must be placed, for a Cluster - scoped extension. If this namespace does not exist, it will be created. - :type release_namespace: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1266,14 +1044,11 @@ def __init__( release_namespace: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword release_namespace: Namespace where the extension Release must be placed, for a Cluster scoped extension. If this namespace does not exist, it will be created. :paramtype release_namespace: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ScopeCluster, self).__init__(**kwargs) self.release_namespace = release_namespace @@ -1281,15 +1056,9 @@ def __init__( class ScopeNamespace(msrest.serialization.Model): """Specifies that the scope of the extension is Namespace. -<<<<<<< HEAD :ivar target_namespace: Namespace where the extension will be created for an Namespace scoped extension. If this namespace does not exist, it will be created. :vartype target_namespace: str -======= - :param target_namespace: Namespace where the extension will be created for an Namespace scoped - extension. If this namespace does not exist, it will be created. - :type target_namespace: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1302,14 +1071,11 @@ def __init__( target_namespace: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword target_namespace: Namespace where the extension will be created for an Namespace scoped extension. If this namespace does not exist, it will be created. :paramtype target_namespace: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ScopeNamespace, self).__init__(**kwargs) self.target_namespace = target_namespace @@ -1330,7 +1096,6 @@ class SourceControlConfiguration(ProxyResource): :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SystemData -<<<<<<< HEAD :ivar repository_url: Url of the SourceControl Repository. :vartype repository_url: str :ivar operator_namespace: The namespace to which this operator is installed to. Maximum of 253 @@ -1350,32 +1115,10 @@ class SourceControlConfiguration(ProxyResource): :ivar operator_scope: Scope at which the operator will be installed. Possible values include: "cluster", "namespace". Default value: "cluster". :vartype operator_scope: str or -======= - :param repository_url: Url of the SourceControl Repository. - :type repository_url: str - :param operator_namespace: The namespace to which this operator is installed to. Maximum of 253 - lower case alphanumeric characters, hyphen and period only. - :type operator_namespace: str - :param operator_instance_name: Instance name of the operator - identifying the specific - configuration. - :type operator_instance_name: str - :param operator_type: Type of the operator. Possible values include: "Flux". - :type operator_type: str or - ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.OperatorType - :param operator_params: Any Parameters for the Operator instance in string format. - :type operator_params: str - :param configuration_protected_settings: Name-value pairs of protected configuration settings - for the configuration. - :type configuration_protected_settings: dict[str, str] - :param operator_scope: Scope at which the operator will be installed. Possible values include: - "cluster", "namespace". Default value: "cluster". - :type operator_scope: str or ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.OperatorScopeType :ivar repository_public_key: Public Key associated with this SourceControl configuration (either generated within the cluster or provided by the user). :vartype repository_public_key: str -<<<<<<< HEAD :ivar ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys required to access private Git instances. :vartype ssh_known_hosts_contents: str @@ -1383,15 +1126,6 @@ class SourceControlConfiguration(ProxyResource): :vartype enable_helm_operator: bool :ivar helm_operator_properties: Properties for Helm operator. :vartype helm_operator_properties: -======= - :param ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys - required to access private Git instances. - :type ssh_known_hosts_contents: str - :param enable_helm_operator: Option to enable Helm Operator for this git configuration. - :type enable_helm_operator: bool - :param helm_operator_properties: Properties for Helm operator. - :type helm_operator_properties: ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.HelmOperatorProperties :ivar provisioning_state: The provisioning state of the resource provider. Possible values include: "Accepted", "Deleting", "Running", "Succeeded", "Failed". @@ -1447,7 +1181,6 @@ def __init__( helm_operator_properties: Optional["HelmOperatorProperties"] = None, **kwargs ): -<<<<<<< HEAD """ :keyword repository_url: Url of the SourceControl Repository. :paramtype repository_url: str @@ -1478,8 +1211,6 @@ def __init__( :paramtype helm_operator_properties: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.HelmOperatorProperties """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(SourceControlConfiguration, self).__init__(**kwargs) self.system_data = None self.repository_url = repository_url @@ -1523,11 +1254,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(SourceControlConfigurationList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -1536,17 +1264,10 @@ def __init__( class SupportedScopes(msrest.serialization.Model): """Extension scopes. -<<<<<<< HEAD :ivar default_scope: Default extension scopes: cluster or namespace. :vartype default_scope: str :ivar cluster_scope_settings: Scope settings. :vartype cluster_scope_settings: -======= - :param default_scope: Default extension scopes: cluster or namespace. - :type default_scope: str - :param cluster_scope_settings: Scope settings. - :type cluster_scope_settings: ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ClusterScopeSettings """ @@ -1562,7 +1283,6 @@ def __init__( cluster_scope_settings: Optional["ClusterScopeSettings"] = None, **kwargs ): -<<<<<<< HEAD """ :keyword default_scope: Default extension scopes: cluster or namespace. :paramtype default_scope: str @@ -1570,8 +1290,6 @@ def __init__( :paramtype cluster_scope_settings: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ClusterScopeSettings """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(SupportedScopes, self).__init__(**kwargs) self.default_scope = default_scope self.cluster_scope_settings = cluster_scope_settings @@ -1580,7 +1298,6 @@ def __init__( class SystemData(msrest.serialization.Model): """Metadata pertaining to creation and last modification of the resource. -<<<<<<< HEAD :ivar created_by: The identity that created the resource. :vartype created_by: str :ivar created_by_type: The type of identity that created the resource. Possible values include: @@ -1597,24 +1314,6 @@ class SystemData(msrest.serialization.Model): ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.CreatedByType :ivar last_modified_at: The timestamp of resource last modification (UTC). :vartype last_modified_at: ~datetime.datetime -======= - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or - ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or - ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.CreatedByType - :param last_modified_at: The timestamp of resource last modification (UTC). - :type last_modified_at: ~datetime.datetime ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1637,7 +1336,6 @@ def __init__( last_modified_at: Optional[datetime.datetime] = None, **kwargs ): -<<<<<<< HEAD """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -1656,8 +1354,6 @@ def __init__( :keyword last_modified_at: The timestamp of resource last modification (UTC). :paramtype last_modified_at: ~datetime.datetime """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(SystemData, self).__init__(**kwargs) self.created_by = created_by self.created_by_type = created_by_type diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_source_control_configuration_client_enums.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_source_control_configuration_client_enums.py index b9aec635d6d..bd58c28c279 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_source_control_configuration_client_enums.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/models/_source_control_configuration_client_enums.py @@ -6,47 +6,19 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from enum import Enum from six import with_metaclass from azure.core import CaseInsensitiveEnumMeta class ClusterTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -from enum import Enum, EnumMeta -from six import with_metaclass - -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class ClusterTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Cluster types """ CONNECTED_CLUSTERS = "connectedClusters" MANAGED_CLUSTERS = "managedClusters" -<<<<<<< HEAD class ComplianceStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class ComplianceStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """The compliance state of the configuration. """ @@ -56,11 +28,7 @@ class ComplianceStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): INSTALLED = "Installed" FAILED = "Failed" -<<<<<<< HEAD class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """The type of identity that created the resource. """ @@ -69,38 +37,22 @@ class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" -<<<<<<< HEAD class Enum0(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class Enum0(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) MICROSOFT_CONTAINER_SERVICE = "Microsoft.ContainerService" MICROSOFT_KUBERNETES = "Microsoft.Kubernetes" -<<<<<<< HEAD class Enum1(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class Enum1(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) MANAGED_CLUSTERS = "managedClusters" CONNECTED_CLUSTERS = "connectedClusters" -<<<<<<< HEAD class Enum5(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class Enum5(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) MANAGED_CLUSTERS = "managedClusters" CONNECTED_CLUSTERS = "connectedClusters" -<<<<<<< HEAD class LevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class LevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Level of the status. """ @@ -108,11 +60,7 @@ class LevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): WARNING = "Warning" INFORMATION = "Information" -<<<<<<< HEAD class MessageLevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class MessageLevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Level of the message. """ @@ -120,32 +68,20 @@ class MessageLevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): WARNING = "Warning" INFORMATION = "Information" -<<<<<<< HEAD class OperatorScopeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class OperatorScopeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Scope at which the operator will be installed. """ CLUSTER = "cluster" NAMESPACE = "namespace" -<<<<<<< HEAD class OperatorType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class OperatorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Type of the operator """ FLUX = "Flux" -<<<<<<< HEAD class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """The provisioning state of the extension resource. """ @@ -156,11 +92,7 @@ class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): UPDATING = "Updating" DELETING = "Deleting" -<<<<<<< HEAD class ProvisioningStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class ProvisioningStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """The provisioning state of the resource provider. """ diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_cluster_extension_type_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_cluster_extension_type_operations.py index f845b5d719a..a9e523f7ed1 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_cluster_extension_type_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_cluster_extension_type_operations.py @@ -5,22 +5,65 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_type: Union[str, "_models.Enum5"], + cluster_name: str, + extension_type_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterType}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{extensionTypeName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterType": _SERIALIZER.url("cluster_type", cluster_type, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "extensionTypeName": _SERIALIZER.url("extension_type_name", extension_type_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ClusterExtensionTypeOperations(object): """ClusterExtensionTypeOperations operations. @@ -44,16 +87,16 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def get( self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_type, # type: Union[str, "_models.Enum5"] - cluster_name, # type: str - extension_type_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ExtensionType" + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_type: Union[str, "_models.Enum5"], + cluster_name: str, + extension_type_name: str, + **kwargs: Any + ) -> "_models.ExtensionType": """Get Extension Type details. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -78,36 +121,26 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterType': self._serialize.url("cluster_type", cluster_type, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionTypeName': self._serialize.url("extension_type_name", extension_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_type=cluster_type, + cluster_name=cluster_name, + extension_type_name=extension_type_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExtensionType', pipeline_response) @@ -116,4 +149,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterType}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{extensionTypeName}'} # type: ignore + diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_cluster_extension_types_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_cluster_extension_types_operations.py index 2991257b530..210d4945423 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_cluster_extension_types_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_cluster_extension_types_operations.py @@ -5,23 +5,62 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/connectedClusters/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ClusterExtensionTypesOperations(object): """ClusterExtensionTypesOperations operations. @@ -45,14 +84,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ExtensionTypeList"] + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_name: str, + **kwargs: Any + ) -> Iterable["_models.ExtensionTypeList"]: """Get Extension Types. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -64,7 +103,8 @@ def list( :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionTypeList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionTypeList] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionTypeList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionTypeList"] @@ -72,37 +112,35 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_name=cluster_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_name=cluster_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ExtensionTypeList', pipeline_response) + deserialized = self._deserialize("ExtensionTypeList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,12 +153,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_extension_type_versions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_extension_type_versions_operations.py index bca368e1670..c978497cf58 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_extension_type_versions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_extension_type_versions_operations.py @@ -5,23 +5,60 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + location: str, + extension_type_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/locations/{location}/extensionTypes/{extensionTypeName}/versions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "location": _SERIALIZER.url("location", location, 'str'), + "extensionTypeName": _SERIALIZER.url("extension_type_name", extension_type_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ExtensionTypeVersionsOperations(object): """ExtensionTypeVersionsOperations operations. @@ -45,13 +82,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - location, # type: str - extension_type_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ExtensionVersionList"] + location: str, + extension_type_name: str, + **kwargs: Any + ) -> Iterable["_models.ExtensionVersionList"]: """List available versions for an Extension Type. :param location: extension location. @@ -59,8 +96,10 @@ def list( :param extension_type_name: Extension type name. :type extension_type_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ExtensionVersionList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionVersionList] + :return: An iterator like instance of either ExtensionVersionList or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionVersionList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionVersionList"] @@ -68,36 +107,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'location': self._serialize.url("location", location, 'str'), - 'extensionTypeName': self._serialize.url("extension_type_name", extension_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + location=location, + extension_type_name=extension_type_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + location=location, + extension_type_name=extension_type_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ExtensionVersionList', pipeline_response) + deserialized = self._deserialize("ExtensionVersionList", pipeline_response) list_of_elem = deserialized.versions if cls: list_of_elem = cls(list_of_elem) @@ -110,12 +146,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_extensions_operations.py index b05133955ee..36fca482e88 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_extensions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_extensions_operations.py @@ -5,18 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -======= -from typing import TYPE_CHECKING ->>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest @@ -207,21 +202,6 @@ def build_list_request( headers=header_parameters, **kwargs ) -======= -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] ->>>>>>> 331f997c (updating to the latest vendored sdk) class ExtensionsOperations(object): """ExtensionsOperations operations. @@ -247,7 +227,6 @@ def __init__(self, client, config, serializer, deserializer): def _create_initial( self, -<<<<<<< HEAD resource_group_name: str, cluster_rp: Union[str, "_models.Enum0"], cluster_resource_name: Union[str, "_models.Enum1"], @@ -256,23 +235,11 @@ def _create_initial( extension: "_models.Extension", **kwargs: Any ) -> "_models.Extension": -======= - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_name, # type: str - extension, # type: "_models.Extension" - **kwargs # type: Any - ): - # type: (...) -> "_models.Extension" ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -292,48 +259,12 @@ def _create_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-05-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(extension, 'Extension') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) if response.status_code == 200: deserialized = self._deserialize('Extension', pipeline_response) @@ -345,7 +276,6 @@ def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @@ -361,21 +291,6 @@ def begin_create( extension: "_models.Extension", **kwargs: Any ) -> LROPoller["_models.Extension"]: -======= - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - - def begin_create( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_name, # type: str - extension, # type: "_models.Extension" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Extension"] ->>>>>>> 331f997c (updating to the latest vendored sdk) """Create a new Kubernetes Cluster Extension. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -385,12 +300,8 @@ def begin_create( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -399,7 +310,6 @@ def begin_create( :type extension: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Extension :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. -<<<<<<< HEAD :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -413,17 +323,6 @@ def begin_create( """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] -======= - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either Extension or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] lro_delay = kwargs.pop( 'polling_interval', @@ -438,7 +337,6 @@ def begin_create( cluster_name=cluster_name, extension_name=extension_name, extension=extension, -<<<<<<< HEAD content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -448,37 +346,12 @@ def begin_create( def get_long_running_output(pipeline_response): response = pipeline_response.http_response deserialized = self._deserialize('Extension', pipeline_response) -======= - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('Extension', pipeline_response) - ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -490,7 +363,6 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @@ -504,20 +376,6 @@ def get( extension_name: str, **kwargs: Any ) -> "_models.Extension": -======= - begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Extension" ->>>>>>> 331f997c (updating to the latest vendored sdk) """Gets Kubernetes Cluster Extension. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -527,12 +385,8 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -547,7 +401,6 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -562,42 +415,12 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-05-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Extension', pipeline_response) @@ -606,7 +429,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @@ -621,27 +443,11 @@ def _delete_initial( force_delete: Optional[bool] = None, **kwargs: Any ) -> None: -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_name, # type: str - force_delete=None, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> None ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_delete_request_initial( @@ -657,52 +463,18 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-05-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if force_delete is not None: - query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore -<<<<<<< HEAD @distributed_trace def begin_delete( @@ -715,19 +487,6 @@ def begin_delete( force_delete: Optional[bool] = None, **kwargs: Any ) -> LROPoller[None]: -======= - def begin_delete( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_name, # type: str - force_delete=None, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] ->>>>>>> 331f997c (updating to the latest vendored sdk) """Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. @@ -738,12 +497,8 @@ def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -753,7 +508,6 @@ def begin_delete( :type force_delete: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. -<<<<<<< HEAD :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -765,17 +519,6 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] -======= - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -793,33 +536,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) -<<<<<<< HEAD kwargs.pop('error_map', None) -======= - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) ->>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) -<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -831,7 +555,6 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @@ -844,19 +567,6 @@ def list( cluster_name: str, **kwargs: Any ) -> Iterable["_models.ExtensionsList"]: -======= - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ExtensionsList"] ->>>>>>> 331f997c (updating to the latest vendored sdk) """List all Extensions in the cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -866,22 +576,14 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionsList or the result of cls(response) -<<<<<<< HEAD :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionsList] -======= - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionsList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionsList"] @@ -889,7 +591,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -921,40 +622,6 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionsList", pipeline_response) -======= - api_version = "2021-05-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ExtensionsList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -967,21 +634,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_location_extension_types_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_location_extension_types_operations.py index 15282cd28e0..5a8c204da5e 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_location_extension_types_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_location_extension_types_operations.py @@ -5,23 +5,58 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + location: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-05-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/locations/{location}/extensionTypes') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class LocationExtensionTypesOperations(object): """LocationExtensionTypesOperations operations. @@ -45,19 +80,20 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ExtensionTypeList"] + location: str, + **kwargs: Any + ) -> Iterable["_models.ExtensionTypeList"]: """List all Extension Types. :param location: extension location. :type location: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionTypeList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionTypeList] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ExtensionTypeList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionTypeList"] @@ -65,35 +101,31 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + location=location, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + location=location, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ExtensionTypeList', pipeline_response) + deserialized = self._deserialize("ExtensionTypeList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -106,12 +138,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_operation_status_operations.py index 2625bdfc61c..c1cdf65ac6d 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_operation_status_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_operation_status_operations.py @@ -5,18 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -======= -from typing import TYPE_CHECKING ->>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -111,19 +106,6 @@ def build_get_request( headers=header_parameters, **kwargs ) -======= -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] ->>>>>>> 331f997c (updating to the latest vendored sdk) class OperationStatusOperations(object): """OperationStatusOperations operations. @@ -147,7 +129,6 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace def list( self, @@ -157,17 +138,6 @@ def list( cluster_name: str, **kwargs: Any ) -> Iterable["_models.OperationStatusList"]: -======= - def list( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationStatusList"] ->>>>>>> 331f997c (updating to the latest vendored sdk) """List Async Operations, currently in progress, in a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -177,22 +147,14 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationStatusList or the result of cls(response) -<<<<<<< HEAD :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.OperationStatusList] -======= - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.OperationStatusList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusList"] @@ -200,7 +162,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -232,40 +193,6 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("OperationStatusList", pipeline_response) -======= - api_version = "2021-05-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('OperationStatusList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -278,27 +205,18 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/operations'} # type: ignore -<<<<<<< HEAD @distributed_trace def get( self, @@ -310,19 +228,6 @@ def get( operation_id: str, **kwargs: Any ) -> "_models.OperationStatusResult": -======= - def get( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_name, # type: str - operation_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OperationStatusResult" ->>>>>>> 331f997c (updating to the latest vendored sdk) """Get Async Operation status. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -332,12 +237,8 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -354,7 +255,6 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -370,43 +270,12 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-05-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OperationStatusResult', pipeline_response) @@ -415,10 +284,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_operations.py index 7df95b40c3f..6fd3ea82cea 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_operations.py @@ -5,18 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -======= -from typing import TYPE_CHECKING ->>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -54,19 +49,6 @@ def build_list_request( headers=header_parameters, **kwargs ) -======= -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] ->>>>>>> 331f997c (updating to the latest vendored sdk) class Operations(object): """Operations operations. @@ -90,7 +72,6 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace def list( self, @@ -103,18 +84,6 @@ def list( cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ResourceProviderOperationList] -======= - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ResourceProviderOperationList"] - """List all the available operations the KubernetesConfiguration resource provider supports. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.ResourceProviderOperationList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -122,7 +91,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -144,32 +112,6 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) -======= - api_version = "2021-05-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -182,21 +124,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_source_control_configurations_operations.py index 1dd2151f8b3..f79edc22996 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_source_control_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_05_01_preview/operations/_source_control_configurations_operations.py @@ -5,18 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -======= -from typing import TYPE_CHECKING ->>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest @@ -203,21 +198,6 @@ def build_list_request( headers=header_parameters, **kwargs ) -======= -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] ->>>>>>> 331f997c (updating to the latest vendored sdk) class SourceControlConfigurationsOperations(object): """SourceControlConfigurationsOperations operations. @@ -241,7 +221,6 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace def get( self, @@ -252,18 +231,6 @@ def get( source_control_configuration_name: str, **kwargs: Any ) -> "_models.SourceControlConfiguration": -======= - def get( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - source_control_configuration_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.SourceControlConfiguration" ->>>>>>> 331f997c (updating to the latest vendored sdk) """Gets details of the Source Control Configuration. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -273,24 +240,16 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) -<<<<<<< HEAD :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration -======= - :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -298,7 +257,6 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -313,42 +271,12 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-05-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) @@ -357,7 +285,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -373,21 +300,6 @@ def create_or_update( source_control_configuration: "_models.SourceControlConfiguration", **kwargs: Any ) -> "_models.SourceControlConfiguration": -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - - def create_or_update( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - source_control_configuration_name, # type: str - source_control_configuration, # type: "_models.SourceControlConfiguration" - **kwargs # type: Any - ): - # type: (...) -> "_models.SourceControlConfiguration" ->>>>>>> 331f997c (updating to the latest vendored sdk) """Create a new Kubernetes Source Control Configuration. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -397,30 +309,19 @@ def create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. -<<<<<<< HEAD :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration -======= - :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SourceControlConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfiguration ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -428,7 +329,6 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -448,47 +348,12 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-05-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -501,7 +366,6 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -515,26 +379,11 @@ def _delete_initial( source_control_configuration_name: str, **kwargs: Any ) -> None: -======= - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - source_control_configuration_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_delete_request_initial( @@ -549,50 +398,18 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-05-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore -<<<<<<< HEAD @distributed_trace def begin_delete( @@ -604,18 +421,6 @@ def begin_delete( source_control_configuration_name: str, **kwargs: Any ) -> LROPoller[None]: -======= - def begin_delete( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - source_control_configuration_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] ->>>>>>> 331f997c (updating to the latest vendored sdk) """This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from the source repo. @@ -626,19 +431,14 @@ def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. -<<<<<<< HEAD :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -650,17 +450,6 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] -======= - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -677,33 +466,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) -<<<<<<< HEAD kwargs.pop('error_map', None) -======= - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) ->>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) -<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -715,7 +485,6 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -728,19 +497,6 @@ def list( cluster_name: str, **kwargs: Any ) -> Iterable["_models.SourceControlConfigurationList"]: -======= - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SourceControlConfigurationList"] ->>>>>>> 331f997c (updating to the latest vendored sdk) """List all Source Control Configurations. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -750,7 +506,6 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -760,14 +515,6 @@ def list( cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfigurationList] -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.Enum1 - :param cluster_name: The name of the kubernetes cluster. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SourceControlConfigurationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_05_01_preview.models.SourceControlConfigurationList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfigurationList"] @@ -775,7 +522,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -807,40 +553,6 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("SourceControlConfigurationList", pipeline_response) -======= - api_version = "2021-05-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('SourceControlConfigurationList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -853,21 +565,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/__init__.py index fc12f19c5a1..e9096303633 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/__init__.py @@ -12,15 +12,7 @@ __version__ = VERSION __all__ = ['SourceControlConfigurationClient'] -<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() -======= -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/_configuration.py index 5cd5fd49fc4..b83d2cdd71b 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/_configuration.py @@ -6,29 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy -======= -from typing import TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy ->>>>>>> 331f997c (updating to the latest vendored sdk) from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports -<<<<<<< HEAD -======= - from typing import Any - ->>>>>>> 331f997c (updating to the latest vendored sdk) from azure.core.credentials import TokenCredential @@ -46,27 +33,15 @@ class SourceControlConfigurationClientConfiguration(Configuration): def __init__( self, -<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, **kwargs: Any ) -> None: super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) -======= - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None ->>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") -<<<<<<< HEAD -======= - super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -90,8 +65,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: -<<<<<<< HEAD self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) -======= - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/_source_control_configuration_client.py index 8bd2f1fbb4e..537f5bba325 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/_source_control_configuration_client.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from copy import deepcopy from typing import Any, Optional, TYPE_CHECKING @@ -31,76 +30,30 @@ class SourceControlConfigurationClient: :ivar operation_status: OperationStatusOperations operations :vartype operation_status: azure.mgmt.kubernetesconfiguration.v2021_09_01.operations.OperationStatusOperations -======= -from typing import TYPE_CHECKING - -from azure.mgmt.core import ARMPipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - 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 Operations -from . import models - - -class SourceControlConfigurationClient(object): - """KubernetesConfiguration Client. - - :ivar extensions: ExtensionsOperations operations - :vartype extensions: azure.mgmt.kubernetesconfiguration.v2021_09_01.operations.ExtensionsOperations - :ivar operation_status: OperationStatusOperations operations - :vartype operation_status: azure.mgmt.kubernetesconfiguration.v2021_09_01.operations.OperationStatusOperations ->>>>>>> 331f997c (updating to the latest vendored sdk) :ivar operations: Operations operations :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_09_01.operations.Operations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str -<<<<<<< HEAD :param base_url: Service URL. Default value is 'https://management.azure.com'. :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. -======= - :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. ->>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, -<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) -======= - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) -<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -133,35 +86,6 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) -======= - 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.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 ->>>>>>> 331f997c (updating to the latest vendored sdk) def close(self): # type: () -> None diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/__init__.py index 5951024da8e..5f583276b4e 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/__init__.py @@ -8,11 +8,8 @@ from ._source_control_configuration_client import SourceControlConfigurationClient __all__ = ['SourceControlConfigurationClient'] -<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/_configuration.py index 48cd4d60b2a..710846e073d 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/_configuration.py @@ -10,11 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -<<<<<<< HEAD from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy -======= -from azure.mgmt.core.policies import ARMHttpLoggingPolicy ->>>>>>> 331f997c (updating to the latest vendored sdk) from .._version import VERSION @@ -41,18 +37,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: -<<<<<<< HEAD super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") -<<<<<<< HEAD -======= - super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -75,8 +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: -<<<<<<< HEAD self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) -======= - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/_source_control_configuration_client.py index b534e0e1c29..96bdeb10bc7 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/_source_control_configuration_client.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from copy import deepcopy from typing import Any, Awaitable, Optional, TYPE_CHECKING @@ -18,19 +17,10 @@ from ._configuration import SourceControlConfigurationClientConfiguration from .operations import ExtensionsOperations, OperationStatusOperations, Operations -======= -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 - ->>>>>>> 331f997c (updating to the latest vendored sdk) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -<<<<<<< HEAD class SourceControlConfigurationClient: """KubernetesConfiguration Client. @@ -40,61 +30,30 @@ class SourceControlConfigurationClient: :ivar operation_status: OperationStatusOperations operations :vartype operation_status: azure.mgmt.kubernetesconfiguration.v2021_09_01.aio.operations.OperationStatusOperations -======= -from ._configuration import SourceControlConfigurationClientConfiguration -from .operations import ExtensionsOperations -from .operations import OperationStatusOperations -from .operations import Operations -from .. import models - - -class SourceControlConfigurationClient(object): - """KubernetesConfiguration Client. - - :ivar extensions: ExtensionsOperations operations - :vartype extensions: azure.mgmt.kubernetesconfiguration.v2021_09_01.aio.operations.ExtensionsOperations - :ivar operation_status: OperationStatusOperations operations - :vartype operation_status: azure.mgmt.kubernetesconfiguration.v2021_09_01.aio.operations.OperationStatusOperations ->>>>>>> 331f997c (updating to the latest vendored sdk) :ivar operations: Operations operations :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_09_01.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 ID of the target subscription. :type subscription_id: str -<<<<<<< HEAD :param base_url: Service URL. Default value is 'https://management.azure.com'. :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. -======= - :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. ->>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, -<<<<<<< HEAD base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) -======= - base_url: Optional[str] = None, - **kwargs: Any - ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) -<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -127,34 +86,6 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) -======= - 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.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 ->>>>>>> 331f997c (updating to the latest vendored sdk) async def close(self) -> None: await self._client.close() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_extensions_operations.py index c6c3c4f9d16..46475d98ddf 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_extensions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_extensions_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._extensions_operations import build_create_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -58,42 +63,31 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(extension, 'Extension') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(extension, 'Extension') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize('Extension', pipeline_response) @@ -105,8 +99,11 @@ async def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + @distributed_trace_async async def begin_create( self, resource_group_name: str, @@ -126,7 +123,8 @@ async def begin_create( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -135,15 +133,20 @@ async def begin_create( :type extension: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Extension :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Extension or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Extension] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] lro_delay = kwargs.pop( 'polling_interval', @@ -158,30 +161,21 @@ async def begin_create( cluster_name=cluster_name, extension_name=extension_name, extension=extension, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Extension', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -193,8 +187,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -213,7 +209,8 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -228,36 +225,26 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Extension', pipeline_response) @@ -266,8 +253,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + async def _delete_initial( self, resource_group_name: str, @@ -283,45 +272,35 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if force_delete is not None: - query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + force_delete=force_delete, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, @@ -342,7 +321,8 @@ async def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -352,15 +332,17 @@ async def begin_delete( :type force_delete: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -378,24 +360,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -407,6 +379,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore async def _update_initial( @@ -421,47 +394,34 @@ async def _update_initial( ) -> "_models.Extension": cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: lambda response: ResourceExistsError(response=response, model=self._deserialize(_models.ErrorResponse, response), error_format=ARMErrorFormat), + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(patch_extension, 'PatchExtension') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(patch_extension, 'PatchExtension') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize('Extension', pipeline_response) @@ -469,8 +429,11 @@ async def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + @distributed_trace_async async def begin_update( self, resource_group_name: str, @@ -490,7 +453,8 @@ async def begin_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -499,15 +463,20 @@ async def begin_update( :type patch_extension: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.PatchExtension :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Extension or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Extension] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] lro_delay = kwargs.pop( 'polling_interval', @@ -522,30 +491,21 @@ async def begin_update( cluster_name=cluster_name, extension_name=extension_name, patch_extension=patch_extension, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Extension', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -557,8 +517,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + @distributed_trace def list( self, resource_group_name: str, @@ -576,12 +538,14 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionsList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ExtensionsList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ExtensionsList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionsList"] @@ -589,38 +553,37 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ExtensionsList', pipeline_response) + deserialized = self._deserialize("ExtensionsList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -633,12 +596,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_operation_status_operations.py index 61fca2984db..0d2cb035b00 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_operation_status_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_operation_status_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operation_status_operations import build_get_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -58,12 +64,14 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationStatusList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.OperationStatusList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.OperationStatusList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusList"] @@ -71,38 +79,37 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationStatusList', pipeline_response) + deserialized = self._deserialize("OperationStatusList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,17 +122,19 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/operations'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -145,7 +154,8 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -162,37 +172,27 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + operation_id=operation_id, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OperationStatusResult', pipeline_response) @@ -201,4 +201,6 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore + diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_operations.py index ed49ac721a8..2113e3798fe 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/aio/operations/_operations.py @@ -5,17 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -25,13 +21,6 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operations import build_list_request -======= -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - ->>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -57,10 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, **kwargs: Any @@ -69,15 +55,10 @@ def list( this api-version. :keyword callable cls: A custom type or function that will be passed the direct response -<<<<<<< HEAD :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ResourceProviderOperationList] -======= - :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ResourceProviderOperationList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -85,7 +66,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -107,32 +87,6 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) -======= - api_version = "2021-09-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -145,21 +99,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/__init__.py index 2bcf3a10bde..01a45e76c93 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/__init__.py @@ -6,48 +6,27 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import ErrorAdditionalInfo - from ._models_py3 import ErrorDetail - from ._models_py3 import ErrorResponse - from ._models_py3 import Extension - from ._models_py3 import ExtensionPropertiesAksAssignedIdentity - from ._models_py3 import ExtensionStatus - from ._models_py3 import ExtensionsList - from ._models_py3 import Identity - from ._models_py3 import OperationStatusList - from ._models_py3 import OperationStatusResult - from ._models_py3 import PatchExtension - from ._models_py3 import ProxyResource - from ._models_py3 import Resource - from ._models_py3 import ResourceProviderOperation - from ._models_py3 import ResourceProviderOperationDisplay - from ._models_py3 import ResourceProviderOperationList - from ._models_py3 import Scope - from ._models_py3 import ScopeCluster - from ._models_py3 import ScopeNamespace - from ._models_py3 import SystemData -except (SyntaxError, ImportError): - from ._models import ErrorAdditionalInfo # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import Extension # type: ignore - from ._models import ExtensionPropertiesAksAssignedIdentity # type: ignore - from ._models import ExtensionStatus # type: ignore - from ._models import ExtensionsList # type: ignore - from ._models import Identity # type: ignore - from ._models import OperationStatusList # type: ignore - from ._models import OperationStatusResult # type: ignore - from ._models import PatchExtension # type: ignore - from ._models import ProxyResource # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceProviderOperation # type: ignore - from ._models import ResourceProviderOperationDisplay # type: ignore - from ._models import ResourceProviderOperationList # type: ignore - from ._models import Scope # type: ignore - from ._models import ScopeCluster # type: ignore - from ._models import ScopeNamespace # type: ignore - from ._models import SystemData # type: ignore +from ._models_py3 import ErrorAdditionalInfo +from ._models_py3 import ErrorDetail +from ._models_py3 import ErrorResponse +from ._models_py3 import Extension +from ._models_py3 import ExtensionPropertiesAksAssignedIdentity +from ._models_py3 import ExtensionStatus +from ._models_py3 import ExtensionsList +from ._models_py3 import Identity +from ._models_py3 import OperationStatusList +from ._models_py3 import OperationStatusResult +from ._models_py3 import PatchExtension +from ._models_py3 import ProxyResource +from ._models_py3 import Resource +from ._models_py3 import ResourceProviderOperation +from ._models_py3 import ResourceProviderOperationDisplay +from ._models_py3 import ResourceProviderOperationList +from ._models_py3 import Scope +from ._models_py3 import ScopeCluster +from ._models_py3 import ScopeNamespace +from ._models_py3 import SystemData + from ._source_control_configuration_client_enums import ( CreatedByType, diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_models.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_models.py deleted file mode 100644 index 82ac361f3a2..00000000000 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_models.py +++ /dev/null @@ -1,739 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: - list[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :param error: The error object. - :type error: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProxyResource, self).__init__(**kwargs) - - -class Extension(ProxyResource): - """The Extension object. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :param identity: Identity of the Extension resource. - :type identity: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Identity - :ivar system_data: Top level metadata - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.SystemData - :param extension_type: Type of the Extension, of which this resource is an instance of. It - must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the - Extension publisher. - :type extension_type: str - :param auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade - of minor version, or not. - :type auto_upgrade_minor_version: bool - :param release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. - Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. - :type release_train: str - :param version: Version of the extension for this extension, if it is 'pinned' to a specific - version. autoUpgradeMinorVersion must be 'false'. - :type version: str - :param scope: Scope at which the extension is installed. - :type scope: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Scope - :param configuration_settings: Configuration settings, as name-value pairs for configuring this - extension. - :type configuration_settings: dict[str, str] - :param configuration_protected_settings: Configuration settings that are sensitive, as - name-value pairs for configuring this extension. - :type configuration_protected_settings: dict[str, str] - :ivar provisioning_state: The provisioning state of the extension resource. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ProvisioningState - :param statuses: Status from this extension. - :type statuses: list[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ExtensionStatus] - :param error_info: The error detail. - :type error_info: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail - :ivar custom_location_settings: Custom Location settings properties. - :vartype custom_location_settings: dict[str, str] - :ivar package_uri: Uri of the Helm package. - :vartype package_uri: str - :param aks_assigned_identity: Identity of the Extension resource in an AKS cluster. - :type aks_assigned_identity: - ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ExtensionPropertiesAksAssignedIdentity - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'custom_location_settings': {'readonly': True}, - 'package_uri': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'extension_type': {'key': 'properties.extensionType', 'type': 'str'}, - 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, - 'release_train': {'key': 'properties.releaseTrain', 'type': 'str'}, - 'version': {'key': 'properties.version', 'type': 'str'}, - 'scope': {'key': 'properties.scope', 'type': 'Scope'}, - 'configuration_settings': {'key': 'properties.configurationSettings', 'type': '{str}'}, - 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'statuses': {'key': 'properties.statuses', 'type': '[ExtensionStatus]'}, - 'error_info': {'key': 'properties.errorInfo', 'type': 'ErrorDetail'}, - 'custom_location_settings': {'key': 'properties.customLocationSettings', 'type': '{str}'}, - 'package_uri': {'key': 'properties.packageUri', 'type': 'str'}, - 'aks_assigned_identity': {'key': 'properties.aksAssignedIdentity', 'type': 'ExtensionPropertiesAksAssignedIdentity'}, - } - - def __init__( - self, - **kwargs - ): - super(Extension, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.system_data = None - self.extension_type = kwargs.get('extension_type', None) - self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', True) - self.release_train = kwargs.get('release_train', "Stable") - self.version = kwargs.get('version', None) - self.scope = kwargs.get('scope', None) - self.configuration_settings = kwargs.get('configuration_settings', None) - self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) - self.provisioning_state = None - self.statuses = kwargs.get('statuses', None) - self.error_info = kwargs.get('error_info', None) - self.custom_location_settings = None - self.package_uri = None - self.aks_assigned_identity = kwargs.get('aks_assigned_identity', None) - - -class ExtensionPropertiesAksAssignedIdentity(msrest.serialization.Model): - """Identity of the Extension resource in an AKS cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :param type: The identity type. The only acceptable values to pass in are None and - "SystemAssigned". The default value is None. - :type type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtensionPropertiesAksAssignedIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - - -class ExtensionsList(msrest.serialization.Model): - """Result of the request to list Extensions. It contains a list of Extension objects and a URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Extensions within a Kubernetes cluster. - :vartype value: list[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Extension] - :ivar next_link: URL to get the next set of extension objects, if any. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Extension]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtensionsList, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ExtensionStatus(msrest.serialization.Model): - """Status from the extension. - - :param code: Status code provided by the Extension. - :type code: str - :param display_status: Short description of status of the extension. - :type display_status: str - :param level: Level of the status. Possible values include: "Error", "Warning", "Information". - Default value: "Information". - :type level: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.LevelType - :param message: Detailed message of the status from the Extension. - :type message: str - :param time: DateLiteral (per ISO8601) noting the time of installation status. - :type time: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'display_status': {'key': 'displayStatus', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'time': {'key': 'time', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtensionStatus, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.display_status = kwargs.get('display_status', None) - self.level = kwargs.get('level', "Information") - self.message = kwargs.get('message', None) - self.time = kwargs.get('time', None) - - -class Identity(msrest.serialization.Model): - """Identity for the resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :param type: The identity type. The only acceptable values to pass in are None and - "SystemAssigned". The default value is None. - :type type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - - -class OperationStatusList(msrest.serialization.Model): - """The async operations in progress, in the cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of async operations in progress, in the cluster. - :vartype value: - list[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.OperationStatusResult] - :ivar next_link: URL to get the next set of Operation Result objects, if any. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationStatusResult]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationStatusList, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class OperationStatusResult(msrest.serialization.Model): - """The current status of an async operation. - - All required parameters must be populated in order to send to Azure. - - :param id: Fully qualified ID for the async operation. - :type id: str - :param name: Name of the async operation. - :type name: str - :param status: Required. Operation status. - :type status: str - :param properties: Additional information, if available. - :type properties: dict[str, str] - :param error: The error detail. - :type error: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail - """ - - _validation = { - 'status': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationStatusResult, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.status = kwargs['status'] - self.properties = kwargs.get('properties', None) - self.error = kwargs.get('error', None) - - -class PatchExtension(msrest.serialization.Model): - """The Extension Patch Request object. - - :param auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade - of minor version, or not. - :type auto_upgrade_minor_version: bool - :param release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. - Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. - :type release_train: str - :param version: Version of the extension for this extension, if it is 'pinned' to a specific - version. autoUpgradeMinorVersion must be 'false'. - :type version: str - :param configuration_settings: Configuration settings, as name-value pairs for configuring this - extension. - :type configuration_settings: dict[str, str] - :param configuration_protected_settings: Configuration settings that are sensitive, as - name-value pairs for configuring this extension. - :type configuration_protected_settings: dict[str, str] - """ - - _attribute_map = { - 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, - 'release_train': {'key': 'properties.releaseTrain', 'type': 'str'}, - 'version': {'key': 'properties.version', 'type': 'str'}, - 'configuration_settings': {'key': 'properties.configurationSettings', 'type': '{str}'}, - 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(PatchExtension, self).__init__(**kwargs) - self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', True) - self.release_train = kwargs.get('release_train', "Stable") - self.version = kwargs.get('version', None) - self.configuration_settings = kwargs.get('configuration_settings', None) - self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) - - -class ResourceProviderOperation(msrest.serialization.Model): - """Supported operation of this resource provider. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param name: Operation name, in format of {provider}/{resource}/{operation}. - :type name: str - :param display: Display metadata associated with the operation. - :type display: - ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ResourceProviderOperationDisplay - :ivar is_data_action: The flag that indicates whether the operation applies to data plane. - :vartype is_data_action: bool - :ivar origin: Origin of the operation. - :vartype origin: str - """ - - _validation = { - 'is_data_action': {'readonly': True}, - 'origin': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'origin': {'key': 'origin', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderOperation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.is_data_action = None - self.origin = None - - -class ResourceProviderOperationDisplay(msrest.serialization.Model): - """Display metadata associated with the operation. - - :param provider: Resource provider: Microsoft KubernetesConfiguration. - :type provider: str - :param resource: Resource on which the operation is performed. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of this operation. - :type description: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderOperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) - - -class ResourceProviderOperationList(msrest.serialization.Model): - """Result of the request to list operations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of operations supported by this resource provider. - :type value: - list[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ResourceProviderOperation] - :ivar next_link: URL to the next set of results, if any. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderOperationList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class Scope(msrest.serialization.Model): - """Scope of the extension. It can be either Cluster or Namespace; but not both. - - :param cluster: Specifies that the scope of the extension is Cluster. - :type cluster: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ScopeCluster - :param namespace: Specifies that the scope of the extension is Namespace. - :type namespace: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ScopeNamespace - """ - - _attribute_map = { - 'cluster': {'key': 'cluster', 'type': 'ScopeCluster'}, - 'namespace': {'key': 'namespace', 'type': 'ScopeNamespace'}, - } - - def __init__( - self, - **kwargs - ): - super(Scope, self).__init__(**kwargs) - self.cluster = kwargs.get('cluster', None) - self.namespace = kwargs.get('namespace', None) - - -class ScopeCluster(msrest.serialization.Model): - """Specifies that the scope of the extension is Cluster. - - :param release_namespace: Namespace where the extension Release must be placed, for a Cluster - scoped extension. If this namespace does not exist, it will be created. - :type release_namespace: str - """ - - _attribute_map = { - 'release_namespace': {'key': 'releaseNamespace', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ScopeCluster, self).__init__(**kwargs) - self.release_namespace = kwargs.get('release_namespace', None) - - -class ScopeNamespace(msrest.serialization.Model): - """Specifies that the scope of the extension is Namespace. - - :param target_namespace: Namespace where the extension will be created for an Namespace scoped - extension. If this namespace does not exist, it will be created. - :type target_namespace: str - """ - - _attribute_map = { - 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ScopeNamespace, self).__init__(**kwargs) - self.target_namespace = kwargs.get('target_namespace', None) - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or - ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or - ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.CreatedByType - :param last_modified_at: The timestamp of resource last modification (UTC). - :type last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_models_py3.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_models_py3.py index dfc2c01aab6..e60feb17869 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_models_py3.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_models_py3.py @@ -40,6 +40,8 @@ def __init__( self, **kwargs ): + """ + """ super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -83,6 +85,8 @@ def __init__( self, **kwargs ): + """ + """ super(ErrorDetail, self).__init__(**kwargs) self.code = None self.message = None @@ -94,8 +98,8 @@ def __init__( class ErrorResponse(msrest.serialization.Model): """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - :param error: The error object. - :type error: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail + :ivar error: The error object. + :vartype error: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail """ _attribute_map = { @@ -108,6 +112,10 @@ def __init__( error: Optional["ErrorDetail"] = None, **kwargs ): + """ + :keyword error: The error object. + :paramtype error: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail + """ super(ErrorResponse, self).__init__(**kwargs) self.error = error @@ -143,6 +151,8 @@ def __init__( self, **kwargs ): + """ + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -180,6 +190,8 @@ def __init__( self, **kwargs ): + """ + """ super(ProxyResource, self).__init__(**kwargs) @@ -196,46 +208,46 @@ class Extension(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :param identity: Identity of the Extension resource. - :type identity: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Identity + :ivar identity: Identity of the Extension resource. + :vartype identity: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Identity :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.SystemData - :param extension_type: Type of the Extension, of which this resource is an instance of. It - must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the + :ivar extension_type: Type of the Extension, of which this resource is an instance of. It must + be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the Extension publisher. - :type extension_type: str - :param auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade + :vartype extension_type: str + :ivar auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade of minor version, or not. - :type auto_upgrade_minor_version: bool - :param release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. - Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. - :type release_train: str - :param version: Version of the extension for this extension, if it is 'pinned' to a specific + :vartype auto_upgrade_minor_version: bool + :ivar release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. Stable, + Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :vartype release_train: str + :ivar version: Version of the extension for this extension, if it is 'pinned' to a specific version. autoUpgradeMinorVersion must be 'false'. - :type version: str - :param scope: Scope at which the extension is installed. - :type scope: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Scope - :param configuration_settings: Configuration settings, as name-value pairs for configuring this + :vartype version: str + :ivar scope: Scope at which the extension is installed. + :vartype scope: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Scope + :ivar configuration_settings: Configuration settings, as name-value pairs for configuring this extension. - :type configuration_settings: dict[str, str] - :param configuration_protected_settings: Configuration settings that are sensitive, as + :vartype configuration_settings: dict[str, str] + :ivar configuration_protected_settings: Configuration settings that are sensitive, as name-value pairs for configuring this extension. - :type configuration_protected_settings: dict[str, str] + :vartype configuration_protected_settings: dict[str, str] :ivar provisioning_state: The provisioning state of the extension resource. Possible values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". :vartype provisioning_state: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ProvisioningState - :param statuses: Status from this extension. - :type statuses: list[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ExtensionStatus] - :param error_info: The error detail. - :type error_info: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail + :ivar statuses: Status from this extension. + :vartype statuses: list[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ExtensionStatus] + :ivar error_info: The error detail. + :vartype error_info: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail :ivar custom_location_settings: Custom Location settings properties. :vartype custom_location_settings: dict[str, str] :ivar package_uri: Uri of the Helm package. :vartype package_uri: str - :param aks_assigned_identity: Identity of the Extension resource in an AKS cluster. - :type aks_assigned_identity: + :ivar aks_assigned_identity: Identity of the Extension resource in an AKS cluster. + :vartype aks_assigned_identity: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ExtensionPropertiesAksAssignedIdentity """ @@ -286,6 +298,39 @@ def __init__( aks_assigned_identity: Optional["ExtensionPropertiesAksAssignedIdentity"] = None, **kwargs ): + """ + :keyword identity: Identity of the Extension resource. + :paramtype identity: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Identity + :keyword extension_type: Type of the Extension, of which this resource is an instance of. It + must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the + Extension publisher. + :paramtype extension_type: str + :keyword auto_upgrade_minor_version: Flag to note if this extension participates in auto + upgrade of minor version, or not. + :paramtype auto_upgrade_minor_version: bool + :keyword release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. + Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :paramtype release_train: str + :keyword version: Version of the extension for this extension, if it is 'pinned' to a specific + version. autoUpgradeMinorVersion must be 'false'. + :paramtype version: str + :keyword scope: Scope at which the extension is installed. + :paramtype scope: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Scope + :keyword configuration_settings: Configuration settings, as name-value pairs for configuring + this extension. + :paramtype configuration_settings: dict[str, str] + :keyword configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :paramtype configuration_protected_settings: dict[str, str] + :keyword statuses: Status from this extension. + :paramtype statuses: + list[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ExtensionStatus] + :keyword error_info: The error detail. + :paramtype error_info: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail + :keyword aks_assigned_identity: Identity of the Extension resource in an AKS cluster. + :paramtype aks_assigned_identity: + ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ExtensionPropertiesAksAssignedIdentity + """ super(Extension, self).__init__(**kwargs) self.identity = identity self.system_data = None @@ -313,9 +358,9 @@ class ExtensionPropertiesAksAssignedIdentity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :param type: The identity type. The only acceptable values to pass in are None and + :ivar type: The identity type. The only acceptable values to pass in are None and "SystemAssigned". The default value is None. - :type type: str + :vartype type: str """ _validation = { @@ -335,6 +380,11 @@ def __init__( type: Optional[str] = None, **kwargs ): + """ + :keyword type: The identity type. The only acceptable values to pass in are None and + "SystemAssigned". The default value is None. + :paramtype type: str + """ super(ExtensionPropertiesAksAssignedIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -366,6 +416,8 @@ def __init__( self, **kwargs ): + """ + """ super(ExtensionsList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -374,17 +426,17 @@ def __init__( class ExtensionStatus(msrest.serialization.Model): """Status from the extension. - :param code: Status code provided by the Extension. - :type code: str - :param display_status: Short description of status of the extension. - :type display_status: str - :param level: Level of the status. Possible values include: "Error", "Warning", "Information". + :ivar code: Status code provided by the Extension. + :vartype code: str + :ivar display_status: Short description of status of the extension. + :vartype display_status: str + :ivar level: Level of the status. Possible values include: "Error", "Warning", "Information". Default value: "Information". - :type level: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.LevelType - :param message: Detailed message of the status from the Extension. - :type message: str - :param time: DateLiteral (per ISO8601) noting the time of installation status. - :type time: str + :vartype level: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.LevelType + :ivar message: Detailed message of the status from the Extension. + :vartype message: str + :ivar time: DateLiteral (per ISO8601) noting the time of installation status. + :vartype time: str """ _attribute_map = { @@ -405,6 +457,19 @@ def __init__( time: Optional[str] = None, **kwargs ): + """ + :keyword code: Status code provided by the Extension. + :paramtype code: str + :keyword display_status: Short description of status of the extension. + :paramtype display_status: str + :keyword level: Level of the status. Possible values include: "Error", "Warning", + "Information". Default value: "Information". + :paramtype level: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.LevelType + :keyword message: Detailed message of the status from the Extension. + :paramtype message: str + :keyword time: DateLiteral (per ISO8601) noting the time of installation status. + :paramtype time: str + """ super(ExtensionStatus, self).__init__(**kwargs) self.code = code self.display_status = display_status @@ -422,9 +487,9 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :param type: The identity type. The only acceptable values to pass in are None and + :ivar type: The identity type. The only acceptable values to pass in are None and "SystemAssigned". The default value is None. - :type type: str + :vartype type: str """ _validation = { @@ -444,6 +509,11 @@ def __init__( type: Optional[str] = None, **kwargs ): + """ + :keyword type: The identity type. The only acceptable values to pass in are None and + "SystemAssigned". The default value is None. + :paramtype type: str + """ super(Identity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -476,6 +546,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationStatusList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -486,16 +558,16 @@ class OperationStatusResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param id: Fully qualified ID for the async operation. - :type id: str - :param name: Name of the async operation. - :type name: str - :param status: Required. Operation status. - :type status: str - :param properties: Additional information, if available. - :type properties: dict[str, str] - :param error: The error detail. - :type error: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Required. Operation status. + :vartype status: str + :ivar properties: Additional information, if available. + :vartype properties: dict[str, str] + :ivar error: The error detail. + :vartype error: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail """ _validation = { @@ -520,6 +592,18 @@ def __init__( error: Optional["ErrorDetail"] = None, **kwargs ): + """ + :keyword id: Fully qualified ID for the async operation. + :paramtype id: str + :keyword name: Name of the async operation. + :paramtype name: str + :keyword status: Required. Operation status. + :paramtype status: str + :keyword properties: Additional information, if available. + :paramtype properties: dict[str, str] + :keyword error: The error detail. + :paramtype error: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ErrorDetail + """ super(OperationStatusResult, self).__init__(**kwargs) self.id = id self.name = name @@ -531,21 +615,21 @@ def __init__( class PatchExtension(msrest.serialization.Model): """The Extension Patch Request object. - :param auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade + :ivar auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade of minor version, or not. - :type auto_upgrade_minor_version: bool - :param release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. - Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. - :type release_train: str - :param version: Version of the extension for this extension, if it is 'pinned' to a specific + :vartype auto_upgrade_minor_version: bool + :ivar release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. Stable, + Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :vartype release_train: str + :ivar version: Version of the extension for this extension, if it is 'pinned' to a specific version. autoUpgradeMinorVersion must be 'false'. - :type version: str - :param configuration_settings: Configuration settings, as name-value pairs for configuring this + :vartype version: str + :ivar configuration_settings: Configuration settings, as name-value pairs for configuring this extension. - :type configuration_settings: dict[str, str] - :param configuration_protected_settings: Configuration settings that are sensitive, as + :vartype configuration_settings: dict[str, str] + :ivar configuration_protected_settings: Configuration settings that are sensitive, as name-value pairs for configuring this extension. - :type configuration_protected_settings: dict[str, str] + :vartype configuration_protected_settings: dict[str, str] """ _attribute_map = { @@ -566,6 +650,23 @@ def __init__( configuration_protected_settings: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword auto_upgrade_minor_version: Flag to note if this extension participates in auto + upgrade of minor version, or not. + :paramtype auto_upgrade_minor_version: bool + :keyword release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. + Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :paramtype release_train: str + :keyword version: Version of the extension for this extension, if it is 'pinned' to a specific + version. autoUpgradeMinorVersion must be 'false'. + :paramtype version: str + :keyword configuration_settings: Configuration settings, as name-value pairs for configuring + this extension. + :paramtype configuration_settings: dict[str, str] + :keyword configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :paramtype configuration_protected_settings: dict[str, str] + """ super(PatchExtension, self).__init__(**kwargs) self.auto_upgrade_minor_version = auto_upgrade_minor_version self.release_train = release_train @@ -579,10 +680,10 @@ class ResourceProviderOperation(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: Operation name, in format of {provider}/{resource}/{operation}. - :type name: str - :param display: Display metadata associated with the operation. - :type display: + :ivar name: Operation name, in format of {provider}/{resource}/{operation}. + :vartype name: str + :ivar display: Display metadata associated with the operation. + :vartype display: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ResourceProviderOperationDisplay :ivar is_data_action: The flag that indicates whether the operation applies to data plane. :vartype is_data_action: bool @@ -609,6 +710,13 @@ def __init__( display: Optional["ResourceProviderOperationDisplay"] = None, **kwargs ): + """ + :keyword name: Operation name, in format of {provider}/{resource}/{operation}. + :paramtype name: str + :keyword display: Display metadata associated with the operation. + :paramtype display: + ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ResourceProviderOperationDisplay + """ super(ResourceProviderOperation, self).__init__(**kwargs) self.name = name self.display = display @@ -619,14 +727,14 @@ def __init__( class ResourceProviderOperationDisplay(msrest.serialization.Model): """Display metadata associated with the operation. - :param provider: Resource provider: Microsoft KubernetesConfiguration. - :type provider: str - :param resource: Resource on which the operation is performed. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of this operation. - :type description: str + :ivar provider: Resource provider: Microsoft KubernetesConfiguration. + :vartype provider: str + :ivar resource: Resource on which the operation is performed. + :vartype resource: str + :ivar operation: Type of operation: get, read, delete, etc. + :vartype operation: str + :ivar description: Description of this operation. + :vartype description: str """ _attribute_map = { @@ -645,6 +753,16 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword provider: Resource provider: Microsoft KubernetesConfiguration. + :paramtype provider: str + :keyword resource: Resource on which the operation is performed. + :paramtype resource: str + :keyword operation: Type of operation: get, read, delete, etc. + :paramtype operation: str + :keyword description: Description of this operation. + :paramtype description: str + """ super(ResourceProviderOperationDisplay, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -657,8 +775,8 @@ class ResourceProviderOperationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: List of operations supported by this resource provider. - :type value: + :ivar value: List of operations supported by this resource provider. + :vartype value: list[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ResourceProviderOperation] :ivar next_link: URL to the next set of results, if any. :vartype next_link: str @@ -679,6 +797,11 @@ def __init__( value: Optional[List["ResourceProviderOperation"]] = None, **kwargs ): + """ + :keyword value: List of operations supported by this resource provider. + :paramtype value: + list[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ResourceProviderOperation] + """ super(ResourceProviderOperationList, self).__init__(**kwargs) self.value = value self.next_link = None @@ -687,10 +810,10 @@ def __init__( class Scope(msrest.serialization.Model): """Scope of the extension. It can be either Cluster or Namespace; but not both. - :param cluster: Specifies that the scope of the extension is Cluster. - :type cluster: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ScopeCluster - :param namespace: Specifies that the scope of the extension is Namespace. - :type namespace: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ScopeNamespace + :ivar cluster: Specifies that the scope of the extension is Cluster. + :vartype cluster: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ScopeCluster + :ivar namespace: Specifies that the scope of the extension is Namespace. + :vartype namespace: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ScopeNamespace """ _attribute_map = { @@ -705,6 +828,12 @@ def __init__( namespace: Optional["ScopeNamespace"] = None, **kwargs ): + """ + :keyword cluster: Specifies that the scope of the extension is Cluster. + :paramtype cluster: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ScopeCluster + :keyword namespace: Specifies that the scope of the extension is Namespace. + :paramtype namespace: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ScopeNamespace + """ super(Scope, self).__init__(**kwargs) self.cluster = cluster self.namespace = namespace @@ -713,9 +842,9 @@ def __init__( class ScopeCluster(msrest.serialization.Model): """Specifies that the scope of the extension is Cluster. - :param release_namespace: Namespace where the extension Release must be placed, for a Cluster + :ivar release_namespace: Namespace where the extension Release must be placed, for a Cluster scoped extension. If this namespace does not exist, it will be created. - :type release_namespace: str + :vartype release_namespace: str """ _attribute_map = { @@ -728,6 +857,11 @@ def __init__( release_namespace: Optional[str] = None, **kwargs ): + """ + :keyword release_namespace: Namespace where the extension Release must be placed, for a Cluster + scoped extension. If this namespace does not exist, it will be created. + :paramtype release_namespace: str + """ super(ScopeCluster, self).__init__(**kwargs) self.release_namespace = release_namespace @@ -735,9 +869,9 @@ def __init__( class ScopeNamespace(msrest.serialization.Model): """Specifies that the scope of the extension is Namespace. - :param target_namespace: Namespace where the extension will be created for an Namespace scoped + :ivar target_namespace: Namespace where the extension will be created for an Namespace scoped extension. If this namespace does not exist, it will be created. - :type target_namespace: str + :vartype target_namespace: str """ _attribute_map = { @@ -750,6 +884,11 @@ def __init__( target_namespace: Optional[str] = None, **kwargs ): + """ + :keyword target_namespace: Namespace where the extension will be created for an Namespace + scoped extension. If this namespace does not exist, it will be created. + :paramtype target_namespace: str + """ super(ScopeNamespace, self).__init__(**kwargs) self.target_namespace = target_namespace @@ -757,22 +896,22 @@ def __init__( class SystemData(msrest.serialization.Model): """Metadata pertaining to creation and last modification of the resource. - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or + :vartype last_modified_by_type: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.CreatedByType - :param last_modified_at: The timestamp of resource last modification (UTC). - :type last_modified_at: ~datetime.datetime + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime """ _attribute_map = { @@ -795,6 +934,24 @@ def __init__( last_modified_at: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :paramtype created_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :paramtype last_modified_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.CreatedByType + :keyword last_modified_at: The timestamp of resource last modification (UTC). + :paramtype last_modified_at: ~datetime.datetime + """ super(SystemData, self).__init__(**kwargs) self.created_by = created_by self.created_by_type = created_by_type diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_source_control_configuration_client_enums.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_source_control_configuration_client_enums.py index 19b127e8cd4..48f19c25f2c 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_source_control_configuration_client_enums.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/models/_source_control_configuration_client_enums.py @@ -6,27 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity that created the resource. """ @@ -35,17 +20,17 @@ class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" -class Enum0(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Enum0(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): MICROSOFT_CONTAINER_SERVICE = "Microsoft.ContainerService" MICROSOFT_KUBERNETES = "Microsoft.Kubernetes" -class Enum1(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Enum1(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): MANAGED_CLUSTERS = "managedClusters" CONNECTED_CLUSTERS = "connectedClusters" -class LevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Level of the status. """ @@ -53,7 +38,7 @@ class LevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): WARNING = "Warning" INFORMATION = "Information" -class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The provisioning state of the extension resource. """ diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_extensions_operations.py index 7517bdd8cd2..4e718b52671 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_extensions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_extensions_operations.py @@ -5,25 +5,253 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_create_request_initial( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + extension_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "extensionName": _SERIALIZER.url("extension_name", extension_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + extension_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "extensionName": _SERIALIZER.url("extension_name", extension_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + extension_name: str, + *, + force_delete: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "extensionName": _SERIALIZER.url("extension_name", extension_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if force_delete is not None: + query_parameters['forceDelete'] = _SERIALIZER.query("force_delete", force_delete, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request_initial( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + extension_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "extensionName": _SERIALIZER.url("extension_name", extension_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ExtensionsOperations(object): """ExtensionsOperations operations. @@ -49,56 +277,44 @@ def __init__(self, client, config, serializer, deserializer): def _create_initial( self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_name, # type: str - extension, # type: "_models.Extension" - **kwargs # type: Any - ): - # type: (...) -> "_models.Extension" + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + extension_name: str, + extension: "_models.Extension", + **kwargs: Any + ) -> "_models.Extension": cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(extension, 'Extension') + + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(extension, 'Extension') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize('Extension', pipeline_response) @@ -110,19 +326,21 @@ def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + @distributed_trace def begin_create( self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_name, # type: str - extension, # type: "_models.Extension" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Extension"] + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + extension_name: str, + extension: "_models.Extension", + **kwargs: Any + ) -> LROPoller["_models.Extension"]: """Create a new Kubernetes Cluster Extension. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -132,7 +350,8 @@ def begin_create( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -141,15 +360,19 @@ def begin_create( :type extension: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Extension :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either Extension or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Extension] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] lro_delay = kwargs.pop( 'polling_interval', @@ -164,30 +387,21 @@ def begin_create( cluster_name=cluster_name, extension_name=extension_name, extension=extension, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Extension', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -199,18 +413,19 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Extension" + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + extension_name: str, + **kwargs: Any + ) -> "_models.Extension": """Gets Kubernetes Cluster Extension. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -220,7 +435,8 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -235,36 +451,26 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Extension', pipeline_response) @@ -273,74 +479,64 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + def _delete_initial( self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_name, # type: str - force_delete=None, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + extension_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if force_delete is not None: - query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + force_delete=force_delete, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + @distributed_trace def begin_delete( self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_name, # type: str - force_delete=None, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + extension_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> LROPoller[None]: """Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. @@ -351,7 +547,8 @@ def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -361,15 +558,17 @@ def begin_delete( :type force_delete: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -387,24 +586,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -416,62 +605,49 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore def _update_initial( self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_name, # type: str - patch_extension, # type: "_models.PatchExtension" - **kwargs # type: Any - ): - # type: (...) -> "_models.Extension" + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + extension_name: str, + patch_extension: "_models.PatchExtension", + **kwargs: Any + ) -> "_models.Extension": cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: lambda response: ResourceExistsError(response=response, model=self._deserialize(_models.ErrorResponse, response), error_format=ARMErrorFormat), + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(patch_extension, 'PatchExtension') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(patch_extension, 'PatchExtension') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize('Extension', pipeline_response) @@ -479,19 +655,21 @@ def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + @distributed_trace def begin_update( self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_name, # type: str - patch_extension, # type: "_models.PatchExtension" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Extension"] + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + extension_name: str, + patch_extension: "_models.PatchExtension", + **kwargs: Any + ) -> LROPoller["_models.Extension"]: """Patch an existing Kubernetes Cluster Extension. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -501,7 +679,8 @@ def begin_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -510,15 +689,19 @@ def begin_update( :type patch_extension: ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.PatchExtension :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of LROPoller that returns either Extension or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Extension] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] lro_delay = kwargs.pop( 'polling_interval', @@ -533,30 +716,21 @@ def begin_update( cluster_name=cluster_name, extension_name=extension_name, patch_extension=patch_extension, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Extension', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -568,17 +742,18 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + @distributed_trace def list( self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ExtensionsList"] + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + **kwargs: Any + ) -> Iterable["_models.ExtensionsList"]: """List all Extensions in the cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -588,12 +763,14 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionsList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ExtensionsList] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ExtensionsList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionsList"] @@ -601,38 +778,37 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ExtensionsList', pipeline_response) + deserialized = self._deserialize("ExtensionsList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -645,12 +821,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_operation_status_operations.py index 1343bf36641..c418a705a30 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_operation_status_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_operation_status_operations.py @@ -5,23 +5,107 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +def build_list_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/operations') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + extension_name: str, + operation_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "extensionName": _SERIALIZER.url("extension_name", extension_name, 'str'), + "operationId": _SERIALIZER.url("operation_id", operation_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class OperationStatusOperations(object): """OperationStatusOperations operations. @@ -45,15 +129,15 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationStatusList"] + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + **kwargs: Any + ) -> Iterable["_models.OperationStatusList"]: """List Async Operations, currently in progress, in a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -63,12 +147,14 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationStatusList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.OperationStatusList] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.OperationStatusList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusList"] @@ -76,38 +162,37 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationStatusList', pipeline_response) + deserialized = self._deserialize("OperationStatusList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -120,28 +205,29 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/operations'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_name, # type: str - operation_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OperationStatusResult" + resource_group_name: str, + cluster_rp: Union[str, "_models.Enum0"], + cluster_resource_name: Union[str, "_models.Enum1"], + cluster_name: str, + extension_name: str, + operation_id: str, + **kwargs: Any + ) -> "_models.OperationStatusResult": """Get Async Operation status. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -151,7 +237,8 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.Enum1 :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -168,37 +255,27 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + operation_id=operation_id, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OperationStatusResult', pipeline_response) @@ -207,4 +284,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore + diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_operations.py index 1cb21812c9b..e18d70e2222 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_09_01/operations/_operations.py @@ -5,23 +5,50 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2021-09-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.KubernetesConfiguration/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,17 +72,19 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ResourceProviderOperationList"] + **kwargs: Any + ) -> Iterable["_models.ResourceProviderOperationList"]: """List all the available operations the KubernetesConfiguration resource provider supports, in this api-version. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ResourceProviderOperationList] + :return: An iterator like instance of either ResourceProviderOperationList or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_09_01.models.ResourceProviderOperationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -63,30 +92,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-09-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) + deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -99,12 +125,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/__init__.py index fc12f19c5a1..e9096303633 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/__init__.py @@ -12,15 +12,7 @@ __version__ = VERSION __all__ = ['SourceControlConfigurationClient'] -<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() -======= -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/_configuration.py index a9e5a257c51..b822e7bc318 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/_configuration.py @@ -6,29 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy -======= -from typing import TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy ->>>>>>> 331f997c (updating to the latest vendored sdk) from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports -<<<<<<< HEAD -======= - from typing import Any - ->>>>>>> 331f997c (updating to the latest vendored sdk) from azure.core.credentials import TokenCredential @@ -46,27 +33,15 @@ class SourceControlConfigurationClientConfiguration(Configuration): def __init__( self, -<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, **kwargs: Any ) -> None: super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) -======= - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None ->>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") -<<<<<<< HEAD -======= - super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -90,8 +65,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: -<<<<<<< HEAD self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) -======= - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/_source_control_configuration_client.py index f150571b0cb..7a4739e5d02 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/_source_control_configuration_client.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from copy import deepcopy from typing import Any, Optional, TYPE_CHECKING @@ -55,97 +54,28 @@ class SourceControlConfigurationClient: :ivar operations: Operations operations :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.Operations -======= -from typing import TYPE_CHECKING - -from azure.mgmt.core import ARMPipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - 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 FluxConfigurationsOperations -from .operations import FluxConfigOperationStatusOperations -from .operations import Operations -from . import models - - -class SourceControlConfigurationClient(object): - """KubernetesConfiguration Client. - - :ivar extensions: ExtensionsOperations operations - :vartype extensions: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.ExtensionsOperations - :ivar operation_status: OperationStatusOperations operations - :vartype operation_status: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.OperationStatusOperations - :ivar cluster_extension_type: ClusterExtensionTypeOperations operations - :vartype cluster_extension_type: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.ClusterExtensionTypeOperations - :ivar cluster_extension_types: ClusterExtensionTypesOperations operations - :vartype cluster_extension_types: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.ClusterExtensionTypesOperations - :ivar extension_type_versions: ExtensionTypeVersionsOperations operations - :vartype extension_type_versions: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.ExtensionTypeVersionsOperations - :ivar location_extension_types: LocationExtensionTypesOperations operations - :vartype location_extension_types: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.LocationExtensionTypesOperations - :ivar source_control_configurations: SourceControlConfigurationsOperations operations - :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.SourceControlConfigurationsOperations - :ivar flux_configurations: FluxConfigurationsOperations operations - :vartype flux_configurations: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.FluxConfigurationsOperations - :ivar flux_config_operation_status: FluxConfigOperationStatusOperations operations - :vartype flux_config_operation_status: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.FluxConfigOperationStatusOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.operations.Operations ->>>>>>> 331f997c (updating to the latest vendored sdk) :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str -<<<<<<< HEAD :param base_url: Service URL. Default value is 'https://management.azure.com'. :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. -======= - :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. ->>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, -<<<<<<< HEAD credential: "TokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) -======= - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) -<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -185,49 +115,6 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) -======= - 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.flux_configurations = FluxConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.flux_config_operation_status = FluxConfigOperationStatusOperations( - 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 ->>>>>>> 331f997c (updating to the latest vendored sdk) def close(self): # type: () -> None diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/__init__.py index 5951024da8e..5f583276b4e 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/__init__.py @@ -8,11 +8,8 @@ from ._source_control_configuration_client import SourceControlConfigurationClient __all__ = ['SourceControlConfigurationClient'] -<<<<<<< HEAD # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk patch_sdk() -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/_configuration.py index 95e68899bdb..b86d839a94e 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/_configuration.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/_configuration.py @@ -10,11 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -<<<<<<< HEAD from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy -======= -from azure.mgmt.core.policies import ARMHttpLoggingPolicy ->>>>>>> 331f997c (updating to the latest vendored sdk) from .._version import VERSION @@ -41,18 +37,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: -<<<<<<< HEAD super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") -<<<<<<< HEAD -======= - super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self.credential = credential self.subscription_id = subscription_id @@ -75,8 +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: -<<<<<<< HEAD self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) -======= - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/_source_control_configuration_client.py index 5f4e0aa8592..e46bfe1b885 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/_source_control_configuration_client.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/_source_control_configuration_client.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from copy import deepcopy from typing import Any, Awaitable, Optional, TYPE_CHECKING @@ -18,19 +17,10 @@ from ._configuration import SourceControlConfigurationClientConfiguration from .operations import ClusterExtensionTypeOperations, ClusterExtensionTypesOperations, ExtensionTypeVersionsOperations, ExtensionsOperations, FluxConfigOperationStatusOperations, FluxConfigurationsOperations, LocationExtensionTypesOperations, OperationStatusOperations, Operations, SourceControlConfigurationsOperations -======= -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 - ->>>>>>> 331f997c (updating to the latest vendored sdk) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -<<<<<<< HEAD class SourceControlConfigurationClient: """KubernetesConfiguration Client. @@ -64,82 +54,28 @@ class SourceControlConfigurationClient: :ivar operations: Operations operations :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.aio.operations.Operations -======= -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 FluxConfigurationsOperations -from .operations import FluxConfigOperationStatusOperations -from .operations import Operations -from .. import models - - -class SourceControlConfigurationClient(object): - """KubernetesConfiguration Client. - - :ivar extensions: ExtensionsOperations operations - :vartype extensions: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.aio.operations.ExtensionsOperations - :ivar operation_status: OperationStatusOperations operations - :vartype operation_status: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.aio.operations.OperationStatusOperations - :ivar cluster_extension_type: ClusterExtensionTypeOperations operations - :vartype cluster_extension_type: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.aio.operations.ClusterExtensionTypeOperations - :ivar cluster_extension_types: ClusterExtensionTypesOperations operations - :vartype cluster_extension_types: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.aio.operations.ClusterExtensionTypesOperations - :ivar extension_type_versions: ExtensionTypeVersionsOperations operations - :vartype extension_type_versions: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.aio.operations.ExtensionTypeVersionsOperations - :ivar location_extension_types: LocationExtensionTypesOperations operations - :vartype location_extension_types: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.aio.operations.LocationExtensionTypesOperations - :ivar source_control_configurations: SourceControlConfigurationsOperations operations - :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.aio.operations.SourceControlConfigurationsOperations - :ivar flux_configurations: FluxConfigurationsOperations operations - :vartype flux_configurations: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.aio.operations.FluxConfigurationsOperations - :ivar flux_config_operation_status: FluxConfigOperationStatusOperations operations - :vartype flux_config_operation_status: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.aio.operations.FluxConfigOperationStatusOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.aio.operations.Operations ->>>>>>> 331f997c (updating to the latest vendored sdk) :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str -<<<<<<< HEAD :param base_url: Service URL. Default value is 'https://management.azure.com'. :type base_url: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. -======= - :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. ->>>>>>> 331f997c (updating to the latest vendored sdk) """ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, -<<<<<<< HEAD base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) -======= - base_url: Optional[str] = None, - **kwargs: Any - ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = SourceControlConfigurationClientConfiguration(credential, subscription_id, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) -<<<<<<< HEAD self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -179,48 +115,6 @@ def _send_request( request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) -======= - 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.flux_configurations = FluxConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.flux_config_operation_status = FluxConfigOperationStatusOperations( - 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 ->>>>>>> 331f997c (updating to the latest vendored sdk) async def close(self) -> None: await self._client.close() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_cluster_extension_type_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_cluster_extension_type_operations.py index 52a0a496241..0f6ebc8b36a 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_cluster_extension_type_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_cluster_extension_type_operations.py @@ -5,16 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async @@ -23,13 +19,6 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._cluster_extension_type_operations import build_get_request -======= -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - ->>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -55,10 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace_async -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -77,12 +63,8 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_type_name: Extension type name. @@ -97,7 +79,6 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -112,42 +93,12 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionTypeName': self._serialize.url("extension_type_name", extension_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExtensionType', pipeline_response) @@ -156,10 +107,6 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{extensionTypeName}'} # type: ignore -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{extensionTypeName}'} # type: ignore ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_cluster_extension_types_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_cluster_extension_types_operations.py index b444efa4b49..ddeddcf87c6 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_cluster_extension_types_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_cluster_extension_types_operations.py @@ -5,17 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -25,13 +21,6 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._cluster_extension_types_operations import build_list_request -======= -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - ->>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -57,10 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -78,22 +64,14 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionTypeList or the result of cls(response) -<<<<<<< HEAD :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionTypeList] -======= - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionTypeList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionTypeList"] @@ -101,7 +79,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -133,40 +110,6 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionTypeList", pipeline_response) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ExtensionTypeList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -179,21 +122,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_extension_type_versions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_extension_type_versions_operations.py index 7100912402a..2fb6a487db6 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_extension_type_versions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_extension_type_versions_operations.py @@ -5,17 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -25,13 +21,6 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._extension_type_versions_operations import build_list_request -======= -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - ->>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -57,10 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, location: str, @@ -74,15 +60,10 @@ def list( :param extension_type_name: Extension type name. :type extension_type_name: str :keyword callable cls: A custom type or function that will be passed the direct response -<<<<<<< HEAD :return: An iterator like instance of either ExtensionVersionList or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionVersionList] -======= - :return: An iterator like instance of either ExtensionVersionList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionVersionList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionVersionList"] @@ -90,7 +71,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -118,38 +98,6 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionVersionList", pipeline_response) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'location': self._serialize.url("location", location, 'str'), - 'extensionTypeName': self._serialize.url("extension_type_name", extension_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ExtensionVersionList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.versions if cls: list_of_elem = cls(list_of_elem) @@ -162,21 +110,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_extensions_operations.py index 87aef7ba49f..a80a7a43909 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_extensions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_extensions_operations.py @@ -5,36 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async -======= -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod ->>>>>>> 331f997c (updating to the latest vendored sdk) from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -<<<<<<< HEAD from ..._vendor import _convert_request from ...operations._extensions_operations import build_create_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial -======= - ->>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,7 +63,6 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -95,48 +82,12 @@ async def _create_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(extension, 'Extension') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) if response.status_code == 200: deserialized = self._deserialize('Extension', pipeline_response) @@ -148,16 +99,11 @@ async def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @distributed_trace_async -======= - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_create( self, resource_group_name: str, @@ -177,12 +123,8 @@ async def begin_create( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -191,7 +133,6 @@ async def begin_create( :type extension: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Extension :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. -<<<<<<< HEAD :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -206,17 +147,6 @@ async def begin_create( """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] -======= - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Extension or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] lro_delay = kwargs.pop( 'polling_interval', @@ -231,7 +161,6 @@ async def begin_create( cluster_name=cluster_name, extension_name=extension_name, extension=extension, -<<<<<<< HEAD content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -241,37 +170,12 @@ async def begin_create( def get_long_running_output(pipeline_response): response = pipeline_response.http_response deserialized = self._deserialize('Extension', pipeline_response) -======= - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('Extension', pipeline_response) - ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -283,15 +187,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @distributed_trace_async -======= - begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -310,12 +209,8 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -330,7 +225,6 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -345,42 +239,12 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Extension', pipeline_response) @@ -389,15 +253,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) async def _delete_initial( self, resource_group_name: str, @@ -413,7 +272,6 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_delete_request_initial( @@ -429,56 +287,20 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if force_delete is not None: - query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore -<<<<<<< HEAD @distributed_trace_async -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_delete( self, resource_group_name: str, @@ -499,12 +321,8 @@ async def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -514,7 +332,6 @@ async def begin_delete( :type force_delete: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. -<<<<<<< HEAD :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -526,17 +343,6 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] -======= - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -554,33 +360,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) -<<<<<<< HEAD kwargs.pop('error_map', None) -======= - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) ->>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) -<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -592,10 +379,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore async def _update_initial( @@ -610,7 +394,6 @@ async def _update_initial( ) -> "_models.Extension": cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] error_map = { -<<<<<<< HEAD 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) @@ -633,53 +416,12 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: lambda response: ResourceExistsError(response=response, model=self._deserialize(_models.ErrorResponse, response), error_format=ARMErrorFormat), - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(patch_extension, 'PatchExtension') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) deserialized = self._deserialize('Extension', pipeline_response) @@ -687,16 +429,11 @@ async def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @distributed_trace_async -======= - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_update( self, resource_group_name: str, @@ -716,18 +453,13 @@ async def begin_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. :type extension_name: str :param patch_extension: Properties to Patch in an existing Extension. -<<<<<<< HEAD :type patch_extension: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.PatchExtension :keyword callable cls: A custom type or function that will be passed the direct response @@ -746,20 +478,6 @@ async def begin_update( """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] -======= - :type patch_extension: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.PatchExtension - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Extension or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] lro_delay = kwargs.pop( 'polling_interval', @@ -774,7 +492,6 @@ async def begin_update( cluster_name=cluster_name, extension_name=extension_name, patch_extension=patch_extension, -<<<<<<< HEAD content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -784,37 +501,12 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response deserialized = self._deserialize('Extension', pipeline_response) -======= - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('Extension', pipeline_response) - ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -826,15 +518,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @distributed_trace -======= - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -852,22 +539,14 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionsList or the result of cls(response) -<<<<<<< HEAD :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionsList] -======= - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionsList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionsList"] @@ -875,7 +554,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -907,40 +585,6 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionsList", pipeline_response) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ExtensionsList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -953,21 +597,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_flux_config_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_flux_config_operation_status_operations.py index 45cb9bb03ae..278055cbaf8 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_flux_config_operation_status_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_flux_config_operation_status_operations.py @@ -5,16 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async @@ -23,13 +19,6 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._flux_config_operation_status_operations import build_get_request -======= -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - ->>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -55,10 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace_async -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -78,12 +64,8 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param flux_configuration_name: Name of the Flux Configuration. @@ -100,7 +82,6 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -116,43 +97,12 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OperationStatusResult', pipeline_response) @@ -161,10 +111,6 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}/operations/{operationId}'} # type: ignore -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}/operations/{operationId}'} # type: ignore ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_flux_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_flux_configurations_operations.py index ad96497292f..75827d96b95 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_flux_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_flux_configurations_operations.py @@ -5,36 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async -======= -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod ->>>>>>> 331f997c (updating to the latest vendored sdk) from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -<<<<<<< HEAD from ..._vendor import _convert_request from ...operations._flux_configurations_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial -======= - ->>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -60,10 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace_async -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -82,12 +67,8 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param flux_configuration_name: Name of the Flux Configuration. @@ -102,7 +83,6 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -117,42 +97,12 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FluxConfiguration', pipeline_response) @@ -161,15 +111,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) async def _create_or_update_initial( self, resource_group_name: str, @@ -182,7 +127,6 @@ async def _create_or_update_initial( ) -> "_models.FluxConfiguration": cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] error_map = { -<<<<<<< HEAD 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) @@ -205,53 +149,12 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: lambda response: ResourceExistsError(response=response, model=self._deserialize(_models.ErrorResponse, response), error_format=ARMErrorFormat), - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(flux_configuration, 'FluxConfiguration') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) if response.status_code == 200: deserialized = self._deserialize('FluxConfiguration', pipeline_response) @@ -263,16 +166,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore @distributed_trace_async -======= - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_create_or_update( self, resource_group_name: str, @@ -292,18 +190,13 @@ async def begin_create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param flux_configuration_name: Name of the Flux Configuration. :type flux_configuration_name: str :param flux_configuration: Properties necessary to Create a FluxConfiguration. -<<<<<<< HEAD :type flux_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfiguration :keyword callable cls: A custom type or function that will be passed the direct response @@ -322,20 +215,6 @@ async def begin_create_or_update( """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] -======= - :type flux_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfiguration - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FluxConfiguration or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfiguration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] lro_delay = kwargs.pop( 'polling_interval', @@ -350,7 +229,6 @@ async def begin_create_or_update( cluster_name=cluster_name, flux_configuration_name=flux_configuration_name, flux_configuration=flux_configuration, -<<<<<<< HEAD content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -360,37 +238,12 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response deserialized = self._deserialize('FluxConfiguration', pipeline_response) -======= - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('FluxConfiguration', pipeline_response) - ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -402,10 +255,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore async def _update_initial( @@ -420,7 +270,6 @@ async def _update_initial( ) -> "_models.FluxConfiguration": cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] error_map = { -<<<<<<< HEAD 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) @@ -443,53 +292,12 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: lambda response: ResourceExistsError(response=response, model=self._deserialize(_models.ErrorResponse, response), error_format=ARMErrorFormat), - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(flux_configuration_patch, 'FluxConfigurationPatch') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) deserialized = self._deserialize('FluxConfiguration', pipeline_response) @@ -497,16 +305,11 @@ async def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore @distributed_trace_async -======= - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_update( self, resource_group_name: str, @@ -526,18 +329,13 @@ async def begin_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param flux_configuration_name: Name of the Flux Configuration. :type flux_configuration_name: str :param flux_configuration_patch: Properties to Patch in an existing Flux Configuration. -<<<<<<< HEAD :type flux_configuration_patch: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfigurationPatch :keyword callable cls: A custom type or function that will be passed the direct response @@ -556,20 +354,6 @@ async def begin_update( """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] -======= - :type flux_configuration_patch: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfigurationPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FluxConfiguration or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfiguration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] lro_delay = kwargs.pop( 'polling_interval', @@ -584,7 +368,6 @@ async def begin_update( cluster_name=cluster_name, flux_configuration_name=flux_configuration_name, flux_configuration_patch=flux_configuration_patch, -<<<<<<< HEAD content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -594,37 +377,12 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response deserialized = self._deserialize('FluxConfiguration', pipeline_response) -======= - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('FluxConfiguration', pipeline_response) - ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -636,10 +394,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore async def _delete_initial( @@ -657,7 +412,6 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_delete_request_initial( @@ -673,56 +427,20 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if force_delete is not None: - query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore -<<<<<<< HEAD @distributed_trace_async -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_delete( self, resource_group_name: str, @@ -743,12 +461,8 @@ async def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param flux_configuration_name: Name of the Flux Configuration. @@ -758,7 +472,6 @@ async def begin_delete( :type force_delete: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. -<<<<<<< HEAD :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -770,17 +483,6 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] -======= - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -798,33 +500,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) -<<<<<<< HEAD - kwargs.pop('error_map', None) -======= - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) ->>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) -<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -836,15 +519,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore @distributed_trace -======= - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -862,7 +540,6 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -872,14 +549,6 @@ def list( cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfigurationsList] -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 - :param cluster_name: The name of the kubernetes cluster. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FluxConfigurationsList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfigurationsList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfigurationsList"] @@ -887,7 +556,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -919,40 +587,6 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("FluxConfigurationsList", pipeline_response) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('FluxConfigurationsList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -965,21 +599,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_location_extension_types_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_location_extension_types_operations.py index dc69d4cbb24..4dfb3b692cd 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_location_extension_types_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_location_extension_types_operations.py @@ -5,17 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -25,13 +21,6 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._location_extension_types_operations import build_list_request -======= -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - ->>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -57,10 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, location: str, @@ -72,12 +58,8 @@ def list( :type location: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionTypeList or the result of cls(response) -<<<<<<< HEAD :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionTypeList] -======= - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionTypeList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionTypeList"] @@ -85,7 +67,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -111,37 +92,6 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionTypeList", pipeline_response) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ExtensionTypeList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -154,21 +104,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_operation_status_operations.py index d51dc41d129..ca83ab69e8d 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_operation_status_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_operation_status_operations.py @@ -5,17 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -25,13 +21,6 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operation_status_operations import build_get_request, build_list_request -======= -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - ->>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -57,10 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace_async -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -80,12 +66,8 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -102,7 +84,6 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -118,43 +99,12 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OperationStatusResult', pipeline_response) @@ -163,16 +113,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore @distributed_trace -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -190,22 +135,14 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationStatusList or the result of cls(response) -<<<<<<< HEAD :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.OperationStatusList] -======= - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.OperationStatusList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusList"] @@ -213,7 +150,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -245,40 +181,6 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("OperationStatusList", pipeline_response) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationStatusList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -291,21 +193,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_operations.py index f606ac319d9..bff33128e43 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_operations.py @@ -5,17 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -25,13 +21,6 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operations import build_list_request -======= -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - ->>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -57,10 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, **kwargs: Any @@ -68,15 +54,10 @@ def list( """List all the available operations the KubernetesConfiguration resource provider supports. :keyword callable cls: A custom type or function that will be passed the direct response -<<<<<<< HEAD :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ResourceProviderOperationList] -======= - :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ResourceProviderOperationList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -84,7 +65,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -106,32 +86,6 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -144,21 +98,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_source_control_configurations_operations.py index 0dd8d1c1bc9..9e25d1d3796 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_source_control_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/aio/operations/_source_control_configurations_operations.py @@ -5,36 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async -======= -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod ->>>>>>> 331f997c (updating to the latest vendored sdk) from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -<<<<<<< HEAD from ..._vendor import _convert_request from ...operations._source_control_configurations_operations import build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request -======= - ->>>>>>> 331f997c (updating to the latest vendored sdk) T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -60,10 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace_async -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) async def get( self, resource_group_name: str, @@ -82,24 +67,16 @@ async def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) -<<<<<<< HEAD :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration -======= - :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -107,7 +84,6 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -122,42 +98,12 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) @@ -166,16 +112,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @distributed_trace_async -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) async def create_or_update( self, resource_group_name: str, @@ -195,30 +136,19 @@ async def create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. -<<<<<<< HEAD :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration -======= - :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SourceControlConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -226,7 +156,6 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -246,47 +175,12 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -299,15 +193,10 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore -======= - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) async def _delete_initial( self, resource_group_name: str, @@ -322,7 +211,6 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_delete_request_initial( @@ -337,54 +225,20 @@ async def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore -<<<<<<< HEAD @distributed_trace_async -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) async def begin_delete( self, resource_group_name: str, @@ -404,19 +258,14 @@ async def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. -<<<<<<< HEAD :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -428,17 +277,6 @@ async def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] -======= - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -455,33 +293,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) -<<<<<<< HEAD kwargs.pop('error_map', None) -======= - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) ->>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) -<<<<<<< HEAD if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -493,15 +312,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @distributed_trace -======= - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - ->>>>>>> 331f997c (updating to the latest vendored sdk) def list( self, resource_group_name: str, @@ -519,7 +333,6 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -529,14 +342,6 @@ def list( cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfigurationList] -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 - :param cluster_name: The name of the kubernetes cluster. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SourceControlConfigurationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfigurationList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfigurationList"] @@ -544,7 +349,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -576,40 +380,6 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = self._deserialize("SourceControlConfigurationList", pipeline_response) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('SourceControlConfigurationList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -622,21 +392,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/__init__.py index df8b90124e5..b83d70226f0 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/__init__.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from ._models_py3 import ClusterScopeSettings from ._models_py3 import ComplianceStatus from ._models_py3 import DependsOnDefinition @@ -49,92 +48,6 @@ from ._models_py3 import SupportedScopes from ._models_py3 import SystemData -======= -try: - from ._models_py3 import ClusterScopeSettings - from ._models_py3 import ComplianceStatus - from ._models_py3 import DependsOnDefinition - from ._models_py3 import ErrorAdditionalInfo - from ._models_py3 import ErrorDetail - from ._models_py3 import ErrorResponse - from ._models_py3 import Extension - from ._models_py3 import ExtensionPropertiesAksAssignedIdentity - from ._models_py3 import ExtensionStatus - from ._models_py3 import ExtensionType - from ._models_py3 import ExtensionTypeList - from ._models_py3 import ExtensionVersionList - from ._models_py3 import ExtensionVersionListVersionsItem - from ._models_py3 import ExtensionsList - from ._models_py3 import FluxConfiguration - from ._models_py3 import FluxConfigurationPatch - from ._models_py3 import FluxConfigurationsList - from ._models_py3 import GitRepositoryDefinition - from ._models_py3 import HelmOperatorProperties - from ._models_py3 import HelmReleasePropertiesDefinition - from ._models_py3 import Identity - from ._models_py3 import KustomizationDefinition - from ._models_py3 import ObjectReferenceDefinition - from ._models_py3 import ObjectStatusConditionDefinition - from ._models_py3 import ObjectStatusDefinition - from ._models_py3 import OperationStatusList - from ._models_py3 import OperationStatusResult - from ._models_py3 import PatchExtension - from ._models_py3 import ProxyResource - from ._models_py3 import RepositoryRefDefinition - from ._models_py3 import Resource - from ._models_py3 import ResourceProviderOperation - from ._models_py3 import ResourceProviderOperationDisplay - from ._models_py3 import ResourceProviderOperationList - from ._models_py3 import Scope - from ._models_py3 import ScopeCluster - from ._models_py3 import ScopeNamespace - from ._models_py3 import SourceControlConfiguration - from ._models_py3 import SourceControlConfigurationList - from ._models_py3 import SupportedScopes - from ._models_py3 import SystemData -except (SyntaxError, ImportError): - from ._models import ClusterScopeSettings # type: ignore - from ._models import ComplianceStatus # type: ignore - from ._models import DependsOnDefinition # type: ignore - from ._models import ErrorAdditionalInfo # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import Extension # type: ignore - from ._models import ExtensionPropertiesAksAssignedIdentity # type: ignore - from ._models import ExtensionStatus # type: ignore - from ._models import ExtensionType # type: ignore - from ._models import ExtensionTypeList # type: ignore - from ._models import ExtensionVersionList # type: ignore - from ._models import ExtensionVersionListVersionsItem # type: ignore - from ._models import ExtensionsList # type: ignore - from ._models import FluxConfiguration # type: ignore - from ._models import FluxConfigurationPatch # type: ignore - from ._models import FluxConfigurationsList # type: ignore - from ._models import GitRepositoryDefinition # type: ignore - from ._models import HelmOperatorProperties # type: ignore - from ._models import HelmReleasePropertiesDefinition # type: ignore - from ._models import Identity # type: ignore - from ._models import KustomizationDefinition # type: ignore - from ._models import ObjectReferenceDefinition # type: ignore - from ._models import ObjectStatusConditionDefinition # type: ignore - from ._models import ObjectStatusDefinition # type: ignore - from ._models import OperationStatusList # type: ignore - from ._models import OperationStatusResult # type: ignore - from ._models import PatchExtension # type: ignore - from ._models import ProxyResource # type: ignore - from ._models import RepositoryRefDefinition # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceProviderOperation # type: ignore - from ._models import ResourceProviderOperationDisplay # type: ignore - from ._models import ResourceProviderOperationList # type: ignore - from ._models import Scope # type: ignore - from ._models import ScopeCluster # type: ignore - from ._models import ScopeNamespace # type: ignore - from ._models import SourceControlConfiguration # type: ignore - from ._models import SourceControlConfigurationList # type: ignore - from ._models import SupportedScopes # type: ignore - from ._models import SystemData # type: ignore ->>>>>>> 331f997c (updating to the latest vendored sdk) from ._source_control_configuration_client_enums import ( ClusterTypes, diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_models.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_models.py deleted file mode 100644 index c47ff7c1cde..00000000000 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_models.py +++ /dev/null @@ -1,1639 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProxyResource, self).__init__(**kwargs) - - -class ClusterScopeSettings(ProxyResource): - """Extension scope settings. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :param allow_multiple_instances: Describes if multiple instances of the extension are allowed. - :type allow_multiple_instances: bool - :param default_release_namespace: Default extension release namespace. - :type default_release_namespace: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'allow_multiple_instances': {'key': 'properties.allowMultipleInstances', 'type': 'bool'}, - 'default_release_namespace': {'key': 'properties.defaultReleaseNamespace', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ClusterScopeSettings, self).__init__(**kwargs) - self.allow_multiple_instances = kwargs.get('allow_multiple_instances', None) - self.default_release_namespace = kwargs.get('default_release_namespace', None) - - -class ComplianceStatus(msrest.serialization.Model): - """Compliance Status details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar compliance_state: The compliance state of the configuration. Possible values include: - "Pending", "Compliant", "Noncompliant", "Installed", "Failed". - :vartype compliance_state: str or - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ComplianceStateType - :param last_config_applied: Datetime the configuration was last applied. - :type last_config_applied: ~datetime.datetime - :param message: Message from when the configuration was applied. - :type message: str - :param message_level: Level of the message. Possible values include: "Error", "Warning", - "Information". - :type message_level: str or - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.MessageLevelType - """ - - _validation = { - 'compliance_state': {'readonly': True}, - } - - _attribute_map = { - 'compliance_state': {'key': 'complianceState', 'type': 'str'}, - 'last_config_applied': {'key': 'lastConfigApplied', 'type': 'iso-8601'}, - 'message': {'key': 'message', 'type': 'str'}, - 'message_level': {'key': 'messageLevel', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComplianceStatus, self).__init__(**kwargs) - self.compliance_state = None - self.last_config_applied = kwargs.get('last_config_applied', None) - self.message = kwargs.get('message', None) - self.message_level = kwargs.get('message_level', None) - - -class DependsOnDefinition(msrest.serialization.Model): - """Specify which kustomizations must succeed reconciliation on the cluster prior to reconciling this kustomization. - - :param kustomization_name: Name of the kustomization to claim dependency on. - :type kustomization_name: str - """ - - _attribute_map = { - 'kustomization_name': {'key': 'kustomizationName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DependsOnDefinition, self).__init__(**kwargs) - self.kustomization_name = kwargs.get('kustomization_name', None) - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: - list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: - list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :param error: The error object. - :type error: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class Extension(ProxyResource): - """The Extension object. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :param identity: Identity of the Extension resource. - :type identity: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Identity - :ivar system_data: Top level metadata - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SystemData - :param extension_type: Type of the Extension, of which this resource is an instance of. It - must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the - Extension publisher. - :type extension_type: str - :param auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade - of minor version, or not. - :type auto_upgrade_minor_version: bool - :param release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. - Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. - :type release_train: str - :param version: Version of the extension for this extension, if it is 'pinned' to a specific - version. autoUpgradeMinorVersion must be 'false'. - :type version: str - :param scope: Scope at which the extension is installed. - :type scope: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Scope - :param configuration_settings: Configuration settings, as name-value pairs for configuring this - extension. - :type configuration_settings: dict[str, str] - :param configuration_protected_settings: Configuration settings that are sensitive, as - name-value pairs for configuring this extension. - :type configuration_protected_settings: dict[str, str] - :ivar provisioning_state: Status of installation of this extension. Possible values include: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ProvisioningState - :param statuses: Status from this extension. - :type statuses: - list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionStatus] - :ivar error_info: Error information from the Agent - e.g. errors during installation. - :vartype error_info: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ErrorDetail - :ivar custom_location_settings: Custom Location settings properties. - :vartype custom_location_settings: dict[str, str] - :ivar package_uri: Uri of the Helm package. - :vartype package_uri: str - :param aks_assigned_identity: Identity of the Extension resource in an AKS cluster. - :type aks_assigned_identity: - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionPropertiesAksAssignedIdentity - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'error_info': {'readonly': True}, - 'custom_location_settings': {'readonly': True}, - 'package_uri': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'extension_type': {'key': 'properties.extensionType', 'type': 'str'}, - 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, - 'release_train': {'key': 'properties.releaseTrain', 'type': 'str'}, - 'version': {'key': 'properties.version', 'type': 'str'}, - 'scope': {'key': 'properties.scope', 'type': 'Scope'}, - 'configuration_settings': {'key': 'properties.configurationSettings', 'type': '{str}'}, - 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'statuses': {'key': 'properties.statuses', 'type': '[ExtensionStatus]'}, - 'error_info': {'key': 'properties.errorInfo', 'type': 'ErrorDetail'}, - 'custom_location_settings': {'key': 'properties.customLocationSettings', 'type': '{str}'}, - 'package_uri': {'key': 'properties.packageUri', 'type': 'str'}, - 'aks_assigned_identity': {'key': 'properties.aksAssignedIdentity', 'type': 'ExtensionPropertiesAksAssignedIdentity'}, - } - - def __init__( - self, - **kwargs - ): - super(Extension, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.system_data = None - self.extension_type = kwargs.get('extension_type', None) - self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', True) - self.release_train = kwargs.get('release_train', "Stable") - self.version = kwargs.get('version', None) - self.scope = kwargs.get('scope', None) - self.configuration_settings = kwargs.get('configuration_settings', None) - self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) - self.provisioning_state = None - self.statuses = kwargs.get('statuses', None) - self.error_info = None - self.custom_location_settings = None - self.package_uri = None - self.aks_assigned_identity = kwargs.get('aks_assigned_identity', None) - - -class ExtensionPropertiesAksAssignedIdentity(msrest.serialization.Model): - """Identity of the Extension resource in an AKS cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :param type: The identity type. The only acceptable values to pass in are None and - "SystemAssigned". The default value is None. - :type type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtensionPropertiesAksAssignedIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - - -class ExtensionsList(msrest.serialization.Model): - """Result of the request to list Extensions. It contains a list of Extension objects and a URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Extensions within a Kubernetes cluster. - :vartype value: list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Extension] - :ivar next_link: URL to get the next set of extension objects, if any. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Extension]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtensionsList, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class ExtensionStatus(msrest.serialization.Model): - """Status from the extension. - - :param code: Status code provided by the Extension. - :type code: str - :param display_status: Short description of status of the extension. - :type display_status: str - :param level: Level of the status. Possible values include: "Error", "Warning", "Information". - Default value: "Information". - :type level: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.LevelType - :param message: Detailed message of the status from the Extension. - :type message: str - :param time: DateLiteral (per ISO8601) noting the time of installation status. - :type time: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'display_status': {'key': 'displayStatus', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'time': {'key': 'time', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtensionStatus, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.display_status = kwargs.get('display_status', None) - self.level = kwargs.get('level', "Information") - self.message = kwargs.get('message', None) - self.time = kwargs.get('time', None) - - -class ExtensionType(msrest.serialization.Model): - """Represents an Extension Type. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SystemData - :ivar release_trains: Extension release train: preview or stable. - :vartype release_trains: list[str] - :ivar cluster_types: Cluster types. Possible values include: "connectedClusters", - "managedClusters". - :vartype cluster_types: str or - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ClusterTypes - :ivar supported_scopes: Extension scopes. - :vartype supported_scopes: - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SupportedScopes - """ - - _validation = { - 'system_data': {'readonly': True}, - 'release_trains': {'readonly': True}, - 'cluster_types': {'readonly': True}, - 'supported_scopes': {'readonly': True}, - } - - _attribute_map = { - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'release_trains': {'key': 'properties.releaseTrains', 'type': '[str]'}, - 'cluster_types': {'key': 'properties.clusterTypes', 'type': 'str'}, - 'supported_scopes': {'key': 'properties.supportedScopes', 'type': 'SupportedScopes'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtensionType, self).__init__(**kwargs) - self.system_data = None - self.release_trains = None - self.cluster_types = None - self.supported_scopes = None - - -class ExtensionTypeList(msrest.serialization.Model): - """List Extension Types. - - :param value: The list of Extension Types. - :type value: list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionType] - :param next_link: The link to fetch the next page of Extension Types. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ExtensionType]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtensionTypeList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class ExtensionVersionList(msrest.serialization.Model): - """List versions for an Extension. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param versions: Versions available for this Extension Type. - :type versions: - list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionVersionListVersionsItem] - :param next_link: The link to fetch the next page of Extension Types. - :type next_link: str - :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SystemData - """ - - _validation = { - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'versions': {'key': 'versions', 'type': '[ExtensionVersionListVersionsItem]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtensionVersionList, self).__init__(**kwargs) - self.versions = kwargs.get('versions', None) - self.next_link = kwargs.get('next_link', None) - self.system_data = None - - -class ExtensionVersionListVersionsItem(msrest.serialization.Model): - """ExtensionVersionListVersionsItem. - - :param release_train: The release train for this Extension Type. - :type release_train: str - :param versions: Versions available for this Extension Type and release train. - :type versions: list[str] - """ - - _attribute_map = { - 'release_train': {'key': 'releaseTrain', 'type': 'str'}, - 'versions': {'key': 'versions', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ExtensionVersionListVersionsItem, self).__init__(**kwargs) - self.release_train = kwargs.get('release_train', None) - self.versions = kwargs.get('versions', None) - - -class FluxConfiguration(ProxyResource): - """The Flux Configuration object returned in Get & Put response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Top level metadata - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SystemData - :param scope: Scope at which the operator will be installed. Possible values include: - "cluster", "namespace". Default value: "cluster". - :type scope: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ScopeType - :param namespace: The namespace to which this configuration is installed to. Maximum of 253 - lower case alphanumeric characters, hyphen and period only. - :type namespace: str - :param source_kind: Source Kind to pull the configuration data from. Possible values include: - "GitRepository". - :type source_kind: str or - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceKindType - :param suspend: Whether this configuration should suspend its reconciliation of its - kustomizations and sources. - :type suspend: bool - :param git_repository: Parameters to reconcile to the GitRepository source kind type. - :type git_repository: - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.GitRepositoryDefinition - :param kustomizations: Array of kustomizations used to reconcile the artifact pulled by the - source type on the cluster. - :type kustomizations: dict[str, - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.KustomizationDefinition] - :param configuration_protected_settings: Key-value pairs of protected configuration settings - for the configuration. - :type configuration_protected_settings: dict[str, str] - :ivar statuses: Statuses of the Flux Kubernetes resources created by the fluxConfiguration or - created by the managed objects provisioned by the fluxConfiguration. - :vartype statuses: - list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ObjectStatusDefinition] - :ivar repository_public_key: Public Key associated with this fluxConfiguration (either - generated within the cluster or provided by the user). - :vartype repository_public_key: str - :ivar last_source_synced_commit_id: Branch and SHA of the last source commit synced with the - cluster. - :vartype last_source_synced_commit_id: str - :ivar last_source_synced_at: Datetime the fluxConfiguration last synced its source on the - cluster. - :vartype last_source_synced_at: ~datetime.datetime - :ivar compliance_state: Combined status of the Flux Kubernetes resources created by the - fluxConfiguration or created by the managed objects. Possible values include: "Compliant", - "Non-Compliant", "Pending", "Suspended", "Unknown". Default value: "Unknown". - :vartype compliance_state: str or - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxComplianceState - :ivar provisioning_state: Status of the creation of the fluxConfiguration. Possible values - include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ProvisioningState - :ivar error_message: Error message returned to the user in the case of provisioning failure. - :vartype error_message: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'statuses': {'readonly': True}, - 'repository_public_key': {'readonly': True}, - 'last_source_synced_commit_id': {'readonly': True}, - 'last_source_synced_at': {'readonly': True}, - 'compliance_state': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'error_message': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'scope': {'key': 'properties.scope', 'type': 'str'}, - 'namespace': {'key': 'properties.namespace', 'type': 'str'}, - 'source_kind': {'key': 'properties.sourceKind', 'type': 'str'}, - 'suspend': {'key': 'properties.suspend', 'type': 'bool'}, - 'git_repository': {'key': 'properties.gitRepository', 'type': 'GitRepositoryDefinition'}, - 'kustomizations': {'key': 'properties.kustomizations', 'type': '{KustomizationDefinition}'}, - 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, - 'statuses': {'key': 'properties.statuses', 'type': '[ObjectStatusDefinition]'}, - 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, - 'last_source_synced_commit_id': {'key': 'properties.lastSourceSyncedCommitId', 'type': 'str'}, - 'last_source_synced_at': {'key': 'properties.lastSourceSyncedAt', 'type': 'iso-8601'}, - 'compliance_state': {'key': 'properties.complianceState', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'error_message': {'key': 'properties.errorMessage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(FluxConfiguration, self).__init__(**kwargs) - self.system_data = None - self.scope = kwargs.get('scope', "cluster") - self.namespace = kwargs.get('namespace', "default") - self.source_kind = kwargs.get('source_kind', None) - self.suspend = kwargs.get('suspend', False) - self.git_repository = kwargs.get('git_repository', None) - self.kustomizations = kwargs.get('kustomizations', None) - self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) - self.statuses = None - self.repository_public_key = None - self.last_source_synced_commit_id = None - self.last_source_synced_at = None - self.compliance_state = None - self.provisioning_state = None - self.error_message = None - - -class FluxConfigurationPatch(msrest.serialization.Model): - """The Flux Configuration Patch Request object. - - :param source_kind: Source Kind to pull the configuration data from. Possible values include: - "GitRepository". - :type source_kind: str or - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceKindType - :param suspend: Whether this configuration should suspend its reconciliation of its - kustomizations and sources. - :type suspend: bool - :param git_repository: Parameters to reconcile to the GitRepository source kind type. - :type git_repository: - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.GitRepositoryDefinition - :param kustomizations: Array of kustomizations used to reconcile the artifact pulled by the - source type on the cluster. - :type kustomizations: dict[str, - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.KustomizationDefinition] - :param configuration_protected_settings: Key-value pairs of protected configuration settings - for the configuration. - :type configuration_protected_settings: dict[str, str] - """ - - _attribute_map = { - 'source_kind': {'key': 'properties.sourceKind', 'type': 'str'}, - 'suspend': {'key': 'properties.suspend', 'type': 'bool'}, - 'git_repository': {'key': 'properties.gitRepository', 'type': 'GitRepositoryDefinition'}, - 'kustomizations': {'key': 'properties.kustomizations', 'type': '{KustomizationDefinition}'}, - 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(FluxConfigurationPatch, self).__init__(**kwargs) - self.source_kind = kwargs.get('source_kind', None) - self.suspend = kwargs.get('suspend', False) - self.git_repository = kwargs.get('git_repository', None) - self.kustomizations = kwargs.get('kustomizations', None) - self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) - - -class FluxConfigurationsList(msrest.serialization.Model): - """Result of the request to list Flux Configurations. It contains a list of FluxConfiguration objects and a URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Flux Configurations within a Kubernetes cluster. - :vartype value: - list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfiguration] - :ivar next_link: URL to get the next set of configuration objects, if any. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[FluxConfiguration]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(FluxConfigurationsList, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class GitRepositoryDefinition(msrest.serialization.Model): - """Parameters to reconcile to the GitRepository source kind type. - - :param url: The URL to sync for the flux configuration git repository. - :type url: str - :param timeout_in_seconds: The maximum time to attempt to reconcile the cluster git repository - source with the remote. - :type timeout_in_seconds: long - :param sync_interval_in_seconds: The interval at which to re-reconcile the cluster git - repository source with the remote. - :type sync_interval_in_seconds: long - :param repository_ref: The source reference for the GitRepository object. - :type repository_ref: - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.RepositoryRefDefinition - :param ssh_known_hosts: Base64-encoded known_hosts value containing public SSH keys required to - access private git repositories over SSH. - :type ssh_known_hosts: str - :param https_user: Base64-encoded HTTPS username used to access private git repositories over - HTTPS. - :type https_user: str - :param https_ca_file: Base64-encoded HTTPS certificate authority contents used to access git - private git repositories over HTTPS. - :type https_ca_file: str - :param local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the - authentication secret rather than the managed or user-provided configuration secrets. - :type local_auth_ref: str - """ - - _attribute_map = { - 'url': {'key': 'url', 'type': 'str'}, - 'timeout_in_seconds': {'key': 'timeoutInSeconds', 'type': 'long'}, - 'sync_interval_in_seconds': {'key': 'syncIntervalInSeconds', 'type': 'long'}, - 'repository_ref': {'key': 'repositoryRef', 'type': 'RepositoryRefDefinition'}, - 'ssh_known_hosts': {'key': 'sshKnownHosts', 'type': 'str'}, - 'https_user': {'key': 'httpsUser', 'type': 'str'}, - 'https_ca_file': {'key': 'httpsCAFile', 'type': 'str'}, - 'local_auth_ref': {'key': 'localAuthRef', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(GitRepositoryDefinition, self).__init__(**kwargs) - self.url = kwargs.get('url', None) - self.timeout_in_seconds = kwargs.get('timeout_in_seconds', 600) - self.sync_interval_in_seconds = kwargs.get('sync_interval_in_seconds', 600) - self.repository_ref = kwargs.get('repository_ref', None) - self.ssh_known_hosts = kwargs.get('ssh_known_hosts', None) - self.https_user = kwargs.get('https_user', None) - self.https_ca_file = kwargs.get('https_ca_file', None) - self.local_auth_ref = kwargs.get('local_auth_ref', None) - - -class HelmOperatorProperties(msrest.serialization.Model): - """Properties for Helm operator. - - :param chart_version: Version of the operator Helm chart. - :type chart_version: str - :param chart_values: Values override for the operator Helm chart. - :type chart_values: str - """ - - _attribute_map = { - 'chart_version': {'key': 'chartVersion', 'type': 'str'}, - 'chart_values': {'key': 'chartValues', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HelmOperatorProperties, self).__init__(**kwargs) - self.chart_version = kwargs.get('chart_version', None) - self.chart_values = kwargs.get('chart_values', None) - - -class HelmReleasePropertiesDefinition(msrest.serialization.Model): - """HelmReleasePropertiesDefinition. - - :param last_revision_applied: The revision number of the last released object change. - :type last_revision_applied: long - :param helm_chart_ref: The reference to the HelmChart object used as the source to this - HelmRelease. - :type helm_chart_ref: - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ObjectReferenceDefinition - :param failure_count: Total number of times that the HelmRelease failed to install or upgrade. - :type failure_count: long - :param install_failure_count: Number of times that the HelmRelease failed to install. - :type install_failure_count: long - :param upgrade_failure_count: Number of times that the HelmRelease failed to upgrade. - :type upgrade_failure_count: long - """ - - _attribute_map = { - 'last_revision_applied': {'key': 'lastRevisionApplied', 'type': 'long'}, - 'helm_chart_ref': {'key': 'helmChartRef', 'type': 'ObjectReferenceDefinition'}, - 'failure_count': {'key': 'failureCount', 'type': 'long'}, - 'install_failure_count': {'key': 'installFailureCount', 'type': 'long'}, - 'upgrade_failure_count': {'key': 'upgradeFailureCount', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - super(HelmReleasePropertiesDefinition, self).__init__(**kwargs) - self.last_revision_applied = kwargs.get('last_revision_applied', None) - self.helm_chart_ref = kwargs.get('helm_chart_ref', None) - self.failure_count = kwargs.get('failure_count', None) - self.install_failure_count = kwargs.get('install_failure_count', None) - self.upgrade_failure_count = kwargs.get('upgrade_failure_count', None) - - -class Identity(msrest.serialization.Model): - """Identity for the resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :param type: The identity type. The only acceptable values to pass in are None and - "SystemAssigned". The default value is None. - :type type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - - -class KustomizationDefinition(msrest.serialization.Model): - """The Kustomization defining how to reconcile the artifact pulled by the source type on the cluster. - - :param path: The path in the source reference to reconcile on the cluster. - :type path: str - :param depends_on: Specifies other Kustomizations that this Kustomization depends on. This - Kustomization will not reconcile until all dependencies have completed their reconciliation. - :type depends_on: - list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.DependsOnDefinition] - :param timeout_in_seconds: The maximum time to attempt to reconcile the Kustomization on the - cluster. - :type timeout_in_seconds: long - :param sync_interval_in_seconds: The interval at which to re-reconcile the Kustomization on the - cluster. - :type sync_interval_in_seconds: long - :param retry_interval_in_seconds: The interval at which to re-reconcile the Kustomization on - the cluster in the event of failure on reconciliation. - :type retry_interval_in_seconds: long - :param prune: Enable/disable garbage collections of Kubernetes objects created by this - Kustomization. - :type prune: bool - :param validation: Specify whether to validate the Kubernetes objects referenced in the - Kustomization before applying them to the cluster. Possible values include: "none", "client", - "server". Default value: "none". - :type validation: str or - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.KustomizationValidationType - :param force: Enable/disable re-creating Kubernetes resources on the cluster when patching - fails due to an immutable field change. - :type force: bool - """ - - _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'depends_on': {'key': 'dependsOn', 'type': '[DependsOnDefinition]'}, - 'timeout_in_seconds': {'key': 'timeoutInSeconds', 'type': 'long'}, - 'sync_interval_in_seconds': {'key': 'syncIntervalInSeconds', 'type': 'long'}, - 'retry_interval_in_seconds': {'key': 'retryIntervalInSeconds', 'type': 'long'}, - 'prune': {'key': 'prune', 'type': 'bool'}, - 'validation': {'key': 'validation', 'type': 'str'}, - 'force': {'key': 'force', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(KustomizationDefinition, self).__init__(**kwargs) - self.path = kwargs.get('path', "") - self.depends_on = kwargs.get('depends_on', None) - self.timeout_in_seconds = kwargs.get('timeout_in_seconds', 600) - self.sync_interval_in_seconds = kwargs.get('sync_interval_in_seconds', 600) - self.retry_interval_in_seconds = kwargs.get('retry_interval_in_seconds', None) - self.prune = kwargs.get('prune', False) - self.validation = kwargs.get('validation', "none") - self.force = kwargs.get('force', False) - - -class ObjectReferenceDefinition(msrest.serialization.Model): - """Object reference to a Kubernetes object on a cluster. - - :param name: Name of the object. - :type name: str - :param namespace: Namespace of the object. - :type namespace: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ObjectReferenceDefinition, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.namespace = kwargs.get('namespace', None) - - -class ObjectStatusConditionDefinition(msrest.serialization.Model): - """Status condition of Kubernetes object. - - :param last_transition_time: Last time this status condition has changed. - :type last_transition_time: ~datetime.datetime - :param message: A more verbose description of the object status condition. - :type message: str - :param reason: Reason for the specified status condition type status. - :type reason: str - :param status: Status of the Kubernetes object condition type. - :type status: str - :param type: Object status condition type for this object. - :type type: str - """ - - _attribute_map = { - 'last_transition_time': {'key': 'lastTransitionTime', 'type': 'iso-8601'}, - 'message': {'key': 'message', 'type': 'str'}, - 'reason': {'key': 'reason', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ObjectStatusConditionDefinition, self).__init__(**kwargs) - self.last_transition_time = kwargs.get('last_transition_time', None) - self.message = kwargs.get('message', None) - self.reason = kwargs.get('reason', None) - self.status = kwargs.get('status', None) - self.type = kwargs.get('type', None) - - -class ObjectStatusDefinition(msrest.serialization.Model): - """Statuses of objects deployed by the user-specified kustomizations from the git repository. - - :param name: Name of the applied object. - :type name: str - :param namespace: Namespace of the applied object. - :type namespace: str - :param kind: Kind of the applied object. - :type kind: str - :param compliance_state: Compliance state of the applied object showing whether the applied - object has come into a ready state on the cluster. Possible values include: "Compliant", - "Non-Compliant", "Pending", "Suspended", "Unknown". Default value: "Unknown". - :type compliance_state: str or - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxComplianceState - :param applied_by: Object reference to the Kustomization that applied this object. - :type applied_by: - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ObjectReferenceDefinition - :param status_conditions: List of Kubernetes object status conditions present on the cluster. - :type status_conditions: - list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ObjectStatusConditionDefinition] - :param helm_release_properties: Additional properties that are provided from objects of the - HelmRelease kind. - :type helm_release_properties: - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.HelmReleasePropertiesDefinition - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'compliance_state': {'key': 'complianceState', 'type': 'str'}, - 'applied_by': {'key': 'appliedBy', 'type': 'ObjectReferenceDefinition'}, - 'status_conditions': {'key': 'statusConditions', 'type': '[ObjectStatusConditionDefinition]'}, - 'helm_release_properties': {'key': 'helmReleaseProperties', 'type': 'HelmReleasePropertiesDefinition'}, - } - - def __init__( - self, - **kwargs - ): - super(ObjectStatusDefinition, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.namespace = kwargs.get('namespace', None) - self.kind = kwargs.get('kind', None) - self.compliance_state = kwargs.get('compliance_state', "Unknown") - self.applied_by = kwargs.get('applied_by', None) - self.status_conditions = kwargs.get('status_conditions', None) - self.helm_release_properties = kwargs.get('helm_release_properties', None) - - -class OperationStatusList(msrest.serialization.Model): - """The async operations in progress, in the cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of async operations in progress, in the cluster. - :vartype value: - list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.OperationStatusResult] - :ivar next_link: URL to get the next set of Operation Result objects, if any. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationStatusResult]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationStatusList, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class OperationStatusResult(msrest.serialization.Model): - """The current status of an async operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param id: Fully qualified ID for the async operation. - :type id: str - :param name: Name of the async operation. - :type name: str - :param status: Required. Operation status. - :type status: str - :param properties: Additional information, if available. - :type properties: dict[str, str] - :ivar error: If present, details of the operation error. - :vartype error: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ErrorDetail - """ - - _validation = { - 'status': {'required': True}, - 'error': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationStatusResult, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.status = kwargs['status'] - self.properties = kwargs.get('properties', None) - self.error = None - - -class PatchExtension(msrest.serialization.Model): - """The Extension Patch Request object. - - :param auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade - of minor version, or not. - :type auto_upgrade_minor_version: bool - :param release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. - Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. - :type release_train: str - :param version: Version of the extension for this extension, if it is 'pinned' to a specific - version. autoUpgradeMinorVersion must be 'false'. - :type version: str - :param configuration_settings: Configuration settings, as name-value pairs for configuring this - extension. - :type configuration_settings: dict[str, str] - :param configuration_protected_settings: Configuration settings that are sensitive, as - name-value pairs for configuring this extension. - :type configuration_protected_settings: dict[str, str] - """ - - _attribute_map = { - 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, - 'release_train': {'key': 'properties.releaseTrain', 'type': 'str'}, - 'version': {'key': 'properties.version', 'type': 'str'}, - 'configuration_settings': {'key': 'properties.configurationSettings', 'type': '{str}'}, - 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(PatchExtension, self).__init__(**kwargs) - self.auto_upgrade_minor_version = kwargs.get('auto_upgrade_minor_version', True) - self.release_train = kwargs.get('release_train', "Stable") - self.version = kwargs.get('version', None) - self.configuration_settings = kwargs.get('configuration_settings', None) - self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) - - -class RepositoryRefDefinition(msrest.serialization.Model): - """The source reference for the GitRepository object. - - :param branch: The git repository branch name to checkout. - :type branch: str - :param tag: The git repository tag name to checkout. This takes precedence over branch. - :type tag: str - :param semver: The semver range used to match against git repository tags. This takes - precedence over tag. - :type semver: str - :param commit: The commit SHA to checkout. This value must be combined with the branch name to - be valid. This takes precedence over semver. - :type commit: str - """ - - _attribute_map = { - 'branch': {'key': 'branch', 'type': 'str'}, - 'tag': {'key': 'tag', 'type': 'str'}, - 'semver': {'key': 'semver', 'type': 'str'}, - 'commit': {'key': 'commit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RepositoryRefDefinition, self).__init__(**kwargs) - self.branch = kwargs.get('branch', None) - self.tag = kwargs.get('tag', None) - self.semver = kwargs.get('semver', None) - self.commit = kwargs.get('commit', None) - - -class ResourceProviderOperation(msrest.serialization.Model): - """Supported operation of this resource provider. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param name: Operation name, in format of {provider}/{resource}/{operation}. - :type name: str - :param display: Display metadata associated with the operation. - :type display: - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ResourceProviderOperationDisplay - :ivar is_data_action: The flag that indicates whether the operation applies to data plane. - :vartype is_data_action: bool - :ivar origin: Origin of the operation. - :vartype origin: str - """ - - _validation = { - 'is_data_action': {'readonly': True}, - 'origin': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'origin': {'key': 'origin', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderOperation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.is_data_action = None - self.origin = None - - -class ResourceProviderOperationDisplay(msrest.serialization.Model): - """Display metadata associated with the operation. - - :param provider: Resource provider: Microsoft KubernetesConfiguration. - :type provider: str - :param resource: Resource on which the operation is performed. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of this operation. - :type description: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderOperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) - - -class ResourceProviderOperationList(msrest.serialization.Model): - """Result of the request to list operations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: List of operations supported by this resource provider. - :type value: - list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ResourceProviderOperation] - :ivar next_link: URL to the next set of results, if any. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderOperationList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class Scope(msrest.serialization.Model): - """Scope of the extension. It can be either Cluster or Namespace; but not both. - - :param cluster: Specifies that the scope of the extension is Cluster. - :type cluster: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ScopeCluster - :param namespace: Specifies that the scope of the extension is Namespace. - :type namespace: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ScopeNamespace - """ - - _attribute_map = { - 'cluster': {'key': 'cluster', 'type': 'ScopeCluster'}, - 'namespace': {'key': 'namespace', 'type': 'ScopeNamespace'}, - } - - def __init__( - self, - **kwargs - ): - super(Scope, self).__init__(**kwargs) - self.cluster = kwargs.get('cluster', None) - self.namespace = kwargs.get('namespace', None) - - -class ScopeCluster(msrest.serialization.Model): - """Specifies that the scope of the extension is Cluster. - - :param release_namespace: Namespace where the extension Release must be placed, for a Cluster - scoped extension. If this namespace does not exist, it will be created. - :type release_namespace: str - """ - - _attribute_map = { - 'release_namespace': {'key': 'releaseNamespace', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ScopeCluster, self).__init__(**kwargs) - self.release_namespace = kwargs.get('release_namespace', None) - - -class ScopeNamespace(msrest.serialization.Model): - """Specifies that the scope of the extension is Namespace. - - :param target_namespace: Namespace where the extension will be created for an Namespace scoped - extension. If this namespace does not exist, it will be created. - :type target_namespace: str - """ - - _attribute_map = { - 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ScopeNamespace, self).__init__(**kwargs) - self.target_namespace = kwargs.get('target_namespace', None) - - -class SourceControlConfiguration(ProxyResource): - """The SourceControl Configuration object returned in Get & Put response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Top level metadata - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SystemData - :param repository_url: Url of the SourceControl Repository. - :type repository_url: str - :param operator_namespace: The namespace to which this operator is installed to. Maximum of 253 - lower case alphanumeric characters, hyphen and period only. - :type operator_namespace: str - :param operator_instance_name: Instance name of the operator - identifying the specific - configuration. - :type operator_instance_name: str - :param operator_type: Type of the operator. Possible values include: "Flux". - :type operator_type: str or - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.OperatorType - :param operator_params: Any Parameters for the Operator instance in string format. - :type operator_params: str - :param configuration_protected_settings: Name-value pairs of protected configuration settings - for the configuration. - :type configuration_protected_settings: dict[str, str] - :param operator_scope: Scope at which the operator will be installed. Possible values include: - "cluster", "namespace". Default value: "cluster". - :type operator_scope: str or - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.OperatorScopeType - :ivar repository_public_key: Public Key associated with this SourceControl configuration - (either generated within the cluster or provided by the user). - :vartype repository_public_key: str - :param ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys - required to access private Git instances. - :type ssh_known_hosts_contents: str - :param enable_helm_operator: Option to enable Helm Operator for this git configuration. - :type enable_helm_operator: bool - :param helm_operator_properties: Properties for Helm operator. - :type helm_operator_properties: - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.HelmOperatorProperties - :ivar provisioning_state: The provisioning state of the resource provider. Possible values - include: "Accepted", "Deleting", "Running", "Succeeded", "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ProvisioningStateType - :ivar compliance_status: Compliance Status of the Configuration. - :vartype compliance_status: - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ComplianceStatus - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'repository_public_key': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'compliance_status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, - 'operator_namespace': {'key': 'properties.operatorNamespace', 'type': 'str'}, - 'operator_instance_name': {'key': 'properties.operatorInstanceName', 'type': 'str'}, - 'operator_type': {'key': 'properties.operatorType', 'type': 'str'}, - 'operator_params': {'key': 'properties.operatorParams', 'type': 'str'}, - 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, - 'operator_scope': {'key': 'properties.operatorScope', 'type': 'str'}, - 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, - 'ssh_known_hosts_contents': {'key': 'properties.sshKnownHostsContents', 'type': 'str'}, - 'enable_helm_operator': {'key': 'properties.enableHelmOperator', 'type': 'bool'}, - 'helm_operator_properties': {'key': 'properties.helmOperatorProperties', 'type': 'HelmOperatorProperties'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'compliance_status': {'key': 'properties.complianceStatus', 'type': 'ComplianceStatus'}, - } - - def __init__( - self, - **kwargs - ): - super(SourceControlConfiguration, self).__init__(**kwargs) - self.system_data = None - self.repository_url = kwargs.get('repository_url', None) - self.operator_namespace = kwargs.get('operator_namespace', "default") - self.operator_instance_name = kwargs.get('operator_instance_name', None) - self.operator_type = kwargs.get('operator_type', None) - self.operator_params = kwargs.get('operator_params', None) - self.configuration_protected_settings = kwargs.get('configuration_protected_settings', None) - self.operator_scope = kwargs.get('operator_scope', "cluster") - self.repository_public_key = None - self.ssh_known_hosts_contents = kwargs.get('ssh_known_hosts_contents', None) - self.enable_helm_operator = kwargs.get('enable_helm_operator', None) - self.helm_operator_properties = kwargs.get('helm_operator_properties', None) - self.provisioning_state = None - self.compliance_status = None - - -class SourceControlConfigurationList(msrest.serialization.Model): - """Result of the request to list Source Control Configurations. It contains a list of SourceControlConfiguration objects and a URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Source Control Configurations within a Kubernetes cluster. - :vartype value: - list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration] - :ivar next_link: URL to get the next set of configuration objects, if any. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[SourceControlConfiguration]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SourceControlConfigurationList, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class SupportedScopes(msrest.serialization.Model): - """Extension scopes. - - :param default_scope: Default extension scopes: cluster or namespace. - :type default_scope: str - :param cluster_scope_settings: Scope settings. - :type cluster_scope_settings: - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ClusterScopeSettings - """ - - _attribute_map = { - 'default_scope': {'key': 'defaultScope', 'type': 'str'}, - 'cluster_scope_settings': {'key': 'clusterScopeSettings', 'type': 'ClusterScopeSettings'}, - } - - def __init__( - self, - **kwargs - ): - super(SupportedScopes, self).__init__(**kwargs) - self.default_scope = kwargs.get('default_scope', None) - self.cluster_scope_settings = kwargs.get('cluster_scope_settings', None) - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.CreatedByType - :param last_modified_at: The timestamp of resource last modification (UTC). - :type last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_models_py3.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_models_py3.py index d2a627f98e7..b7d98fd1b6d 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_models_py3.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_models_py3.py @@ -46,11 +46,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -88,11 +85,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ProxyResource, self).__init__(**kwargs) @@ -109,17 +103,10 @@ class ClusterScopeSettings(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str -<<<<<<< HEAD :ivar allow_multiple_instances: Describes if multiple instances of the extension are allowed. :vartype allow_multiple_instances: bool :ivar default_release_namespace: Default extension release namespace. :vartype default_release_namespace: str -======= - :param allow_multiple_instances: Describes if multiple instances of the extension are allowed. - :type allow_multiple_instances: bool - :param default_release_namespace: Default extension release namespace. - :type default_release_namespace: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -143,7 +130,6 @@ def __init__( default_release_namespace: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword allow_multiple_instances: Describes if multiple instances of the extension are allowed. @@ -151,8 +137,6 @@ def __init__( :keyword default_release_namespace: Default extension release namespace. :paramtype default_release_namespace: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ClusterScopeSettings, self).__init__(**kwargs) self.allow_multiple_instances = allow_multiple_instances self.default_release_namespace = default_release_namespace @@ -167,7 +151,6 @@ class ComplianceStatus(msrest.serialization.Model): "Pending", "Compliant", "Noncompliant", "Installed", "Failed". :vartype compliance_state: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ComplianceStateType -<<<<<<< HEAD :ivar last_config_applied: Datetime the configuration was last applied. :vartype last_config_applied: ~datetime.datetime :ivar message: Message from when the configuration was applied. @@ -175,15 +158,6 @@ class ComplianceStatus(msrest.serialization.Model): :ivar message_level: Level of the message. Possible values include: "Error", "Warning", "Information". :vartype message_level: str or -======= - :param last_config_applied: Datetime the configuration was last applied. - :type last_config_applied: ~datetime.datetime - :param message: Message from when the configuration was applied. - :type message: str - :param message_level: Level of the message. Possible values include: "Error", "Warning", - "Information". - :type message_level: str or ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.MessageLevelType """ @@ -206,7 +180,6 @@ def __init__( message_level: Optional[Union[str, "MessageLevelType"]] = None, **kwargs ): -<<<<<<< HEAD """ :keyword last_config_applied: Datetime the configuration was last applied. :paramtype last_config_applied: ~datetime.datetime @@ -217,8 +190,6 @@ def __init__( :paramtype message_level: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.MessageLevelType """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ComplianceStatus, self).__init__(**kwargs) self.compliance_state = None self.last_config_applied = last_config_applied @@ -229,13 +200,8 @@ def __init__( class DependsOnDefinition(msrest.serialization.Model): """Specify which kustomizations must succeed reconciliation on the cluster prior to reconciling this kustomization. -<<<<<<< HEAD :ivar kustomization_name: Name of the kustomization to claim dependency on. :vartype kustomization_name: str -======= - :param kustomization_name: Name of the kustomization to claim dependency on. - :type kustomization_name: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -248,13 +214,10 @@ def __init__( kustomization_name: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword kustomization_name: Name of the kustomization to claim dependency on. :paramtype kustomization_name: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(DependsOnDefinition, self).__init__(**kwargs) self.kustomization_name = kustomization_name @@ -284,11 +247,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorAdditionalInfo, self).__init__(**kwargs) self.type = None self.info = None @@ -333,11 +293,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorDetail, self).__init__(**kwargs) self.code = None self.message = None @@ -349,13 +306,8 @@ def __init__( class ErrorResponse(msrest.serialization.Model): """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). -<<<<<<< HEAD :ivar error: The error object. :vartype error: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ErrorDetail -======= - :param error: The error object. - :type error: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ErrorDetail ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -368,13 +320,10 @@ def __init__( error: Optional["ErrorDetail"] = None, **kwargs ): -<<<<<<< HEAD """ :keyword error: The error object. :paramtype error: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ErrorDetail """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ErrorResponse, self).__init__(**kwargs) self.error = error @@ -392,7 +341,6 @@ class Extension(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str -<<<<<<< HEAD :ivar identity: Identity of the Extension resource. :vartype identity: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Identity :ivar system_data: Top level metadata @@ -419,45 +367,12 @@ class Extension(ProxyResource): :ivar configuration_protected_settings: Configuration settings that are sensitive, as name-value pairs for configuring this extension. :vartype configuration_protected_settings: dict[str, str] -======= - :param identity: Identity of the Extension resource. - :type identity: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Identity - :ivar system_data: Top level metadata - https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SystemData - :param extension_type: Type of the Extension, of which this resource is an instance of. It - must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the - Extension publisher. - :type extension_type: str - :param auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade - of minor version, or not. - :type auto_upgrade_minor_version: bool - :param release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. - Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. - :type release_train: str - :param version: Version of the extension for this extension, if it is 'pinned' to a specific - version. autoUpgradeMinorVersion must be 'false'. - :type version: str - :param scope: Scope at which the extension is installed. - :type scope: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Scope - :param configuration_settings: Configuration settings, as name-value pairs for configuring this - extension. - :type configuration_settings: dict[str, str] - :param configuration_protected_settings: Configuration settings that are sensitive, as - name-value pairs for configuring this extension. - :type configuration_protected_settings: dict[str, str] ->>>>>>> 331f997c (updating to the latest vendored sdk) :ivar provisioning_state: Status of installation of this extension. Possible values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". :vartype provisioning_state: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ProvisioningState -<<<<<<< HEAD :ivar statuses: Status from this extension. :vartype statuses: -======= - :param statuses: Status from this extension. - :type statuses: ->>>>>>> 331f997c (updating to the latest vendored sdk) list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionStatus] :ivar error_info: Error information from the Agent - e.g. errors during installation. :vartype error_info: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ErrorDetail @@ -465,13 +380,8 @@ class Extension(ProxyResource): :vartype custom_location_settings: dict[str, str] :ivar package_uri: Uri of the Helm package. :vartype package_uri: str -<<<<<<< HEAD :ivar aks_assigned_identity: Identity of the Extension resource in an AKS cluster. :vartype aks_assigned_identity: -======= - :param aks_assigned_identity: Identity of the Extension resource in an AKS cluster. - :type aks_assigned_identity: ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionPropertiesAksAssignedIdentity """ @@ -522,7 +432,6 @@ def __init__( aks_assigned_identity: Optional["ExtensionPropertiesAksAssignedIdentity"] = None, **kwargs ): -<<<<<<< HEAD """ :keyword identity: Identity of the Extension resource. :paramtype identity: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Identity @@ -554,8 +463,6 @@ def __init__( :paramtype aks_assigned_identity: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionPropertiesAksAssignedIdentity """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(Extension, self).__init__(**kwargs) self.identity = identity self.system_data = None @@ -583,15 +490,9 @@ class ExtensionPropertiesAksAssignedIdentity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str -<<<<<<< HEAD :ivar type: The identity type. The only acceptable values to pass in are None and "SystemAssigned". The default value is None. :vartype type: str -======= - :param type: The identity type. The only acceptable values to pass in are None and - "SystemAssigned". The default value is None. - :type type: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -611,14 +512,11 @@ def __init__( type: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword type: The identity type. The only acceptable values to pass in are None and "SystemAssigned". The default value is None. :paramtype type: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionPropertiesAksAssignedIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -650,11 +548,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionsList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -663,7 +558,6 @@ def __init__( class ExtensionStatus(msrest.serialization.Model): """Status from the extension. -<<<<<<< HEAD :ivar code: Status code provided by the Extension. :vartype code: str :ivar display_status: Short description of status of the extension. @@ -675,19 +569,6 @@ class ExtensionStatus(msrest.serialization.Model): :vartype message: str :ivar time: DateLiteral (per ISO8601) noting the time of installation status. :vartype time: str -======= - :param code: Status code provided by the Extension. - :type code: str - :param display_status: Short description of status of the extension. - :type display_status: str - :param level: Level of the status. Possible values include: "Error", "Warning", "Information". - Default value: "Information". - :type level: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.LevelType - :param message: Detailed message of the status from the Extension. - :type message: str - :param time: DateLiteral (per ISO8601) noting the time of installation status. - :type time: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -708,7 +589,6 @@ def __init__( time: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword code: Status code provided by the Extension. :paramtype code: str @@ -723,8 +603,6 @@ def __init__( :keyword time: DateLiteral (per ISO8601) noting the time of installation status. :paramtype time: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionStatus, self).__init__(**kwargs) self.code = code self.display_status = display_status @@ -769,11 +647,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionType, self).__init__(**kwargs) self.system_data = None self.release_trains = None @@ -784,18 +659,11 @@ def __init__( class ExtensionTypeList(msrest.serialization.Model): """List Extension Types. -<<<<<<< HEAD :ivar value: The list of Extension Types. :vartype value: list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionType] :ivar next_link: The link to fetch the next page of Extension Types. :vartype next_link: str -======= - :param value: The list of Extension Types. - :type value: list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionType] - :param next_link: The link to fetch the next page of Extension Types. - :type next_link: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -810,7 +678,6 @@ def __init__( next_link: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword value: The list of Extension Types. :paramtype value: @@ -818,8 +685,6 @@ def __init__( :keyword next_link: The link to fetch the next page of Extension Types. :paramtype next_link: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionTypeList, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -830,19 +695,11 @@ class ExtensionVersionList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. -<<<<<<< HEAD :ivar versions: Versions available for this Extension Type. :vartype versions: list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionVersionListVersionsItem] :ivar next_link: The link to fetch the next page of Extension Types. :vartype next_link: str -======= - :param versions: Versions available for this Extension Type. - :type versions: - list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionVersionListVersionsItem] - :param next_link: The link to fetch the next page of Extension Types. - :type next_link: str ->>>>>>> 331f997c (updating to the latest vendored sdk) :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SystemData """ @@ -864,7 +721,6 @@ def __init__( next_link: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword versions: Versions available for this Extension Type. :paramtype versions: @@ -872,8 +728,6 @@ def __init__( :keyword next_link: The link to fetch the next page of Extension Types. :paramtype next_link: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionVersionList, self).__init__(**kwargs) self.versions = versions self.next_link = next_link @@ -883,17 +737,10 @@ def __init__( class ExtensionVersionListVersionsItem(msrest.serialization.Model): """ExtensionVersionListVersionsItem. -<<<<<<< HEAD :ivar release_train: The release train for this Extension Type. :vartype release_train: str :ivar versions: Versions available for this Extension Type and release train. :vartype versions: list[str] -======= - :param release_train: The release train for this Extension Type. - :type release_train: str - :param versions: Versions available for this Extension Type and release train. - :type versions: list[str] ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -908,15 +755,12 @@ def __init__( versions: Optional[List[str]] = None, **kwargs ): -<<<<<<< HEAD """ :keyword release_train: The release train for this Extension Type. :paramtype release_train: str :keyword versions: Versions available for this Extension Type and release train. :paramtype versions: list[str] """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ExtensionVersionListVersionsItem, self).__init__(**kwargs) self.release_train = release_train self.versions = versions @@ -938,7 +782,6 @@ class FluxConfiguration(ProxyResource): :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SystemData -<<<<<<< HEAD :ivar scope: Scope at which the operator will be installed. Possible values include: "cluster", "namespace". Default value: "cluster". :vartype scope: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ScopeType @@ -962,31 +805,6 @@ class FluxConfiguration(ProxyResource): :ivar configuration_protected_settings: Key-value pairs of protected configuration settings for the configuration. :vartype configuration_protected_settings: dict[str, str] -======= - :param scope: Scope at which the operator will be installed. Possible values include: - "cluster", "namespace". Default value: "cluster". - :type scope: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ScopeType - :param namespace: The namespace to which this configuration is installed to. Maximum of 253 - lower case alphanumeric characters, hyphen and period only. - :type namespace: str - :param source_kind: Source Kind to pull the configuration data from. Possible values include: - "GitRepository". - :type source_kind: str or - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceKindType - :param suspend: Whether this configuration should suspend its reconciliation of its - kustomizations and sources. - :type suspend: bool - :param git_repository: Parameters to reconcile to the GitRepository source kind type. - :type git_repository: - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.GitRepositoryDefinition - :param kustomizations: Array of kustomizations used to reconcile the artifact pulled by the - source type on the cluster. - :type kustomizations: dict[str, - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.KustomizationDefinition] - :param configuration_protected_settings: Key-value pairs of protected configuration settings - for the configuration. - :type configuration_protected_settings: dict[str, str] ->>>>>>> 331f997c (updating to the latest vendored sdk) :ivar statuses: Statuses of the Flux Kubernetes resources created by the fluxConfiguration or created by the managed objects provisioned by the fluxConfiguration. :vartype statuses: @@ -1060,7 +878,6 @@ def __init__( configuration_protected_settings: Optional[Dict[str, str]] = None, **kwargs ): -<<<<<<< HEAD """ :keyword scope: Scope at which the operator will be installed. Possible values include: "cluster", "namespace". Default value: "cluster". @@ -1087,8 +904,6 @@ def __init__( for the configuration. :paramtype configuration_protected_settings: dict[str, str] """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(FluxConfiguration, self).__init__(**kwargs) self.system_data = None self.scope = scope @@ -1110,7 +925,6 @@ def __init__( class FluxConfigurationPatch(msrest.serialization.Model): """The Flux Configuration Patch Request object. -<<<<<<< HEAD :ivar source_kind: Source Kind to pull the configuration data from. Possible values include: "GitRepository". :vartype source_kind: str or @@ -1128,25 +942,6 @@ class FluxConfigurationPatch(msrest.serialization.Model): :ivar configuration_protected_settings: Key-value pairs of protected configuration settings for the configuration. :vartype configuration_protected_settings: dict[str, str] -======= - :param source_kind: Source Kind to pull the configuration data from. Possible values include: - "GitRepository". - :type source_kind: str or - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceKindType - :param suspend: Whether this configuration should suspend its reconciliation of its - kustomizations and sources. - :type suspend: bool - :param git_repository: Parameters to reconcile to the GitRepository source kind type. - :type git_repository: - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.GitRepositoryDefinition - :param kustomizations: Array of kustomizations used to reconcile the artifact pulled by the - source type on the cluster. - :type kustomizations: dict[str, - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.KustomizationDefinition] - :param configuration_protected_settings: Key-value pairs of protected configuration settings - for the configuration. - :type configuration_protected_settings: dict[str, str] ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1167,7 +962,6 @@ def __init__( configuration_protected_settings: Optional[Dict[str, str]] = None, **kwargs ): -<<<<<<< HEAD """ :keyword source_kind: Source Kind to pull the configuration data from. Possible values include: "GitRepository". @@ -1187,8 +981,6 @@ def __init__( for the configuration. :paramtype configuration_protected_settings: dict[str, str] """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(FluxConfigurationPatch, self).__init__(**kwargs) self.source_kind = source_kind self.suspend = suspend @@ -1223,11 +1015,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(FluxConfigurationsList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -1236,7 +1025,6 @@ def __init__( class GitRepositoryDefinition(msrest.serialization.Model): """Parameters to reconcile to the GitRepository source kind type. -<<<<<<< HEAD :ivar url: The URL to sync for the flux configuration git repository. :vartype url: str :ivar timeout_in_seconds: The maximum time to attempt to reconcile the cluster git repository @@ -1260,31 +1048,6 @@ class GitRepositoryDefinition(msrest.serialization.Model): :ivar local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets. :vartype local_auth_ref: str -======= - :param url: The URL to sync for the flux configuration git repository. - :type url: str - :param timeout_in_seconds: The maximum time to attempt to reconcile the cluster git repository - source with the remote. - :type timeout_in_seconds: long - :param sync_interval_in_seconds: The interval at which to re-reconcile the cluster git - repository source with the remote. - :type sync_interval_in_seconds: long - :param repository_ref: The source reference for the GitRepository object. - :type repository_ref: - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.RepositoryRefDefinition - :param ssh_known_hosts: Base64-encoded known_hosts value containing public SSH keys required to - access private git repositories over SSH. - :type ssh_known_hosts: str - :param https_user: Base64-encoded HTTPS username used to access private git repositories over - HTTPS. - :type https_user: str - :param https_ca_file: Base64-encoded HTTPS certificate authority contents used to access git - private git repositories over HTTPS. - :type https_ca_file: str - :param local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the - authentication secret rather than the managed or user-provided configuration secrets. - :type local_auth_ref: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1311,7 +1074,6 @@ def __init__( local_auth_ref: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword url: The URL to sync for the flux configuration git repository. :paramtype url: str @@ -1337,8 +1099,6 @@ def __init__( authentication secret rather than the managed or user-provided configuration secrets. :paramtype local_auth_ref: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(GitRepositoryDefinition, self).__init__(**kwargs) self.url = url self.timeout_in_seconds = timeout_in_seconds @@ -1353,17 +1113,10 @@ def __init__( class HelmOperatorProperties(msrest.serialization.Model): """Properties for Helm operator. -<<<<<<< HEAD :ivar chart_version: Version of the operator Helm chart. :vartype chart_version: str :ivar chart_values: Values override for the operator Helm chart. :vartype chart_values: str -======= - :param chart_version: Version of the operator Helm chart. - :type chart_version: str - :param chart_values: Values override for the operator Helm chart. - :type chart_values: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1378,15 +1131,12 @@ def __init__( chart_values: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword chart_version: Version of the operator Helm chart. :paramtype chart_version: str :keyword chart_values: Values override for the operator Helm chart. :paramtype chart_values: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(HelmOperatorProperties, self).__init__(**kwargs) self.chart_version = chart_version self.chart_values = chart_values @@ -1395,7 +1145,6 @@ def __init__( class HelmReleasePropertiesDefinition(msrest.serialization.Model): """HelmReleasePropertiesDefinition. -<<<<<<< HEAD :ivar last_revision_applied: The revision number of the last released object change. :vartype last_revision_applied: long :ivar helm_chart_ref: The reference to the HelmChart object used as the source to this @@ -1408,20 +1157,6 @@ class HelmReleasePropertiesDefinition(msrest.serialization.Model): :vartype install_failure_count: long :ivar upgrade_failure_count: Number of times that the HelmRelease failed to upgrade. :vartype upgrade_failure_count: long -======= - :param last_revision_applied: The revision number of the last released object change. - :type last_revision_applied: long - :param helm_chart_ref: The reference to the HelmChart object used as the source to this - HelmRelease. - :type helm_chart_ref: - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ObjectReferenceDefinition - :param failure_count: Total number of times that the HelmRelease failed to install or upgrade. - :type failure_count: long - :param install_failure_count: Number of times that the HelmRelease failed to install. - :type install_failure_count: long - :param upgrade_failure_count: Number of times that the HelmRelease failed to upgrade. - :type upgrade_failure_count: long ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1442,7 +1177,6 @@ def __init__( upgrade_failure_count: Optional[int] = None, **kwargs ): -<<<<<<< HEAD """ :keyword last_revision_applied: The revision number of the last released object change. :paramtype last_revision_applied: long @@ -1458,8 +1192,6 @@ def __init__( :keyword upgrade_failure_count: Number of times that the HelmRelease failed to upgrade. :paramtype upgrade_failure_count: long """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(HelmReleasePropertiesDefinition, self).__init__(**kwargs) self.last_revision_applied = last_revision_applied self.helm_chart_ref = helm_chart_ref @@ -1477,15 +1209,9 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str -<<<<<<< HEAD :ivar type: The identity type. The only acceptable values to pass in are None and "SystemAssigned". The default value is None. :vartype type: str -======= - :param type: The identity type. The only acceptable values to pass in are None and - "SystemAssigned". The default value is None. - :type type: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _validation = { @@ -1505,14 +1231,11 @@ def __init__( type: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword type: The identity type. The only acceptable values to pass in are None and "SystemAssigned". The default value is None. :paramtype type: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(Identity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -1522,7 +1245,6 @@ def __init__( class KustomizationDefinition(msrest.serialization.Model): """The Kustomization defining how to reconcile the artifact pulled by the source type on the cluster. -<<<<<<< HEAD :ivar path: The path in the source reference to reconcile on the cluster. :vartype path: str :ivar depends_on: Specifies other Kustomizations that this Kustomization depends on. This @@ -1549,34 +1271,6 @@ class KustomizationDefinition(msrest.serialization.Model): :ivar force: Enable/disable re-creating Kubernetes resources on the cluster when patching fails due to an immutable field change. :vartype force: bool -======= - :param path: The path in the source reference to reconcile on the cluster. - :type path: str - :param depends_on: Specifies other Kustomizations that this Kustomization depends on. This - Kustomization will not reconcile until all dependencies have completed their reconciliation. - :type depends_on: - list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.DependsOnDefinition] - :param timeout_in_seconds: The maximum time to attempt to reconcile the Kustomization on the - cluster. - :type timeout_in_seconds: long - :param sync_interval_in_seconds: The interval at which to re-reconcile the Kustomization on the - cluster. - :type sync_interval_in_seconds: long - :param retry_interval_in_seconds: The interval at which to re-reconcile the Kustomization on - the cluster in the event of failure on reconciliation. - :type retry_interval_in_seconds: long - :param prune: Enable/disable garbage collections of Kubernetes objects created by this - Kustomization. - :type prune: bool - :param validation: Specify whether to validate the Kubernetes objects referenced in the - Kustomization before applying them to the cluster. Possible values include: "none", "client", - "server". Default value: "none". - :type validation: str or - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.KustomizationValidationType - :param force: Enable/disable re-creating Kubernetes resources on the cluster when patching - fails due to an immutable field change. - :type force: bool ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1603,7 +1297,6 @@ def __init__( force: Optional[bool] = False, **kwargs ): -<<<<<<< HEAD """ :keyword path: The path in the source reference to reconcile on the cluster. :paramtype path: str @@ -1632,8 +1325,6 @@ def __init__( fails due to an immutable field change. :paramtype force: bool """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(KustomizationDefinition, self).__init__(**kwargs) self.path = path self.depends_on = depends_on @@ -1648,17 +1339,10 @@ def __init__( class ObjectReferenceDefinition(msrest.serialization.Model): """Object reference to a Kubernetes object on a cluster. -<<<<<<< HEAD :ivar name: Name of the object. :vartype name: str :ivar namespace: Namespace of the object. :vartype namespace: str -======= - :param name: Name of the object. - :type name: str - :param namespace: Namespace of the object. - :type namespace: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1673,15 +1357,12 @@ def __init__( namespace: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword name: Name of the object. :paramtype name: str :keyword namespace: Namespace of the object. :paramtype namespace: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ObjectReferenceDefinition, self).__init__(**kwargs) self.name = name self.namespace = namespace @@ -1690,7 +1371,6 @@ def __init__( class ObjectStatusConditionDefinition(msrest.serialization.Model): """Status condition of Kubernetes object. -<<<<<<< HEAD :ivar last_transition_time: Last time this status condition has changed. :vartype last_transition_time: ~datetime.datetime :ivar message: A more verbose description of the object status condition. @@ -1701,18 +1381,6 @@ class ObjectStatusConditionDefinition(msrest.serialization.Model): :vartype status: str :ivar type: Object status condition type for this object. :vartype type: str -======= - :param last_transition_time: Last time this status condition has changed. - :type last_transition_time: ~datetime.datetime - :param message: A more verbose description of the object status condition. - :type message: str - :param reason: Reason for the specified status condition type status. - :type reason: str - :param status: Status of the Kubernetes object condition type. - :type status: str - :param type: Object status condition type for this object. - :type type: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -1733,7 +1401,6 @@ def __init__( type: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword last_transition_time: Last time this status condition has changed. :paramtype last_transition_time: ~datetime.datetime @@ -1746,8 +1413,6 @@ def __init__( :keyword type: Object status condition type for this object. :paramtype type: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ObjectStatusConditionDefinition, self).__init__(**kwargs) self.last_transition_time = last_transition_time self.message = message @@ -1759,7 +1424,6 @@ def __init__( class ObjectStatusDefinition(msrest.serialization.Model): """Statuses of objects deployed by the user-specified kustomizations from the git repository. -<<<<<<< HEAD :ivar name: Name of the applied object. :vartype name: str :ivar namespace: Namespace of the applied object. @@ -1780,28 +1444,6 @@ class ObjectStatusDefinition(msrest.serialization.Model): :ivar helm_release_properties: Additional properties that are provided from objects of the HelmRelease kind. :vartype helm_release_properties: -======= - :param name: Name of the applied object. - :type name: str - :param namespace: Namespace of the applied object. - :type namespace: str - :param kind: Kind of the applied object. - :type kind: str - :param compliance_state: Compliance state of the applied object showing whether the applied - object has come into a ready state on the cluster. Possible values include: "Compliant", - "Non-Compliant", "Pending", "Suspended", "Unknown". Default value: "Unknown". - :type compliance_state: str or - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxComplianceState - :param applied_by: Object reference to the Kustomization that applied this object. - :type applied_by: - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ObjectReferenceDefinition - :param status_conditions: List of Kubernetes object status conditions present on the cluster. - :type status_conditions: - list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ObjectStatusConditionDefinition] - :param helm_release_properties: Additional properties that are provided from objects of the - HelmRelease kind. - :type helm_release_properties: ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.HelmReleasePropertiesDefinition """ @@ -1827,7 +1469,6 @@ def __init__( helm_release_properties: Optional["HelmReleasePropertiesDefinition"] = None, **kwargs ): -<<<<<<< HEAD """ :keyword name: Name of the applied object. :paramtype name: str @@ -1851,8 +1492,6 @@ def __init__( :paramtype helm_release_properties: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.HelmReleasePropertiesDefinition """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ObjectStatusDefinition, self).__init__(**kwargs) self.name = name self.namespace = namespace @@ -1889,11 +1528,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(OperationStatusList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -1906,7 +1542,6 @@ class OperationStatusResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. -<<<<<<< HEAD :ivar id: Fully qualified ID for the async operation. :vartype id: str :ivar name: Name of the async operation. @@ -1915,16 +1550,6 @@ class OperationStatusResult(msrest.serialization.Model): :vartype status: str :ivar properties: Additional information, if available. :vartype properties: dict[str, str] -======= - :param id: Fully qualified ID for the async operation. - :type id: str - :param name: Name of the async operation. - :type name: str - :param status: Required. Operation status. - :type status: str - :param properties: Additional information, if available. - :type properties: dict[str, str] ->>>>>>> 331f997c (updating to the latest vendored sdk) :ivar error: If present, details of the operation error. :vartype error: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ErrorDetail """ @@ -1951,7 +1576,6 @@ def __init__( properties: Optional[Dict[str, str]] = None, **kwargs ): -<<<<<<< HEAD """ :keyword id: Fully qualified ID for the async operation. :paramtype id: str @@ -1962,8 +1586,6 @@ def __init__( :keyword properties: Additional information, if available. :paramtype properties: dict[str, str] """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(OperationStatusResult, self).__init__(**kwargs) self.id = id self.name = name @@ -1975,7 +1597,6 @@ def __init__( class PatchExtension(msrest.serialization.Model): """The Extension Patch Request object. -<<<<<<< HEAD :ivar auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade of minor version, or not. :vartype auto_upgrade_minor_version: bool @@ -1991,23 +1612,6 @@ class PatchExtension(msrest.serialization.Model): :ivar configuration_protected_settings: Configuration settings that are sensitive, as name-value pairs for configuring this extension. :vartype configuration_protected_settings: dict[str, str] -======= - :param auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade - of minor version, or not. - :type auto_upgrade_minor_version: bool - :param release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. - Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. - :type release_train: str - :param version: Version of the extension for this extension, if it is 'pinned' to a specific - version. autoUpgradeMinorVersion must be 'false'. - :type version: str - :param configuration_settings: Configuration settings, as name-value pairs for configuring this - extension. - :type configuration_settings: dict[str, str] - :param configuration_protected_settings: Configuration settings that are sensitive, as - name-value pairs for configuring this extension. - :type configuration_protected_settings: dict[str, str] ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -2028,7 +1632,6 @@ def __init__( configuration_protected_settings: Optional[Dict[str, str]] = None, **kwargs ): -<<<<<<< HEAD """ :keyword auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade of minor version, or not. @@ -2046,8 +1649,6 @@ def __init__( name-value pairs for configuring this extension. :paramtype configuration_protected_settings: dict[str, str] """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(PatchExtension, self).__init__(**kwargs) self.auto_upgrade_minor_version = auto_upgrade_minor_version self.release_train = release_train @@ -2059,7 +1660,6 @@ def __init__( class RepositoryRefDefinition(msrest.serialization.Model): """The source reference for the GitRepository object. -<<<<<<< HEAD :ivar branch: The git repository branch name to checkout. :vartype branch: str :ivar tag: The git repository tag name to checkout. This takes precedence over branch. @@ -2070,18 +1670,6 @@ class RepositoryRefDefinition(msrest.serialization.Model): :ivar commit: The commit SHA to checkout. This value must be combined with the branch name to be valid. This takes precedence over semver. :vartype commit: str -======= - :param branch: The git repository branch name to checkout. - :type branch: str - :param tag: The git repository tag name to checkout. This takes precedence over branch. - :type tag: str - :param semver: The semver range used to match against git repository tags. This takes - precedence over tag. - :type semver: str - :param commit: The commit SHA to checkout. This value must be combined with the branch name to - be valid. This takes precedence over semver. - :type commit: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -2100,7 +1688,6 @@ def __init__( commit: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword branch: The git repository branch name to checkout. :paramtype branch: str @@ -2113,8 +1700,6 @@ def __init__( to be valid. This takes precedence over semver. :paramtype commit: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(RepositoryRefDefinition, self).__init__(**kwargs) self.branch = branch self.tag = tag @@ -2127,17 +1712,10 @@ class ResourceProviderOperation(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. -<<<<<<< HEAD :ivar name: Operation name, in format of {provider}/{resource}/{operation}. :vartype name: str :ivar display: Display metadata associated with the operation. :vartype display: -======= - :param name: Operation name, in format of {provider}/{resource}/{operation}. - :type name: str - :param display: Display metadata associated with the operation. - :type display: ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ResourceProviderOperationDisplay :ivar is_data_action: The flag that indicates whether the operation applies to data plane. :vartype is_data_action: bool @@ -2164,7 +1742,6 @@ def __init__( display: Optional["ResourceProviderOperationDisplay"] = None, **kwargs ): -<<<<<<< HEAD """ :keyword name: Operation name, in format of {provider}/{resource}/{operation}. :paramtype name: str @@ -2172,8 +1749,6 @@ def __init__( :paramtype display: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ResourceProviderOperationDisplay """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperation, self).__init__(**kwargs) self.name = name self.display = display @@ -2184,7 +1759,6 @@ def __init__( class ResourceProviderOperationDisplay(msrest.serialization.Model): """Display metadata associated with the operation. -<<<<<<< HEAD :ivar provider: Resource provider: Microsoft KubernetesConfiguration. :vartype provider: str :ivar resource: Resource on which the operation is performed. @@ -2193,16 +1767,6 @@ class ResourceProviderOperationDisplay(msrest.serialization.Model): :vartype operation: str :ivar description: Description of this operation. :vartype description: str -======= - :param provider: Resource provider: Microsoft KubernetesConfiguration. - :type provider: str - :param resource: Resource on which the operation is performed. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of this operation. - :type description: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -2221,7 +1785,6 @@ def __init__( description: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword provider: Resource provider: Microsoft KubernetesConfiguration. :paramtype provider: str @@ -2232,8 +1795,6 @@ def __init__( :keyword description: Description of this operation. :paramtype description: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperationDisplay, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -2246,13 +1807,8 @@ class ResourceProviderOperationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. -<<<<<<< HEAD :ivar value: List of operations supported by this resource provider. :vartype value: -======= - :param value: List of operations supported by this resource provider. - :type value: ->>>>>>> 331f997c (updating to the latest vendored sdk) list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ResourceProviderOperation] :ivar next_link: URL to the next set of results, if any. :vartype next_link: str @@ -2273,14 +1829,11 @@ def __init__( value: Optional[List["ResourceProviderOperation"]] = None, **kwargs ): -<<<<<<< HEAD """ :keyword value: List of operations supported by this resource provider. :paramtype value: list[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ResourceProviderOperation] """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ResourceProviderOperationList, self).__init__(**kwargs) self.value = value self.next_link = None @@ -2289,18 +1842,11 @@ def __init__( class Scope(msrest.serialization.Model): """Scope of the extension. It can be either Cluster or Namespace; but not both. -<<<<<<< HEAD :ivar cluster: Specifies that the scope of the extension is Cluster. :vartype cluster: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ScopeCluster :ivar namespace: Specifies that the scope of the extension is Namespace. :vartype namespace: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ScopeNamespace -======= - :param cluster: Specifies that the scope of the extension is Cluster. - :type cluster: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ScopeCluster - :param namespace: Specifies that the scope of the extension is Namespace. - :type namespace: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ScopeNamespace ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -2315,7 +1861,6 @@ def __init__( namespace: Optional["ScopeNamespace"] = None, **kwargs ): -<<<<<<< HEAD """ :keyword cluster: Specifies that the scope of the extension is Cluster. :paramtype cluster: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ScopeCluster @@ -2323,8 +1868,6 @@ def __init__( :paramtype namespace: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ScopeNamespace """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(Scope, self).__init__(**kwargs) self.cluster = cluster self.namespace = namespace @@ -2333,15 +1876,9 @@ def __init__( class ScopeCluster(msrest.serialization.Model): """Specifies that the scope of the extension is Cluster. -<<<<<<< HEAD :ivar release_namespace: Namespace where the extension Release must be placed, for a Cluster scoped extension. If this namespace does not exist, it will be created. :vartype release_namespace: str -======= - :param release_namespace: Namespace where the extension Release must be placed, for a Cluster - scoped extension. If this namespace does not exist, it will be created. - :type release_namespace: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -2354,14 +1891,11 @@ def __init__( release_namespace: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword release_namespace: Namespace where the extension Release must be placed, for a Cluster scoped extension. If this namespace does not exist, it will be created. :paramtype release_namespace: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ScopeCluster, self).__init__(**kwargs) self.release_namespace = release_namespace @@ -2369,15 +1903,9 @@ def __init__( class ScopeNamespace(msrest.serialization.Model): """Specifies that the scope of the extension is Namespace. -<<<<<<< HEAD :ivar target_namespace: Namespace where the extension will be created for an Namespace scoped extension. If this namespace does not exist, it will be created. :vartype target_namespace: str -======= - :param target_namespace: Namespace where the extension will be created for an Namespace scoped - extension. If this namespace does not exist, it will be created. - :type target_namespace: str ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -2390,14 +1918,11 @@ def __init__( target_namespace: Optional[str] = None, **kwargs ): -<<<<<<< HEAD """ :keyword target_namespace: Namespace where the extension will be created for an Namespace scoped extension. If this namespace does not exist, it will be created. :paramtype target_namespace: str """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(ScopeNamespace, self).__init__(**kwargs) self.target_namespace = target_namespace @@ -2418,7 +1943,6 @@ class SourceControlConfiguration(ProxyResource): :ivar system_data: Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SystemData -<<<<<<< HEAD :ivar repository_url: Url of the SourceControl Repository. :vartype repository_url: str :ivar operator_namespace: The namespace to which this operator is installed to. Maximum of 253 @@ -2438,32 +1962,10 @@ class SourceControlConfiguration(ProxyResource): :ivar operator_scope: Scope at which the operator will be installed. Possible values include: "cluster", "namespace". Default value: "cluster". :vartype operator_scope: str or -======= - :param repository_url: Url of the SourceControl Repository. - :type repository_url: str - :param operator_namespace: The namespace to which this operator is installed to. Maximum of 253 - lower case alphanumeric characters, hyphen and period only. - :type operator_namespace: str - :param operator_instance_name: Instance name of the operator - identifying the specific - configuration. - :type operator_instance_name: str - :param operator_type: Type of the operator. Possible values include: "Flux". - :type operator_type: str or - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.OperatorType - :param operator_params: Any Parameters for the Operator instance in string format. - :type operator_params: str - :param configuration_protected_settings: Name-value pairs of protected configuration settings - for the configuration. - :type configuration_protected_settings: dict[str, str] - :param operator_scope: Scope at which the operator will be installed. Possible values include: - "cluster", "namespace". Default value: "cluster". - :type operator_scope: str or ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.OperatorScopeType :ivar repository_public_key: Public Key associated with this SourceControl configuration (either generated within the cluster or provided by the user). :vartype repository_public_key: str -<<<<<<< HEAD :ivar ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys required to access private Git instances. :vartype ssh_known_hosts_contents: str @@ -2471,15 +1973,6 @@ class SourceControlConfiguration(ProxyResource): :vartype enable_helm_operator: bool :ivar helm_operator_properties: Properties for Helm operator. :vartype helm_operator_properties: -======= - :param ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys - required to access private Git instances. - :type ssh_known_hosts_contents: str - :param enable_helm_operator: Option to enable Helm Operator for this git configuration. - :type enable_helm_operator: bool - :param helm_operator_properties: Properties for Helm operator. - :type helm_operator_properties: ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.HelmOperatorProperties :ivar provisioning_state: The provisioning state of the resource provider. Possible values include: "Accepted", "Deleting", "Running", "Succeeded", "Failed". @@ -2535,7 +2028,6 @@ def __init__( helm_operator_properties: Optional["HelmOperatorProperties"] = None, **kwargs ): -<<<<<<< HEAD """ :keyword repository_url: Url of the SourceControl Repository. :paramtype repository_url: str @@ -2566,8 +2058,6 @@ def __init__( :paramtype helm_operator_properties: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.HelmOperatorProperties """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(SourceControlConfiguration, self).__init__(**kwargs) self.system_data = None self.repository_url = repository_url @@ -2611,11 +2101,8 @@ def __init__( self, **kwargs ): -<<<<<<< HEAD """ """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(SourceControlConfigurationList, self).__init__(**kwargs) self.value = None self.next_link = None @@ -2624,17 +2111,10 @@ def __init__( class SupportedScopes(msrest.serialization.Model): """Extension scopes. -<<<<<<< HEAD :ivar default_scope: Default extension scopes: cluster or namespace. :vartype default_scope: str :ivar cluster_scope_settings: Scope settings. :vartype cluster_scope_settings: -======= - :param default_scope: Default extension scopes: cluster or namespace. - :type default_scope: str - :param cluster_scope_settings: Scope settings. - :type cluster_scope_settings: ->>>>>>> 331f997c (updating to the latest vendored sdk) ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ClusterScopeSettings """ @@ -2650,7 +2130,6 @@ def __init__( cluster_scope_settings: Optional["ClusterScopeSettings"] = None, **kwargs ): -<<<<<<< HEAD """ :keyword default_scope: Default extension scopes: cluster or namespace. :paramtype default_scope: str @@ -2658,8 +2137,6 @@ def __init__( :paramtype cluster_scope_settings: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ClusterScopeSettings """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(SupportedScopes, self).__init__(**kwargs) self.default_scope = default_scope self.cluster_scope_settings = cluster_scope_settings @@ -2668,7 +2145,6 @@ def __init__( class SystemData(msrest.serialization.Model): """Metadata pertaining to creation and last modification of the resource. -<<<<<<< HEAD :ivar created_by: The identity that created the resource. :vartype created_by: str :ivar created_by_type: The type of identity that created the resource. Possible values include: @@ -2685,24 +2161,6 @@ class SystemData(msrest.serialization.Model): ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.CreatedByType :ivar last_modified_at: The timestamp of resource last modification (UTC). :vartype last_modified_at: ~datetime.datetime -======= - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or - ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.CreatedByType - :param last_modified_at: The timestamp of resource last modification (UTC). - :type last_modified_at: ~datetime.datetime ->>>>>>> 331f997c (updating to the latest vendored sdk) """ _attribute_map = { @@ -2725,7 +2183,6 @@ def __init__( last_modified_at: Optional[datetime.datetime] = None, **kwargs ): -<<<<<<< HEAD """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -2744,8 +2201,6 @@ def __init__( :keyword last_modified_at: The timestamp of resource last modification (UTC). :paramtype last_modified_at: ~datetime.datetime """ -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) super(SystemData, self).__init__(**kwargs) self.created_by = created_by self.created_by_type = created_by_type diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_source_control_configuration_client_enums.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_source_control_configuration_client_enums.py index a52d279870a..544b13b91c2 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_source_control_configuration_client_enums.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/models/_source_control_configuration_client_enums.py @@ -6,47 +6,19 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD from enum import Enum from six import with_metaclass from azure.core import CaseInsensitiveEnumMeta class ClusterTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -from enum import Enum, EnumMeta -from six import with_metaclass - -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class ClusterTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Cluster types """ CONNECTED_CLUSTERS = "connectedClusters" MANAGED_CLUSTERS = "managedClusters" -<<<<<<< HEAD class ComplianceStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class ComplianceStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """The compliance state of the configuration. """ @@ -56,11 +28,7 @@ class ComplianceStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): INSTALLED = "Installed" FAILED = "Failed" -<<<<<<< HEAD class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """The type of identity that created the resource. """ @@ -69,29 +37,17 @@ class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" -<<<<<<< HEAD class Enum0(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class Enum0(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) MICROSOFT_CONTAINER_SERVICE = "Microsoft.ContainerService" MICROSOFT_KUBERNETES = "Microsoft.Kubernetes" -<<<<<<< HEAD class Enum1(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class Enum1(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) MANAGED_CLUSTERS = "managedClusters" CONNECTED_CLUSTERS = "connectedClusters" -<<<<<<< HEAD class FluxComplianceState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class FluxComplianceState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Compliance state of the cluster object. """ @@ -101,11 +57,7 @@ class FluxComplianceState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SUSPENDED = "Suspended" UNKNOWN = "Unknown" -<<<<<<< HEAD class KustomizationValidationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class KustomizationValidationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Specify whether to validate the Kubernetes objects referenced in the Kustomization before applying them to the cluster. """ @@ -114,11 +66,7 @@ class KustomizationValidationType(with_metaclass(_CaseInsensitiveEnumMeta, str, CLIENT = "client" SERVER = "server" -<<<<<<< HEAD class LevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class LevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Level of the status. """ @@ -126,11 +74,7 @@ class LevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): WARNING = "Warning" INFORMATION = "Information" -<<<<<<< HEAD class MessageLevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class MessageLevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Level of the message. """ @@ -138,32 +82,20 @@ class MessageLevelType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): WARNING = "Warning" INFORMATION = "Information" -<<<<<<< HEAD class OperatorScopeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class OperatorScopeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Scope at which the operator will be installed. """ CLUSTER = "cluster" NAMESPACE = "namespace" -<<<<<<< HEAD class OperatorType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class OperatorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Type of the operator """ FLUX = "Flux" -<<<<<<< HEAD class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """The provisioning state of the resource. """ @@ -174,11 +106,7 @@ class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): UPDATING = "Updating" DELETING = "Deleting" -<<<<<<< HEAD class ProvisioningStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class ProvisioningStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """The provisioning state of the resource provider. """ @@ -188,22 +116,14 @@ class ProvisioningStateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) SUCCEEDED = "Succeeded" FAILED = "Failed" -<<<<<<< HEAD class ScopeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class ScopeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Scope at which the configuration will be installed. """ CLUSTER = "cluster" NAMESPACE = "namespace" -<<<<<<< HEAD class SourceKindType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): -======= -class SourceKindType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ->>>>>>> 331f997c (updating to the latest vendored sdk) """Source Kind to pull the configuration data from. """ diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_cluster_extension_type_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_cluster_extension_type_operations.py index 9d985e419b3..3521f8a7573 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_cluster_extension_type_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_cluster_extension_type_operations.py @@ -5,17 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -======= -from typing import TYPE_CHECKING ->>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -69,19 +64,6 @@ def build_get_request( headers=header_parameters, **kwargs ) -======= -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] ->>>>>>> 331f997c (updating to the latest vendored sdk) class ClusterExtensionTypeOperations(object): """ClusterExtensionTypeOperations operations. @@ -105,7 +87,6 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace def get( self, @@ -116,18 +97,6 @@ def get( extension_type_name: str, **kwargs: Any ) -> "_models.ExtensionType": -======= - def get( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_type_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ExtensionType" ->>>>>>> 331f997c (updating to the latest vendored sdk) """Get Extension Type details. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -137,12 +106,8 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_type_name: Extension type name. @@ -157,7 +122,6 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -172,42 +136,12 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionTypeName': self._serialize.url("extension_type_name", extension_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ExtensionType', pipeline_response) @@ -216,10 +150,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{extensionTypeName}'} # type: ignore -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{extensionTypeName}'} # type: ignore ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_cluster_extension_types_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_cluster_extension_types_operations.py index 778b39ddf1d..7d7e58989f9 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_cluster_extension_types_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_cluster_extension_types_operations.py @@ -5,18 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -======= -from typing import TYPE_CHECKING ->>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -68,19 +63,6 @@ def build_list_request( headers=header_parameters, **kwargs ) -======= -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] ->>>>>>> 331f997c (updating to the latest vendored sdk) class ClusterExtensionTypesOperations(object): """ClusterExtensionTypesOperations operations. @@ -104,7 +86,6 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace def list( self, @@ -114,17 +95,6 @@ def list( cluster_name: str, **kwargs: Any ) -> Iterable["_models.ExtensionTypeList"]: -======= - def list( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ExtensionTypeList"] ->>>>>>> 331f997c (updating to the latest vendored sdk) """Get Extension Types. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -134,22 +104,14 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionTypeList or the result of cls(response) -<<<<<<< HEAD :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionTypeList] -======= - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionTypeList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionTypeList"] @@ -157,7 +119,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -189,40 +150,6 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionTypeList", pipeline_response) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ExtensionTypeList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -235,21 +162,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_extension_type_versions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_extension_type_versions_operations.py index 7103eabd50f..b9e4fd842ee 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_extension_type_versions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_extension_type_versions_operations.py @@ -5,18 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -======= -from typing import TYPE_CHECKING ->>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -64,19 +59,6 @@ def build_list_request( headers=header_parameters, **kwargs ) -======= -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] ->>>>>>> 331f997c (updating to the latest vendored sdk) class ExtensionTypeVersionsOperations(object): """ExtensionTypeVersionsOperations operations. @@ -100,7 +82,6 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace def list( self, @@ -108,15 +89,6 @@ def list( extension_type_name: str, **kwargs: Any ) -> Iterable["_models.ExtensionVersionList"]: -======= - def list( - self, - location, # type: str - extension_type_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ExtensionVersionList"] ->>>>>>> 331f997c (updating to the latest vendored sdk) """List available versions for an Extension Type. :param location: extension location. @@ -124,15 +96,10 @@ def list( :param extension_type_name: Extension type name. :type extension_type_name: str :keyword callable cls: A custom type or function that will be passed the direct response -<<<<<<< HEAD :return: An iterator like instance of either ExtensionVersionList or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionVersionList] -======= - :return: An iterator like instance of either ExtensionVersionList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionVersionList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionVersionList"] @@ -140,7 +107,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -168,38 +134,6 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionVersionList", pipeline_response) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'location': self._serialize.url("location", location, 'str'), - 'extensionTypeName': self._serialize.url("extension_type_name", extension_type_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ExtensionVersionList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.versions if cls: list_of_elem = cls(list_of_elem) @@ -212,21 +146,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_extensions_operations.py index 287ba611fe8..0531c000385 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_extensions_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_extensions_operations.py @@ -5,18 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -======= -from typing import TYPE_CHECKING ->>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest @@ -257,21 +252,6 @@ def build_list_request( headers=header_parameters, **kwargs ) -======= -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] ->>>>>>> 331f997c (updating to the latest vendored sdk) class ExtensionsOperations(object): """ExtensionsOperations operations. @@ -297,7 +277,6 @@ def __init__(self, client, config, serializer, deserializer): def _create_initial( self, -<<<<<<< HEAD resource_group_name: str, cluster_rp: Union[str, "_models.Enum0"], cluster_resource_name: Union[str, "_models.Enum1"], @@ -306,23 +285,11 @@ def _create_initial( extension: "_models.Extension", **kwargs: Any ) -> "_models.Extension": -======= - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_name, # type: str - extension, # type: "_models.Extension" - **kwargs # type: Any - ): - # type: (...) -> "_models.Extension" ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -342,48 +309,12 @@ def _create_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(extension, 'Extension') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) if response.status_code == 200: deserialized = self._deserialize('Extension', pipeline_response) @@ -395,7 +326,6 @@ def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @@ -411,21 +341,6 @@ def begin_create( extension: "_models.Extension", **kwargs: Any ) -> LROPoller["_models.Extension"]: -======= - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - - def begin_create( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_name, # type: str - extension, # type: "_models.Extension" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Extension"] ->>>>>>> 331f997c (updating to the latest vendored sdk) """Create a new Kubernetes Cluster Extension. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -435,12 +350,8 @@ def begin_create( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -449,7 +360,6 @@ def begin_create( :type extension: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Extension :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. -<<<<<<< HEAD :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -463,17 +373,6 @@ def begin_create( """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] -======= - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either Extension or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] lro_delay = kwargs.pop( 'polling_interval', @@ -488,7 +387,6 @@ def begin_create( cluster_name=cluster_name, extension_name=extension_name, extension=extension, -<<<<<<< HEAD content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -498,37 +396,12 @@ def begin_create( def get_long_running_output(pipeline_response): response = pipeline_response.http_response deserialized = self._deserialize('Extension', pipeline_response) -======= - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('Extension', pipeline_response) - ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -540,7 +413,6 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @@ -554,20 +426,6 @@ def get( extension_name: str, **kwargs: Any ) -> "_models.Extension": -======= - begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Extension" ->>>>>>> 331f997c (updating to the latest vendored sdk) """Gets Kubernetes Cluster Extension. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -577,12 +435,8 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -597,7 +451,6 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -612,42 +465,12 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Extension', pipeline_response) @@ -656,7 +479,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @@ -671,27 +493,11 @@ def _delete_initial( force_delete: Optional[bool] = None, **kwargs: Any ) -> None: -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_name, # type: str - force_delete=None, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> None ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_delete_request_initial( @@ -707,52 +513,18 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if force_delete is not None: - query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore -<<<<<<< HEAD @distributed_trace def begin_delete( @@ -765,19 +537,6 @@ def begin_delete( force_delete: Optional[bool] = None, **kwargs: Any ) -> LROPoller[None]: -======= - def begin_delete( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_name, # type: str - force_delete=None, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] ->>>>>>> 331f997c (updating to the latest vendored sdk) """Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. @@ -788,12 +547,8 @@ def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -803,7 +558,6 @@ def begin_delete( :type force_delete: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. -<<<<<<< HEAD :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -815,17 +569,6 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] -======= - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -843,33 +586,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) -<<<<<<< HEAD kwargs.pop('error_map', None) -======= - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) ->>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) -<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -881,15 +605,11 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore def _update_initial( self, -<<<<<<< HEAD resource_group_name: str, cluster_rp: Union[str, "_models.Enum0"], cluster_resource_name: Union[str, "_models.Enum1"], @@ -922,64 +642,12 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_name, # type: str - patch_extension, # type: "_models.PatchExtension" - **kwargs # type: Any - ): - # type: (...) -> "_models.Extension" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: lambda response: ResourceExistsError(response=response, model=self._deserialize(_models.ErrorResponse, response), error_format=ARMErrorFormat), - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(patch_extension, 'PatchExtension') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) deserialized = self._deserialize('Extension', pipeline_response) @@ -987,7 +655,6 @@ def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @@ -1003,21 +670,6 @@ def begin_update( patch_extension: "_models.PatchExtension", **kwargs: Any ) -> LROPoller["_models.Extension"]: -======= - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - - def begin_update( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_name, # type: str - patch_extension, # type: "_models.PatchExtension" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Extension"] ->>>>>>> 331f997c (updating to the latest vendored sdk) """Patch an existing Kubernetes Cluster Extension. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -1027,18 +679,13 @@ def begin_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. :type extension_name: str :param patch_extension: Properties to Patch in an existing Extension. -<<<<<<< HEAD :type patch_extension: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.PatchExtension :keyword callable cls: A custom type or function that will be passed the direct response @@ -1056,20 +703,6 @@ def begin_update( """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] -======= - :type patch_extension: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.PatchExtension - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either Extension or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] lro_delay = kwargs.pop( 'polling_interval', @@ -1084,7 +717,6 @@ def begin_update( cluster_name=cluster_name, extension_name=extension_name, patch_extension=patch_extension, -<<<<<<< HEAD content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -1094,37 +726,12 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response deserialized = self._deserialize('Extension', pipeline_response) -======= - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('Extension', pipeline_response) - ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1136,7 +743,6 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore @@ -1149,19 +755,6 @@ def list( cluster_name: str, **kwargs: Any ) -> Iterable["_models.ExtensionsList"]: -======= - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ExtensionsList"] ->>>>>>> 331f997c (updating to the latest vendored sdk) """List all Extensions in the cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -1171,22 +764,14 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionsList or the result of cls(response) -<<<<<<< HEAD :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionsList] -======= - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionsList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionsList"] @@ -1194,7 +779,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -1226,40 +810,6 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionsList", pipeline_response) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ExtensionsList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1272,21 +822,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_flux_config_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_flux_config_operation_status_operations.py index fcab06502d7..dea63e7dac3 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_flux_config_operation_status_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_flux_config_operation_status_operations.py @@ -5,17 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -======= -from typing import TYPE_CHECKING ->>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -71,19 +66,6 @@ def build_get_request( headers=header_parameters, **kwargs ) -======= -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] ->>>>>>> 331f997c (updating to the latest vendored sdk) class FluxConfigOperationStatusOperations(object): """FluxConfigOperationStatusOperations operations. @@ -107,7 +89,6 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace def get( self, @@ -119,19 +100,6 @@ def get( operation_id: str, **kwargs: Any ) -> "_models.OperationStatusResult": -======= - def get( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - flux_configuration_name, # type: str - operation_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OperationStatusResult" ->>>>>>> 331f997c (updating to the latest vendored sdk) """Get Async Operation status. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -141,12 +109,8 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param flux_configuration_name: Name of the Flux Configuration. @@ -163,7 +127,6 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -179,43 +142,12 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OperationStatusResult', pipeline_response) @@ -224,10 +156,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}/operations/{operationId}'} # type: ignore -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}/operations/{operationId}'} # type: ignore ->>>>>>> 331f997c (updating to the latest vendored sdk) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_flux_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_flux_configurations_operations.py index a9517c7dfce..c3d3cf613ba 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_flux_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_flux_configurations_operations.py @@ -5,18 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -======= -from typing import TYPE_CHECKING ->>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest @@ -257,21 +252,6 @@ def build_list_request( headers=header_parameters, **kwargs ) -======= -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] ->>>>>>> 331f997c (updating to the latest vendored sdk) class FluxConfigurationsOperations(object): """FluxConfigurationsOperations operations. @@ -295,7 +275,6 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace def get( self, @@ -306,18 +285,6 @@ def get( flux_configuration_name: str, **kwargs: Any ) -> "_models.FluxConfiguration": -======= - def get( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - flux_configuration_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FluxConfiguration" ->>>>>>> 331f997c (updating to the latest vendored sdk) """Gets details of the Flux Configuration. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -327,12 +294,8 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param flux_configuration_name: Name of the Flux Configuration. @@ -347,7 +310,6 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -362,42 +324,12 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('FluxConfiguration', pipeline_response) @@ -406,7 +338,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore @@ -445,68 +376,12 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - flux_configuration_name, # type: str - flux_configuration, # type: "_models.FluxConfiguration" - **kwargs # type: Any - ): - # type: (...) -> "_models.FluxConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: lambda response: ResourceExistsError(response=response, model=self._deserialize(_models.ErrorResponse, response), error_format=ARMErrorFormat), - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(flux_configuration, 'FluxConfiguration') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) if response.status_code == 200: deserialized = self._deserialize('FluxConfiguration', pipeline_response) @@ -518,7 +393,6 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore @@ -534,21 +408,6 @@ def begin_create_or_update( flux_configuration: "_models.FluxConfiguration", **kwargs: Any ) -> LROPoller["_models.FluxConfiguration"]: -======= - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - flux_configuration_name, # type: str - flux_configuration, # type: "_models.FluxConfiguration" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FluxConfiguration"] ->>>>>>> 331f997c (updating to the latest vendored sdk) """Create a new Kubernetes Flux Configuration. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -558,18 +417,13 @@ def begin_create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param flux_configuration_name: Name of the Flux Configuration. :type flux_configuration_name: str :param flux_configuration: Properties necessary to Create a FluxConfiguration. -<<<<<<< HEAD :type flux_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfiguration :keyword callable cls: A custom type or function that will be passed the direct response @@ -588,20 +442,6 @@ def begin_create_or_update( """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] -======= - :type flux_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfiguration - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either FluxConfiguration or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfiguration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] lro_delay = kwargs.pop( 'polling_interval', @@ -616,7 +456,6 @@ def begin_create_or_update( cluster_name=cluster_name, flux_configuration_name=flux_configuration_name, flux_configuration=flux_configuration, -<<<<<<< HEAD content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -626,37 +465,12 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response deserialized = self._deserialize('FluxConfiguration', pipeline_response) -======= - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('FluxConfiguration', pipeline_response) - ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -668,15 +482,11 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore def _update_initial( self, -<<<<<<< HEAD resource_group_name: str, cluster_rp: Union[str, "_models.Enum0"], cluster_resource_name: Union[str, "_models.Enum1"], @@ -709,64 +519,12 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - flux_configuration_name, # type: str - flux_configuration_patch, # type: "_models.FluxConfigurationPatch" - **kwargs # type: Any - ): - # type: (...) -> "_models.FluxConfiguration" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: lambda response: ResourceExistsError(response=response, model=self._deserialize(_models.ErrorResponse, response), error_format=ARMErrorFormat), - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(flux_configuration_patch, 'FluxConfigurationPatch') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) deserialized = self._deserialize('FluxConfiguration', pipeline_response) @@ -774,7 +532,6 @@ def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore @@ -790,21 +547,6 @@ def begin_update( flux_configuration_patch: "_models.FluxConfigurationPatch", **kwargs: Any ) -> LROPoller["_models.FluxConfiguration"]: -======= - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore - - def begin_update( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - flux_configuration_name, # type: str - flux_configuration_patch, # type: "_models.FluxConfigurationPatch" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FluxConfiguration"] ->>>>>>> 331f997c (updating to the latest vendored sdk) """Update an existing Kubernetes Flux Configuration. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -814,18 +556,13 @@ def begin_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param flux_configuration_name: Name of the Flux Configuration. :type flux_configuration_name: str :param flux_configuration_patch: Properties to Patch in an existing Flux Configuration. -<<<<<<< HEAD :type flux_configuration_patch: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfigurationPatch :keyword callable cls: A custom type or function that will be passed the direct response @@ -844,20 +581,6 @@ def begin_update( """ content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] -======= - :type flux_configuration_patch: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfigurationPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either FluxConfiguration or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfiguration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] lro_delay = kwargs.pop( 'polling_interval', @@ -872,7 +595,6 @@ def begin_update( cluster_name=cluster_name, flux_configuration_name=flux_configuration_name, flux_configuration_patch=flux_configuration_patch, -<<<<<<< HEAD content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -882,37 +604,12 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response deserialized = self._deserialize('FluxConfiguration', pipeline_response) -======= - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('FluxConfiguration', pipeline_response) - ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -924,15 +621,11 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore def _delete_initial( self, -<<<<<<< HEAD resource_group_name: str, cluster_rp: Union[str, "_models.Enum0"], cluster_resource_name: Union[str, "_models.Enum1"], @@ -941,23 +634,11 @@ def _delete_initial( force_delete: Optional[bool] = None, **kwargs: Any ) -> None: -======= - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - flux_configuration_name, # type: str - force_delete=None, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> None ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_delete_request_initial( @@ -973,52 +654,18 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if force_delete is not None: - query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore -<<<<<<< HEAD @distributed_trace def begin_delete( @@ -1031,19 +678,6 @@ def begin_delete( force_delete: Optional[bool] = None, **kwargs: Any ) -> LROPoller[None]: -======= - def begin_delete( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - flux_configuration_name, # type: str - force_delete=None, # type: Optional[bool] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] ->>>>>>> 331f997c (updating to the latest vendored sdk) """This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the source repo. @@ -1054,12 +688,8 @@ def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param flux_configuration_name: Name of the Flux Configuration. @@ -1069,7 +699,6 @@ def begin_delete( :type force_delete: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. -<<<<<<< HEAD :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -1081,17 +710,6 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] -======= - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1109,33 +727,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) -<<<<<<< HEAD - kwargs.pop('error_map', None) -======= - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) ->>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) -<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'fluxConfigurationName': self._serialize.url("flux_configuration_name", flux_configuration_name, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1147,7 +746,6 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore @@ -1160,19 +758,6 @@ def list( cluster_name: str, **kwargs: Any ) -> Iterable["_models.FluxConfigurationsList"]: -======= - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FluxConfigurationsList"] ->>>>>>> 331f997c (updating to the latest vendored sdk) """List all Flux Configurations. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -1182,7 +767,6 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -1192,14 +776,6 @@ def list( cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfigurationsList] -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 - :param cluster_name: The name of the kubernetes cluster. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FluxConfigurationsList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.FluxConfigurationsList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfigurationsList"] @@ -1207,7 +783,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -1239,40 +814,6 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("FluxConfigurationsList", pipeline_response) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('FluxConfigurationsList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1285,21 +826,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_location_extension_types_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_location_extension_types_operations.py index 2a9c3b93c87..6e8be79c061 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_location_extension_types_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_location_extension_types_operations.py @@ -5,18 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -======= -from typing import TYPE_CHECKING ->>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -62,19 +57,6 @@ def build_list_request( headers=header_parameters, **kwargs ) -======= -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] ->>>>>>> 331f997c (updating to the latest vendored sdk) class LocationExtensionTypesOperations(object): """LocationExtensionTypesOperations operations. @@ -98,33 +80,20 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace def list( self, location: str, **kwargs: Any ) -> Iterable["_models.ExtensionTypeList"]: -======= - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ExtensionTypeList"] ->>>>>>> 331f997c (updating to the latest vendored sdk) """List all Extension Types. :param location: extension location. :type location: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ExtensionTypeList or the result of cls(response) -<<<<<<< HEAD :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionTypeList] -======= - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ExtensionTypeList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionTypeList"] @@ -132,7 +101,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -158,37 +126,6 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("ExtensionTypeList", pipeline_response) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ExtensionTypeList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -201,21 +138,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_operation_status_operations.py index 66fdc1f761f..99b73b72038 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_operation_status_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_operation_status_operations.py @@ -5,18 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -======= -from typing import TYPE_CHECKING ->>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -111,19 +106,6 @@ def build_list_request( headers=header_parameters, **kwargs ) -======= -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] ->>>>>>> 331f997c (updating to the latest vendored sdk) class OperationStatusOperations(object): """OperationStatusOperations operations. @@ -147,7 +129,6 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace def get( self, @@ -159,19 +140,6 @@ def get( operation_id: str, **kwargs: Any ) -> "_models.OperationStatusResult": -======= - def get( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - extension_name, # type: str - operation_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OperationStatusResult" ->>>>>>> 331f997c (updating to the latest vendored sdk) """Get Async Operation status. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -181,12 +149,8 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param extension_name: Name of the Extension. @@ -203,7 +167,6 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -219,43 +182,12 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OperationStatusResult', pipeline_response) @@ -264,7 +196,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore @@ -278,19 +209,6 @@ def list( cluster_name: str, **kwargs: Any ) -> Iterable["_models.OperationStatusList"]: -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationStatusList"] ->>>>>>> 331f997c (updating to the latest vendored sdk) """List Async Operations, currently in progress, in a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -300,22 +218,14 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationStatusList or the result of cls(response) -<<<<<<< HEAD :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.OperationStatusList] -======= - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.OperationStatusList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusList"] @@ -323,7 +233,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -355,40 +264,6 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("OperationStatusList", pipeline_response) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('OperationStatusList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -401,21 +276,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_operations.py index fbbea927ccb..c047a8d76ca 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_operations.py @@ -5,18 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -======= -from typing import TYPE_CHECKING ->>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace @@ -54,19 +49,6 @@ def build_list_request( headers=header_parameters, **kwargs ) -======= -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] ->>>>>>> 331f997c (updating to the latest vendored sdk) class Operations(object): """Operations operations. @@ -90,7 +72,6 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace def list( self, @@ -103,18 +84,6 @@ def list( cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ResourceProviderOperationList] -======= - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ResourceProviderOperationList"] - """List all the available operations the KubernetesConfiguration resource provider supports. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.ResourceProviderOperationList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -122,7 +91,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -144,32 +112,6 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -182,21 +124,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_source_control_configurations_operations.py index b12392e527c..4fe01af8220 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_source_control_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2021_11_01_preview/operations/_source_control_configurations_operations.py @@ -5,18 +5,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -<<<<<<< HEAD import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -======= -from typing import TYPE_CHECKING ->>>>>>> 331f997c (updating to the latest vendored sdk) import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -<<<<<<< HEAD from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest @@ -203,21 +198,6 @@ def build_list_request( headers=header_parameters, **kwargs ) -======= -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] ->>>>>>> 331f997c (updating to the latest vendored sdk) class SourceControlConfigurationsOperations(object): """SourceControlConfigurationsOperations operations. @@ -241,7 +221,6 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config -<<<<<<< HEAD @distributed_trace def get( self, @@ -252,18 +231,6 @@ def get( source_control_configuration_name: str, **kwargs: Any ) -> "_models.SourceControlConfiguration": -======= - def get( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - source_control_configuration_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.SourceControlConfiguration" ->>>>>>> 331f997c (updating to the latest vendored sdk) """Gets details of the Source Control Configuration. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -273,24 +240,16 @@ def get( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) -<<<<<<< HEAD :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration -======= - :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -298,7 +257,6 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_get_request( @@ -313,42 +271,12 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) @@ -357,7 +285,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -373,21 +300,6 @@ def create_or_update( source_control_configuration: "_models.SourceControlConfiguration", **kwargs: Any ) -> "_models.SourceControlConfiguration": -======= - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - - def create_or_update( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - source_control_configuration_name, # type: str - source_control_configuration, # type: "_models.SourceControlConfiguration" - **kwargs # type: Any - ): - # type: (...) -> "_models.SourceControlConfiguration" ->>>>>>> 331f997c (updating to the latest vendored sdk) """Create a new Kubernetes Source Control Configuration. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -397,30 +309,19 @@ def create_or_update( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. -<<<<<<< HEAD :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration -======= - :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SourceControlConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfiguration ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -428,7 +329,6 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] @@ -448,47 +348,12 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-11-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -501,7 +366,6 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized -<<<<<<< HEAD create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -515,26 +379,11 @@ def _delete_initial( source_control_configuration_name: str, **kwargs: Any ) -> None: -======= - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - source_control_configuration_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD request = build_delete_request_initial( @@ -549,50 +398,18 @@ def _delete_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) ->>>>>>> 331f997c (updating to the latest vendored sdk) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) -<<<<<<< HEAD raise HttpResponseError(response=response, error_format=ARMErrorFormat) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) ->>>>>>> 331f997c (updating to the latest vendored sdk) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore -<<<<<<< HEAD @distributed_trace def begin_delete( @@ -604,18 +421,6 @@ def begin_delete( source_control_configuration_name: str, **kwargs: Any ) -> LROPoller[None]: -======= - def begin_delete( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - source_control_configuration_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] ->>>>>>> 331f997c (updating to the latest vendored sdk) """This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from the source repo. @@ -626,19 +431,14 @@ def begin_delete( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 ->>>>>>> 331f997c (updating to the latest vendored sdk) :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. -<<<<<<< HEAD :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. @@ -650,17 +450,6 @@ def begin_delete( :raises: ~azure.core.exceptions.HttpResponseError """ polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] -======= - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] ->>>>>>> 331f997c (updating to the latest vendored sdk) cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -677,33 +466,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) -<<<<<<< HEAD kwargs.pop('error_map', None) -======= - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) ->>>>>>> 331f997c (updating to the latest vendored sdk) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) -<<<<<<< HEAD if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) -======= - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ->>>>>>> 331f997c (updating to the latest vendored sdk) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -715,7 +485,6 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) -<<<<<<< HEAD begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore @@ -728,19 +497,6 @@ def list( cluster_name: str, **kwargs: Any ) -> Iterable["_models.SourceControlConfigurationList"]: -======= - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - cluster_rp, # type: Union[str, "_models.Enum0"] - cluster_resource_name, # type: Union[str, "_models.Enum1"] - cluster_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SourceControlConfigurationList"] ->>>>>>> 331f997c (updating to the latest vendored sdk) """List all Source Control Configurations. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -750,7 +506,6 @@ def list( :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum0 :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). -<<<<<<< HEAD :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 :param cluster_name: The name of the kubernetes cluster. @@ -760,14 +515,6 @@ def list( cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfigurationList] -======= - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.Enum1 - :param cluster_name: The name of the kubernetes cluster. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SourceControlConfigurationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2021_11_01_preview.models.SourceControlConfigurationList] ->>>>>>> 331f997c (updating to the latest vendored sdk) :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfigurationList"] @@ -775,7 +522,6 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) -<<<<<<< HEAD def prepare_request(next_link=None): if not next_link: @@ -807,40 +553,6 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = self._deserialize("SourceControlConfigurationList", pipeline_response) -======= - api_version = "2021-11-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('SourceControlConfigurationList', pipeline_response) ->>>>>>> 331f997c (updating to the latest vendored sdk) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -853,21 +565,13 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: -<<<<<<< HEAD map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) -======= - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) ->>>>>>> 331f997c (updating to the latest vendored sdk) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response -<<<<<<< HEAD -======= ->>>>>>> 331f997c (updating to the latest vendored sdk) return ItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/__init__.py new file mode 100644 index 00000000000..e9096303633 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._source_control_configuration_client import SourceControlConfigurationClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['SourceControlConfigurationClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/_configuration.py new file mode 100644 index 00000000000..967e5867495 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/_configuration.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class SourceControlConfigurationClientConfiguration(Configuration): + """Configuration for SourceControlConfigurationClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-kubernetesconfiguration/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + 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 = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/_patch.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/_patch.py new file mode 100644 index 00000000000..74e48ecd07c --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/_source_control_configuration_client.py new file mode 100644 index 00000000000..03b958461c9 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/_source_control_configuration_client.py @@ -0,0 +1,130 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.rest import HttpRequest, HttpResponse +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +from . import models +from ._configuration import SourceControlConfigurationClientConfiguration +from .operations import ClusterExtensionTypeOperations, ClusterExtensionTypesOperations, ExtensionTypeVersionsOperations, ExtensionsOperations, FluxConfigOperationStatusOperations, FluxConfigurationsOperations, LocationExtensionTypesOperations, OperationStatusOperations, Operations, SourceControlConfigurationsOperations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + +class SourceControlConfigurationClient: + """KubernetesConfiguration Client. + + :ivar cluster_extension_type: ClusterExtensionTypeOperations operations + :vartype cluster_extension_type: + azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.operations.ClusterExtensionTypeOperations + :ivar cluster_extension_types: ClusterExtensionTypesOperations operations + :vartype cluster_extension_types: + azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.operations.ClusterExtensionTypesOperations + :ivar extension_type_versions: ExtensionTypeVersionsOperations operations + :vartype extension_type_versions: + azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.operations.ExtensionTypeVersionsOperations + :ivar location_extension_types: LocationExtensionTypesOperations operations + :vartype location_extension_types: + azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.operations.LocationExtensionTypesOperations + :ivar extensions: ExtensionsOperations operations + :vartype extensions: + azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.operations.ExtensionsOperations + :ivar operation_status: OperationStatusOperations operations + :vartype operation_status: + azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.operations.OperationStatusOperations + :ivar flux_configurations: FluxConfigurationsOperations operations + :vartype flux_configurations: + azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.operations.FluxConfigurationsOperations + :ivar flux_config_operation_status: FluxConfigOperationStatusOperations operations + :vartype flux_config_operation_status: + azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.operations.FluxConfigOperationStatusOperations + :ivar source_control_configurations: SourceControlConfigurationsOperations operations + :vartype source_control_configurations: + azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.operations.SourceControlConfigurationsOperations + :ivar operations: Operations operations + :vartype operations: + azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.operations.Operations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + 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.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operation_status = OperationStatusOperations(self._client, self._config, self._serialize, self._deserialize) + self.flux_configurations = FluxConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.flux_config_operation_status = FluxConfigOperationStatusOperations(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, + request, # type: HttpRequest + **kwargs: Any + ) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> SourceControlConfigurationClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/_vendor.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/_vendor.py new file mode 100644 index 00000000000..138f663c53a --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/aio/operations/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/_version.py similarity index 69% rename from src/k8s-extension/azext_k8s_extension/vendored_sdks/aio/operations/__init__.py rename to src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/_version.py index 07db19b318c..59deb8c7263 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/aio/operations/__init__.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/_version.py @@ -6,10 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._source_control_configurations_operations import SourceControlConfigurationsOperations -from ._operations import Operations - -__all__ = [ - 'SourceControlConfigurationsOperations', - 'Operations', -] +VERSION = "1.1.0" diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/__init__.py new file mode 100644 index 00000000000..5f583276b4e --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/__init__.py @@ -0,0 +1,15 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._source_control_configuration_client import SourceControlConfigurationClient +__all__ = ['SourceControlConfigurationClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/_configuration.py new file mode 100644 index 00000000000..8c8a7366e31 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class SourceControlConfigurationClientConfiguration(Configuration): + """Configuration for SourceControlConfigurationClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-kubernetesconfiguration/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + 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 = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/_patch.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/_patch.py new file mode 100644 index 00000000000..74e48ecd07c --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/_source_control_configuration_client.py new file mode 100644 index 00000000000..0ed6a6fd031 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/_source_control_configuration_client.py @@ -0,0 +1,127 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING + +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +from .. import models +from ._configuration import SourceControlConfigurationClientConfiguration +from .operations import ClusterExtensionTypeOperations, ClusterExtensionTypesOperations, ExtensionTypeVersionsOperations, ExtensionsOperations, FluxConfigOperationStatusOperations, FluxConfigurationsOperations, LocationExtensionTypesOperations, OperationStatusOperations, Operations, SourceControlConfigurationsOperations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +class SourceControlConfigurationClient: + """KubernetesConfiguration Client. + + :ivar cluster_extension_type: ClusterExtensionTypeOperations operations + :vartype cluster_extension_type: + azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.aio.operations.ClusterExtensionTypeOperations + :ivar cluster_extension_types: ClusterExtensionTypesOperations operations + :vartype cluster_extension_types: + azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.aio.operations.ClusterExtensionTypesOperations + :ivar extension_type_versions: ExtensionTypeVersionsOperations operations + :vartype extension_type_versions: + azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.aio.operations.ExtensionTypeVersionsOperations + :ivar location_extension_types: LocationExtensionTypesOperations operations + :vartype location_extension_types: + azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.aio.operations.LocationExtensionTypesOperations + :ivar extensions: ExtensionsOperations operations + :vartype extensions: + azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.aio.operations.ExtensionsOperations + :ivar operation_status: OperationStatusOperations operations + :vartype operation_status: + azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.aio.operations.OperationStatusOperations + :ivar flux_configurations: FluxConfigurationsOperations operations + :vartype flux_configurations: + azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.aio.operations.FluxConfigurationsOperations + :ivar flux_config_operation_status: FluxConfigOperationStatusOperations operations + :vartype flux_config_operation_status: + azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.aio.operations.FluxConfigOperationStatusOperations + :ivar source_control_configurations: SourceControlConfigurationsOperations operations + :vartype source_control_configurations: + azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.aio.operations.SourceControlConfigurationsOperations + :ivar operations: Operations operations + :vartype operations: + azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.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 ID of the target subscription. + :type subscription_id: str + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + 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.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operation_status = OperationStatusOperations(self._client, self._config, self._serialize, self._deserialize) + self.flux_configurations = FluxConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.flux_config_operation_status = FluxConfigOperationStatusOperations(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, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "SourceControlConfigurationClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/__init__.py new file mode 100644 index 00000000000..37008240af3 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/__init__.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._cluster_extension_type_operations import ClusterExtensionTypeOperations +from ._cluster_extension_types_operations import ClusterExtensionTypesOperations +from ._extension_type_versions_operations import ExtensionTypeVersionsOperations +from ._location_extension_types_operations import LocationExtensionTypesOperations +from ._extensions_operations import ExtensionsOperations +from ._operation_status_operations import OperationStatusOperations +from ._flux_configurations_operations import FluxConfigurationsOperations +from ._flux_config_operation_status_operations import FluxConfigOperationStatusOperations +from ._source_control_configurations_operations import SourceControlConfigurationsOperations +from ._operations import Operations + +__all__ = [ + 'ClusterExtensionTypeOperations', + 'ClusterExtensionTypesOperations', + 'ExtensionTypeVersionsOperations', + 'LocationExtensionTypesOperations', + 'ExtensionsOperations', + 'OperationStatusOperations', + 'FluxConfigurationsOperations', + 'FluxConfigOperationStatusOperations', + 'SourceControlConfigurationsOperations', + 'Operations', +] diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_cluster_extension_type_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_cluster_extension_type_operations.py new file mode 100644 index 00000000000..887f12fdfe1 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_cluster_extension_type_operations.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._cluster_extension_type_operations import build_get_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ClusterExtensionTypeOperations: + """ClusterExtensionTypeOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_type_name: str, + **kwargs: Any + ) -> "_models.ExtensionType": + """Get Extension Type details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param extension_type_name: Extension type name. + :type extension_type_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExtensionType, or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionType + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionType"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_type_name=extension_type_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExtensionType', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{extensionTypeName}'} # type: ignore + diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_cluster_extension_types_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_cluster_extension_types_operations.py new file mode 100644 index 00000000000..188c4fe1c71 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_cluster_extension_types_operations.py @@ -0,0 +1,136 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._cluster_extension_types_operations import build_list_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ClusterExtensionTypesOperations: + """ClusterExtensionTypesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ExtensionTypeList"]: + """Get Extension Types. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExtensionTypeList or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionTypeList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionTypeList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionTypeList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes'} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_extension_type_versions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_extension_type_versions_operations.py new file mode 100644 index 00000000000..ca6eb3604c8 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_extension_type_versions_operations.py @@ -0,0 +1,123 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._extension_type_versions_operations import build_list_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ExtensionTypeVersionsOperations: + """ExtensionTypeVersionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + location: str, + extension_type_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ExtensionVersionList"]: + """List available versions for an Extension Type. + + :param location: extension location. + :type location: str + :param extension_type_name: Extension type name. + :type extension_type_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExtensionVersionList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionVersionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionVersionList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + location=location, + extension_type_name=extension_type_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + location=location, + extension_type_name=extension_type_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionVersionList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/locations/{location}/extensionTypes/{extensionTypeName}/versions'} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_extensions_operations.py new file mode 100644 index 00000000000..bf5536ccc86 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_extensions_operations.py @@ -0,0 +1,615 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._extensions_operations import build_create_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ExtensionsOperations: + """ExtensionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_initial( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_name: str, + extension: "_models.Extension", + **kwargs: Any + ) -> "_models.Extension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(extension, 'Extension') + + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Extension', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Extension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_name: str, + extension: "_models.Extension", + **kwargs: Any + ) -> AsyncLROPoller["_models.Extension"]: + """Create a new Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param extension_name: Name of the Extension. + :type extension_name: str + :param extension: Properties necessary to Create an Extension. + :type extension: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.Extension + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.Extension] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + extension=extension, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('Extension', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_name: str, + **kwargs: Any + ) -> "_models.Extension": + """Gets Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param extension_name: Name of the Extension. + :type extension_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Extension, or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.Extension + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Extension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + + async def _delete_initial( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + force_delete=force_delete, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension + from the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param extension_name: Name of the Extension. + :type extension_name: str + :param force_delete: Delete the extension resource in Azure - not the normal asynchronous + delete. + :type force_delete: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + force_delete=force_delete, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_name: str, + patch_extension: "_models.PatchExtension", + **kwargs: Any + ) -> "_models.Extension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(patch_extension, 'PatchExtension') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Extension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_name: str, + patch_extension: "_models.PatchExtension", + **kwargs: Any + ) -> AsyncLROPoller["_models.Extension"]: + """Patch an existing Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param extension_name: Name of the Extension. + :type extension_name: str + :param patch_extension: Properties to Patch in an existing Extension. + :type patch_extension: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.PatchExtension + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.Extension] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + patch_extension=patch_extension, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('Extension', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ExtensionsList"]: + """List all Extensions in the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExtensionsList or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionsList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions'} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_flux_config_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_flux_config_operation_status_operations.py new file mode 100644 index 00000000000..b17cd1668e6 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_flux_config_operation_status_operations.py @@ -0,0 +1,117 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._flux_config_operation_status_operations import build_get_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class FluxConfigOperationStatusOperations: + """FluxConfigOperationStatusOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + flux_configuration_name: str, + operation_id: str, + **kwargs: Any + ) -> "_models.OperationStatusResult": + """Get Async Operation status. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. + :type flux_configuration_name: str + :param operation_id: operation Id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatusResult, or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.OperationStatusResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + operation_id=operation_id, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OperationStatusResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}/operations/{operationId}'} # type: ignore + diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_flux_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_flux_configurations_operations.py new file mode 100644 index 00000000000..d7c682d0911 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_flux_configurations_operations.py @@ -0,0 +1,617 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._flux_configurations_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class FluxConfigurationsOperations: + """FluxConfigurationsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + flux_configuration_name: str, + **kwargs: Any + ) -> "_models.FluxConfiguration": + """Gets details of the Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. + :type flux_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FluxConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.FluxConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FluxConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore + + + async def _create_or_update_initial( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + flux_configuration_name: str, + flux_configuration: "_models.FluxConfiguration", + **kwargs: Any + ) -> "_models.FluxConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(flux_configuration, 'FluxConfiguration') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('FluxConfiguration', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('FluxConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + flux_configuration_name: str, + flux_configuration: "_models.FluxConfiguration", + **kwargs: Any + ) -> AsyncLROPoller["_models.FluxConfiguration"]: + """Create a new Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. + :type flux_configuration_name: str + :param flux_configuration: Properties necessary to Create a FluxConfiguration. + :type flux_configuration: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.FluxConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.FluxConfiguration] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + flux_configuration=flux_configuration, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('FluxConfiguration', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + flux_configuration_name: str, + flux_configuration_patch: "_models.FluxConfigurationPatch", + **kwargs: Any + ) -> "_models.FluxConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(flux_configuration_patch, 'FluxConfigurationPatch') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FluxConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore + + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + flux_configuration_name: str, + flux_configuration_patch: "_models.FluxConfigurationPatch", + **kwargs: Any + ) -> AsyncLROPoller["_models.FluxConfiguration"]: + """Update an existing Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. + :type flux_configuration_name: str + :param flux_configuration_patch: Properties to Patch in an existing Flux Configuration. + :type flux_configuration_patch: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.FluxConfigurationPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.FluxConfiguration] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + flux_configuration_patch=flux_configuration_patch, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('FluxConfiguration', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + flux_configuration_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + force_delete=force_delete, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore + + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + flux_configuration_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync + from the source repo. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. + :type flux_configuration_name: str + :param force_delete: Delete the extension resource in Azure - not the normal asynchronous + delete. + :type force_delete: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + force_delete=force_delete, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.FluxConfigurationsList"]: + """List all Flux Configurations. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FluxConfigurationsList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.FluxConfigurationsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfigurationsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("FluxConfigurationsList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations'} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_location_extension_types_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_location_extension_types_operations.py new file mode 100644 index 00000000000..ea825b2f749 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_location_extension_types_operations.py @@ -0,0 +1,117 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._location_extension_types_operations import build_list_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class LocationExtensionTypesOperations: + """LocationExtensionTypesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + location: str, + **kwargs: Any + ) -> AsyncIterable["_models.ExtensionTypeList"]: + """List all Extension Types. + + :param location: extension location. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExtensionTypeList or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionTypeList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionTypeList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + location=location, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + location=location, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionTypeList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/locations/{location}/extensionTypes'} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_operation_status_operations.py new file mode 100644 index 00000000000..3ecad0ac446 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_operation_status_operations.py @@ -0,0 +1,208 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._operation_status_operations import build_get_request, build_list_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OperationStatusOperations: + """OperationStatusOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_name: str, + operation_id: str, + **kwargs: Any + ) -> "_models.OperationStatusResult": + """Get Async Operation status. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param extension_name: Name of the Extension. + :type extension_name: str + :param operation_id: operation Id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatusResult, or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.OperationStatusResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + operation_id=operation_id, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OperationStatusResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore + + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.OperationStatusList"]: + """List Async Operations, currently in progress, in a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationStatusList or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.OperationStatusList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OperationStatusList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/operations'} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/aio/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_operations.py similarity index 69% rename from src/k8s-extension/azext_k8s_extension/vendored_sdks/aio/operations/_operations.py rename to src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_operations.py index abad6a97377..cf1d3dd2de3 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/aio/operations/_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -26,7 +31,7 @@ class Operations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.kubernetesconfiguration.models + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -41,15 +46,18 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ResourceProviderOperationList"]: """List all the available operations the KubernetesConfiguration resource provider supports. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ResourceProviderOperationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.models.ResourceProviderOperationList] + :return: An iterator like instance of either ResourceProviderOperationList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ResourceProviderOperationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] @@ -57,30 +65,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-10-01-preview" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) + deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -94,10 +99,12 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/aio/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_source_control_configurations_operations.py similarity index 59% rename from src/k8s-extension/azext_k8s_extension/vendored_sdks/aio/operations/_source_control_configurations_operations.py rename to src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_source_control_configurations_operations.py index 2a8fe57a0cf..75d18cdad4a 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/aio/operations/_source_control_configurations_operations.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/aio/operations/_source_control_configurations_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._source_control_configurations_operations import build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -28,7 +33,7 @@ class SourceControlConfigurationsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.kubernetesconfiguration.models + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -43,32 +48,36 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def get( self, resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], cluster_name: str, source_control_configuration_name: str, - **kwargs + **kwargs: Any ) -> "_models.SourceControlConfiguration": """Gets details of the Source Control Configuration. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). - :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.models.Enum0 + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.models.Enum1 + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.kubernetesconfiguration.models.SourceControlConfiguration + :rtype: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.SourceControlConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -76,36 +85,26 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-10-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + source_control_configuration_name=source_control_configuration_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) @@ -114,37 +113,44 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + + @distributed_trace_async async def create_or_update( self, resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], cluster_name: str, source_control_configuration_name: str, source_control_configuration: "_models.SourceControlConfiguration", - **kwargs + **kwargs: Any ) -> "_models.SourceControlConfiguration": """Create a new Kubernetes Source Control Configuration. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). - :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.models.Enum0 + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.models.Enum1 + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. - :type source_control_configuration: ~azure.mgmt.kubernetesconfiguration.models.SourceControlConfiguration + :type source_control_configuration: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.SourceControlConfiguration :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControlConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.kubernetesconfiguration.models.SourceControlConfiguration + :rtype: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.SourceControlConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] @@ -152,41 +158,31 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-10-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + source_control_configuration_name=source_control_configuration_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -199,94 +195,91 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + async def _delete_initial( self, resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], cluster_name: str, source_control_configuration_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-10-01-preview" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + source_control_configuration_name=source_control_configuration_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], cluster_name: str, source_control_configuration_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from the source repo. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). - :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.models.Enum0 + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.models.Enum1 + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -303,24 +296,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_configuration_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -332,31 +315,37 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + @distributed_trace def list( self, resource_group_name: str, - cluster_rp: Union[str, "_models.Enum0"], - cluster_resource_name: Union[str, "_models.Enum1"], + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], cluster_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SourceControlConfigurationList"]: """List all Source Control Configurations. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). - :type cluster_rp: str or ~azure.mgmt.kubernetesconfiguration.models.Enum0 + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). - :type cluster_resource_name: str or ~azure.mgmt.kubernetesconfiguration.models.Enum1 + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SourceControlConfigurationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.models.SourceControlConfigurationList] + :return: An iterator like instance of either SourceControlConfigurationList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.SourceControlConfigurationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfigurationList"] @@ -364,38 +353,37 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-10-01-preview" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), - 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('SourceControlConfigurationList', pipeline_response) + deserialized = self._deserialize("SourceControlConfigurationList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -408,12 +396,13 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/models/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/models/__init__.py new file mode 100644 index 00000000000..f0c42cb72af --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/models/__init__.py @@ -0,0 +1,133 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._models_py3 import BucketDefinition +from ._models_py3 import BucketPatchDefinition +from ._models_py3 import ClusterScopeSettings +from ._models_py3 import ComplianceStatus +from ._models_py3 import DependsOnDefinition +from ._models_py3 import ErrorAdditionalInfo +from ._models_py3 import ErrorDetail +from ._models_py3 import ErrorResponse +from ._models_py3 import Extension +from ._models_py3 import ExtensionPropertiesAksAssignedIdentity +from ._models_py3 import ExtensionStatus +from ._models_py3 import ExtensionType +from ._models_py3 import ExtensionTypeList +from ._models_py3 import ExtensionVersionList +from ._models_py3 import ExtensionVersionListValueItem +from ._models_py3 import ExtensionsList +from ._models_py3 import FluxConfiguration +from ._models_py3 import FluxConfigurationPatch +from ._models_py3 import FluxConfigurationsList +from ._models_py3 import GitRepositoryDefinition +from ._models_py3 import GitRepositoryPatchDefinition +from ._models_py3 import HelmOperatorProperties +from ._models_py3 import HelmReleasePropertiesDefinition +from ._models_py3 import Identity +from ._models_py3 import KustomizationDefinition +from ._models_py3 import KustomizationPatchDefinition +from ._models_py3 import ObjectReferenceDefinition +from ._models_py3 import ObjectStatusConditionDefinition +from ._models_py3 import ObjectStatusDefinition +from ._models_py3 import OperationStatusList +from ._models_py3 import OperationStatusResult +from ._models_py3 import PatchExtension +from ._models_py3 import ProxyResource +from ._models_py3 import RepositoryRefDefinition +from ._models_py3 import Resource +from ._models_py3 import ResourceProviderOperation +from ._models_py3 import ResourceProviderOperationDisplay +from ._models_py3 import ResourceProviderOperationList +from ._models_py3 import Scope +from ._models_py3 import ScopeCluster +from ._models_py3 import ScopeNamespace +from ._models_py3 import SourceControlConfiguration +from ._models_py3 import SourceControlConfigurationList +from ._models_py3 import SupportedScopes +from ._models_py3 import SystemData + + +from ._source_control_configuration_client_enums import ( + ComplianceStateType, + CreatedByType, + ExtensionsClusterResourceName, + ExtensionsClusterRp, + FluxComplianceState, + KustomizationValidationType, + LevelType, + MessageLevelType, + OperatorScopeType, + OperatorType, + ProvisioningState, + ProvisioningStateType, + ScopeType, + SourceKindType, +) + +__all__ = [ + 'BucketDefinition', + 'BucketPatchDefinition', + 'ClusterScopeSettings', + 'ComplianceStatus', + 'DependsOnDefinition', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', + 'Extension', + 'ExtensionPropertiesAksAssignedIdentity', + 'ExtensionStatus', + 'ExtensionType', + 'ExtensionTypeList', + 'ExtensionVersionList', + 'ExtensionVersionListValueItem', + 'ExtensionsList', + 'FluxConfiguration', + 'FluxConfigurationPatch', + 'FluxConfigurationsList', + 'GitRepositoryDefinition', + 'GitRepositoryPatchDefinition', + 'HelmOperatorProperties', + 'HelmReleasePropertiesDefinition', + 'Identity', + 'KustomizationDefinition', + 'KustomizationPatchDefinition', + 'ObjectReferenceDefinition', + 'ObjectStatusConditionDefinition', + 'ObjectStatusDefinition', + 'OperationStatusList', + 'OperationStatusResult', + 'PatchExtension', + 'ProxyResource', + 'RepositoryRefDefinition', + 'Resource', + 'ResourceProviderOperation', + 'ResourceProviderOperationDisplay', + 'ResourceProviderOperationList', + 'Scope', + 'ScopeCluster', + 'ScopeNamespace', + 'SourceControlConfiguration', + 'SourceControlConfigurationList', + 'SupportedScopes', + 'SystemData', + 'ComplianceStateType', + 'CreatedByType', + 'ExtensionsClusterResourceName', + 'ExtensionsClusterRp', + 'FluxComplianceState', + 'KustomizationValidationType', + 'LevelType', + 'MessageLevelType', + 'OperatorScopeType', + 'OperatorType', + 'ProvisioningState', + 'ProvisioningStateType', + 'ScopeType', + 'SourceKindType', +] diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/models/_models_py3.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/models/_models_py3.py new file mode 100644 index 00000000000..08c9a28cc12 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/models/_models_py3.py @@ -0,0 +1,2525 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._source_control_configuration_client_enums import * + + +class BucketDefinition(msrest.serialization.Model): + """Parameters to reconcile to the GitRepository source kind type. + + :ivar url: The URL to sync for the flux configuration S3 bucket. + :vartype url: str + :ivar bucket_name: The bucket name to sync from the url endpoint for the flux configuration. + :vartype bucket_name: str + :ivar insecure: Specify whether to use insecure communication when puling data from the S3 + bucket. + :vartype insecure: bool + :ivar timeout_in_seconds: The maximum time to attempt to reconcile the cluster git repository + source with the remote. + :vartype timeout_in_seconds: long + :ivar sync_interval_in_seconds: The interval at which to re-reconcile the cluster git + repository source with the remote. + :vartype sync_interval_in_seconds: long + :ivar access_key: Plaintext access key used to securely access the S3 bucket. + :vartype access_key: str + :ivar local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :vartype local_auth_ref: str + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'bucket_name': {'key': 'bucketName', 'type': 'str'}, + 'insecure': {'key': 'insecure', 'type': 'bool'}, + 'timeout_in_seconds': {'key': 'timeoutInSeconds', 'type': 'long'}, + 'sync_interval_in_seconds': {'key': 'syncIntervalInSeconds', 'type': 'long'}, + 'access_key': {'key': 'accessKey', 'type': 'str'}, + 'local_auth_ref': {'key': 'localAuthRef', 'type': 'str'}, + } + + def __init__( + self, + *, + url: Optional[str] = None, + bucket_name: Optional[str] = None, + insecure: Optional[bool] = True, + timeout_in_seconds: Optional[int] = 600, + sync_interval_in_seconds: Optional[int] = 600, + access_key: Optional[str] = None, + local_auth_ref: Optional[str] = None, + **kwargs + ): + """ + :keyword url: The URL to sync for the flux configuration S3 bucket. + :paramtype url: str + :keyword bucket_name: The bucket name to sync from the url endpoint for the flux configuration. + :paramtype bucket_name: str + :keyword insecure: Specify whether to use insecure communication when puling data from the S3 + bucket. + :paramtype insecure: bool + :keyword timeout_in_seconds: The maximum time to attempt to reconcile the cluster git + repository source with the remote. + :paramtype timeout_in_seconds: long + :keyword sync_interval_in_seconds: The interval at which to re-reconcile the cluster git + repository source with the remote. + :paramtype sync_interval_in_seconds: long + :keyword access_key: Plaintext access key used to securely access the S3 bucket. + :paramtype access_key: str + :keyword local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :paramtype local_auth_ref: str + """ + super(BucketDefinition, self).__init__(**kwargs) + self.url = url + self.bucket_name = bucket_name + self.insecure = insecure + self.timeout_in_seconds = timeout_in_seconds + self.sync_interval_in_seconds = sync_interval_in_seconds + self.access_key = access_key + self.local_auth_ref = local_auth_ref + + +class BucketPatchDefinition(msrest.serialization.Model): + """Parameters to reconcile to the GitRepository source kind type. + + :ivar url: The URL to sync for the flux configuration S3 bucket. + :vartype url: str + :ivar bucket_name: The bucket name to sync from the url endpoint for the flux configuration. + :vartype bucket_name: str + :ivar insecure: Specify whether to use insecure communication when puling data from the S3 + bucket. + :vartype insecure: bool + :ivar timeout_in_seconds: The maximum time to attempt to reconcile the cluster git repository + source with the remote. + :vartype timeout_in_seconds: long + :ivar sync_interval_in_seconds: The interval at which to re-reconcile the cluster git + repository source with the remote. + :vartype sync_interval_in_seconds: long + :ivar access_key: Plaintext access key used to securely access the S3 bucket. + :vartype access_key: str + :ivar local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :vartype local_auth_ref: str + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'bucket_name': {'key': 'bucketName', 'type': 'str'}, + 'insecure': {'key': 'insecure', 'type': 'bool'}, + 'timeout_in_seconds': {'key': 'timeoutInSeconds', 'type': 'long'}, + 'sync_interval_in_seconds': {'key': 'syncIntervalInSeconds', 'type': 'long'}, + 'access_key': {'key': 'accessKey', 'type': 'str'}, + 'local_auth_ref': {'key': 'localAuthRef', 'type': 'str'}, + } + + def __init__( + self, + *, + url: Optional[str] = None, + bucket_name: Optional[str] = None, + insecure: Optional[bool] = None, + timeout_in_seconds: Optional[int] = None, + sync_interval_in_seconds: Optional[int] = None, + access_key: Optional[str] = None, + local_auth_ref: Optional[str] = None, + **kwargs + ): + """ + :keyword url: The URL to sync for the flux configuration S3 bucket. + :paramtype url: str + :keyword bucket_name: The bucket name to sync from the url endpoint for the flux configuration. + :paramtype bucket_name: str + :keyword insecure: Specify whether to use insecure communication when puling data from the S3 + bucket. + :paramtype insecure: bool + :keyword timeout_in_seconds: The maximum time to attempt to reconcile the cluster git + repository source with the remote. + :paramtype timeout_in_seconds: long + :keyword sync_interval_in_seconds: The interval at which to re-reconcile the cluster git + repository source with the remote. + :paramtype sync_interval_in_seconds: long + :keyword access_key: Plaintext access key used to securely access the S3 bucket. + :paramtype access_key: str + :keyword local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :paramtype local_auth_ref: str + """ + super(BucketPatchDefinition, self).__init__(**kwargs) + self.url = url + self.bucket_name = bucket_name + self.insecure = insecure + self.timeout_in_seconds = timeout_in_seconds + self.sync_interval_in_seconds = sync_interval_in_seconds + self.access_key = access_key + self.local_auth_ref = local_auth_ref + + +class ClusterScopeSettings(msrest.serialization.Model): + """Extension scope settings. + + :ivar allow_multiple_instances: Describes if multiple instances of the extension are allowed. + :vartype allow_multiple_instances: bool + :ivar default_release_namespace: Default extension release namespace. + :vartype default_release_namespace: str + """ + + _attribute_map = { + 'allow_multiple_instances': {'key': 'allowMultipleInstances', 'type': 'bool'}, + 'default_release_namespace': {'key': 'defaultReleaseNamespace', 'type': 'str'}, + } + + def __init__( + self, + *, + allow_multiple_instances: Optional[bool] = None, + default_release_namespace: Optional[str] = None, + **kwargs + ): + """ + :keyword allow_multiple_instances: Describes if multiple instances of the extension are + allowed. + :paramtype allow_multiple_instances: bool + :keyword default_release_namespace: Default extension release namespace. + :paramtype default_release_namespace: str + """ + super(ClusterScopeSettings, self).__init__(**kwargs) + self.allow_multiple_instances = allow_multiple_instances + self.default_release_namespace = default_release_namespace + + +class ComplianceStatus(msrest.serialization.Model): + """Compliance Status details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar compliance_state: The compliance state of the configuration. Possible values include: + "Pending", "Compliant", "Noncompliant", "Installed", "Failed". + :vartype compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ComplianceStateType + :ivar last_config_applied: Datetime the configuration was last applied. + :vartype last_config_applied: ~datetime.datetime + :ivar message: Message from when the configuration was applied. + :vartype message: str + :ivar message_level: Level of the message. Possible values include: "Error", "Warning", + "Information". + :vartype message_level: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.MessageLevelType + """ + + _validation = { + 'compliance_state': {'readonly': True}, + } + + _attribute_map = { + 'compliance_state': {'key': 'complianceState', 'type': 'str'}, + 'last_config_applied': {'key': 'lastConfigApplied', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'message_level': {'key': 'messageLevel', 'type': 'str'}, + } + + def __init__( + self, + *, + last_config_applied: Optional[datetime.datetime] = None, + message: Optional[str] = None, + message_level: Optional[Union[str, "MessageLevelType"]] = None, + **kwargs + ): + """ + :keyword last_config_applied: Datetime the configuration was last applied. + :paramtype last_config_applied: ~datetime.datetime + :keyword message: Message from when the configuration was applied. + :paramtype message: str + :keyword message_level: Level of the message. Possible values include: "Error", "Warning", + "Information". + :paramtype message_level: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.MessageLevelType + """ + super(ComplianceStatus, self).__init__(**kwargs) + self.compliance_state = None + self.last_config_applied = last_config_applied + self.message = message + self.message_level = message_level + + +class DependsOnDefinition(msrest.serialization.Model): + """Specify which kustomizations must succeed reconciliation on the cluster prior to reconciling this kustomization. + + :ivar kustomization_name: Name of the kustomization to claim dependency on. + :vartype kustomization_name: str + """ + + _attribute_map = { + 'kustomization_name': {'key': 'kustomizationName', 'type': 'str'}, + } + + def __init__( + self, + *, + kustomization_name: Optional[str] = None, + **kwargs + ): + """ + :keyword kustomization_name: Name of the kustomization to claim dependency on. + :paramtype kustomization_name: str + """ + super(DependsOnDefinition, self).__init__(**kwargs) + self.kustomization_name = kustomization_name + + +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(msrest.serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(msrest.serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). + + :ivar error: The error object. + :vartype error: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + *, + error: Optional["ErrorDetail"] = None, + **kwargs + ): + """ + :keyword error: The error object. + :paramtype error: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ErrorDetail + """ + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ProxyResource, self).__init__(**kwargs) + + +class Extension(ProxyResource): + """The Extension object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar identity: Identity of the Extension resource. + :vartype identity: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.Identity + :ivar system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.SystemData + :ivar extension_type: Type of the Extension, of which this resource is an instance of. It must + be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the + Extension publisher. + :vartype extension_type: str + :ivar auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade + of minor version, or not. + :vartype auto_upgrade_minor_version: bool + :ivar release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. Stable, + Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :vartype release_train: str + :ivar version: Version of the extension for this extension, if it is 'pinned' to a specific + version. autoUpgradeMinorVersion must be 'false'. + :vartype version: str + :ivar scope: Scope at which the extension is installed. + :vartype scope: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.Scope + :ivar configuration_settings: Configuration settings, as name-value pairs for configuring this + extension. + :vartype configuration_settings: dict[str, str] + :ivar configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :vartype configuration_protected_settings: dict[str, str] + :ivar provisioning_state: Status of installation of this extension. Possible values include: + "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ProvisioningState + :ivar statuses: Status from this extension. + :vartype statuses: + list[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionStatus] + :ivar error_info: Error information from the Agent - e.g. errors during installation. + :vartype error_info: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ErrorDetail + :ivar custom_location_settings: Custom Location settings properties. + :vartype custom_location_settings: dict[str, str] + :ivar package_uri: Uri of the Helm package. + :vartype package_uri: str + :ivar aks_assigned_identity: Identity of the Extension resource in an AKS cluster. + :vartype aks_assigned_identity: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionPropertiesAksAssignedIdentity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'error_info': {'readonly': True}, + 'custom_location_settings': {'readonly': True}, + 'package_uri': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'extension_type': {'key': 'properties.extensionType', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'release_train': {'key': 'properties.releaseTrain', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'Scope'}, + 'configuration_settings': {'key': 'properties.configurationSettings', 'type': '{str}'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'statuses': {'key': 'properties.statuses', 'type': '[ExtensionStatus]'}, + 'error_info': {'key': 'properties.errorInfo', 'type': 'ErrorDetail'}, + 'custom_location_settings': {'key': 'properties.customLocationSettings', 'type': '{str}'}, + 'package_uri': {'key': 'properties.packageUri', 'type': 'str'}, + 'aks_assigned_identity': {'key': 'properties.aksAssignedIdentity', 'type': 'ExtensionPropertiesAksAssignedIdentity'}, + } + + def __init__( + self, + *, + identity: Optional["Identity"] = None, + extension_type: Optional[str] = None, + auto_upgrade_minor_version: Optional[bool] = True, + release_train: Optional[str] = "Stable", + version: Optional[str] = None, + scope: Optional["Scope"] = None, + configuration_settings: Optional[Dict[str, str]] = None, + configuration_protected_settings: Optional[Dict[str, str]] = None, + statuses: Optional[List["ExtensionStatus"]] = None, + aks_assigned_identity: Optional["ExtensionPropertiesAksAssignedIdentity"] = None, + **kwargs + ): + """ + :keyword identity: Identity of the Extension resource. + :paramtype identity: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.Identity + :keyword extension_type: Type of the Extension, of which this resource is an instance of. It + must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the + Extension publisher. + :paramtype extension_type: str + :keyword auto_upgrade_minor_version: Flag to note if this extension participates in auto + upgrade of minor version, or not. + :paramtype auto_upgrade_minor_version: bool + :keyword release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. + Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :paramtype release_train: str + :keyword version: Version of the extension for this extension, if it is 'pinned' to a specific + version. autoUpgradeMinorVersion must be 'false'. + :paramtype version: str + :keyword scope: Scope at which the extension is installed. + :paramtype scope: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.Scope + :keyword configuration_settings: Configuration settings, as name-value pairs for configuring + this extension. + :paramtype configuration_settings: dict[str, str] + :keyword configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :paramtype configuration_protected_settings: dict[str, str] + :keyword statuses: Status from this extension. + :paramtype statuses: + list[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionStatus] + :keyword aks_assigned_identity: Identity of the Extension resource in an AKS cluster. + :paramtype aks_assigned_identity: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionPropertiesAksAssignedIdentity + """ + super(Extension, self).__init__(**kwargs) + self.identity = identity + self.system_data = None + self.extension_type = extension_type + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.release_train = release_train + self.version = version + self.scope = scope + self.configuration_settings = configuration_settings + self.configuration_protected_settings = configuration_protected_settings + self.provisioning_state = None + self.statuses = statuses + self.error_info = None + self.custom_location_settings = None + self.package_uri = None + self.aks_assigned_identity = aks_assigned_identity + + +class ExtensionPropertiesAksAssignedIdentity(msrest.serialization.Model): + """Identity of the Extension resource in an AKS cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: The identity type. The only acceptable values to pass in are None and + "SystemAssigned". The default value is None. + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + **kwargs + ): + """ + :keyword type: The identity type. The only acceptable values to pass in are None and + "SystemAssigned". The default value is None. + :paramtype type: str + """ + super(ExtensionPropertiesAksAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + +class ExtensionsList(msrest.serialization.Model): + """Result of the request to list Extensions. It contains a list of Extension objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Extensions within a Kubernetes cluster. + :vartype value: list[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.Extension] + :ivar next_link: URL to get the next set of extension objects, if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Extension]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ExtensionsList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ExtensionStatus(msrest.serialization.Model): + """Status from the extension. + + :ivar code: Status code provided by the Extension. + :vartype code: str + :ivar display_status: Short description of status of the extension. + :vartype display_status: str + :ivar level: Level of the status. Possible values include: "Error", "Warning", "Information". + Default value: "Information". + :vartype level: str or ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.LevelType + :ivar message: Detailed message of the status from the Extension. + :vartype message: str + :ivar time: DateLiteral (per ISO8601) noting the time of installation status. + :vartype time: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + display_status: Optional[str] = None, + level: Optional[Union[str, "LevelType"]] = "Information", + message: Optional[str] = None, + time: Optional[str] = None, + **kwargs + ): + """ + :keyword code: Status code provided by the Extension. + :paramtype code: str + :keyword display_status: Short description of status of the extension. + :paramtype display_status: str + :keyword level: Level of the status. Possible values include: "Error", "Warning", + "Information". Default value: "Information". + :paramtype level: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.LevelType + :keyword message: Detailed message of the status from the Extension. + :paramtype message: str + :keyword time: DateLiteral (per ISO8601) noting the time of installation status. + :paramtype time: str + """ + super(ExtensionStatus, self).__init__(**kwargs) + self.code = code + self.display_status = display_status + self.level = level + self.message = message + self.time = time + + +class ExtensionType(ProxyResource): + """Represents an Extension Type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.SystemData + :ivar release_trains: Extension release train: preview or stable. + :vartype release_trains: list[str] + :ivar cluster_types: Cluster types. + :vartype cluster_types: list[str] + :ivar supported_scopes: Extension scopes. + :vartype supported_scopes: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.SupportedScopes + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'release_trains': {'readonly': True}, + 'cluster_types': {'readonly': True}, + 'supported_scopes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'release_trains': {'key': 'properties.releaseTrains', 'type': '[str]'}, + 'cluster_types': {'key': 'properties.clusterTypes', 'type': '[str]'}, + 'supported_scopes': {'key': 'properties.supportedScopes', 'type': 'SupportedScopes'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ExtensionType, self).__init__(**kwargs) + self.system_data = None + self.release_trains = None + self.cluster_types = None + self.supported_scopes = None + + +class ExtensionTypeList(msrest.serialization.Model): + """List Extension Types. + + :ivar value: The list of Extension Types. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionType] + :ivar next_link: The link to fetch the next page of Extension Types. + :vartype next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExtensionType]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ExtensionType"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword value: The list of Extension Types. + :paramtype value: + list[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionType] + :keyword next_link: The link to fetch the next page of Extension Types. + :paramtype next_link: str + """ + super(ExtensionTypeList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ExtensionVersionList(msrest.serialization.Model): + """List versions for an Extension. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Versions available for this Extension Type. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionVersionListValueItem] + :ivar next_link: The link to fetch the next page of Extension Types. + :vartype next_link: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.SystemData + """ + + _validation = { + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExtensionVersionListValueItem]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + *, + value: Optional[List["ExtensionVersionListValueItem"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword value: Versions available for this Extension Type. + :paramtype value: + list[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionVersionListValueItem] + :keyword next_link: The link to fetch the next page of Extension Types. + :paramtype next_link: str + """ + super(ExtensionVersionList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + self.system_data = None + + +class ExtensionVersionListValueItem(msrest.serialization.Model): + """ExtensionVersionListValueItem. + + :ivar release_train: The release train for this Extension Type. + :vartype release_train: str + :ivar versions: Versions available for this Extension Type and release train. + :vartype versions: list[str] + """ + + _attribute_map = { + 'release_train': {'key': 'releaseTrain', 'type': 'str'}, + 'versions': {'key': 'versions', 'type': '[str]'}, + } + + def __init__( + self, + *, + release_train: Optional[str] = None, + versions: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword release_train: The release train for this Extension Type. + :paramtype release_train: str + :keyword versions: Versions available for this Extension Type and release train. + :paramtype versions: list[str] + """ + super(ExtensionVersionListValueItem, self).__init__(**kwargs) + self.release_train = release_train + self.versions = versions + + +class FluxConfiguration(ProxyResource): + """The Flux Configuration object returned in Get & Put response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.SystemData + :ivar scope: Scope at which the operator will be installed. Possible values include: "cluster", + "namespace". Default value: "cluster". + :vartype scope: str or ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ScopeType + :ivar namespace: The namespace to which this configuration is installed to. Maximum of 253 + lower case alphanumeric characters, hyphen and period only. + :vartype namespace: str + :ivar source_kind: Source Kind to pull the configuration data from. Possible values include: + "GitRepository", "Bucket". + :vartype source_kind: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.SourceKindType + :ivar suspend: Whether this configuration should suspend its reconciliation of its + kustomizations and sources. + :vartype suspend: bool + :ivar git_repository: Parameters to reconcile to the GitRepository source kind type. + :vartype git_repository: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.GitRepositoryDefinition + :ivar bucket: Parameters to reconcile to the Bucket source kind type. + :vartype bucket: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.BucketDefinition + :ivar kustomizations: Array of kustomizations used to reconcile the artifact pulled by the + source type on the cluster. + :vartype kustomizations: dict[str, + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.KustomizationDefinition] + :ivar configuration_protected_settings: Key-value pairs of protected configuration settings for + the configuration. + :vartype configuration_protected_settings: dict[str, str] + :ivar statuses: Statuses of the Flux Kubernetes resources created by the fluxConfiguration or + created by the managed objects provisioned by the fluxConfiguration. + :vartype statuses: + list[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ObjectStatusDefinition] + :ivar repository_public_key: Public Key associated with this fluxConfiguration (either + generated within the cluster or provided by the user). + :vartype repository_public_key: str + :ivar last_source_updated_commit_id: Branch and SHA of the last source commit synced with the + cluster. + :vartype last_source_updated_commit_id: str + :ivar last_source_updated_at: Datetime the fluxConfiguration last synced its source on the + cluster. + :vartype last_source_updated_at: ~datetime.datetime + :ivar compliance_state: Combined status of the Flux Kubernetes resources created by the + fluxConfiguration or created by the managed objects. Possible values include: "Compliant", + "Non-Compliant", "Pending", "Suspended", "Unknown". Default value: "Unknown". + :vartype compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.FluxComplianceState + :ivar provisioning_state: Status of the creation of the fluxConfiguration. Possible values + include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ProvisioningState + :ivar error_message: Error message returned to the user in the case of provisioning failure. + :vartype error_message: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'statuses': {'readonly': True}, + 'repository_public_key': {'readonly': True}, + 'last_source_updated_commit_id': {'readonly': True}, + 'last_source_updated_at': {'readonly': True}, + 'compliance_state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'error_message': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'namespace': {'key': 'properties.namespace', 'type': 'str'}, + 'source_kind': {'key': 'properties.sourceKind', 'type': 'str'}, + 'suspend': {'key': 'properties.suspend', 'type': 'bool'}, + 'git_repository': {'key': 'properties.gitRepository', 'type': 'GitRepositoryDefinition'}, + 'bucket': {'key': 'properties.bucket', 'type': 'BucketDefinition'}, + 'kustomizations': {'key': 'properties.kustomizations', 'type': '{KustomizationDefinition}'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, + 'statuses': {'key': 'properties.statuses', 'type': '[ObjectStatusDefinition]'}, + 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, + 'last_source_updated_commit_id': {'key': 'properties.lastSourceUpdatedCommitId', 'type': 'str'}, + 'last_source_updated_at': {'key': 'properties.lastSourceUpdatedAt', 'type': 'iso-8601'}, + 'compliance_state': {'key': 'properties.complianceState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'error_message': {'key': 'properties.errorMessage', 'type': 'str'}, + } + + def __init__( + self, + *, + scope: Optional[Union[str, "ScopeType"]] = "cluster", + namespace: Optional[str] = "default", + source_kind: Optional[Union[str, "SourceKindType"]] = None, + suspend: Optional[bool] = False, + git_repository: Optional["GitRepositoryDefinition"] = None, + bucket: Optional["BucketDefinition"] = None, + kustomizations: Optional[Dict[str, "KustomizationDefinition"]] = None, + configuration_protected_settings: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword scope: Scope at which the operator will be installed. Possible values include: + "cluster", "namespace". Default value: "cluster". + :paramtype scope: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ScopeType + :keyword namespace: The namespace to which this configuration is installed to. Maximum of 253 + lower case alphanumeric characters, hyphen and period only. + :paramtype namespace: str + :keyword source_kind: Source Kind to pull the configuration data from. Possible values include: + "GitRepository", "Bucket". + :paramtype source_kind: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.SourceKindType + :keyword suspend: Whether this configuration should suspend its reconciliation of its + kustomizations and sources. + :paramtype suspend: bool + :keyword git_repository: Parameters to reconcile to the GitRepository source kind type. + :paramtype git_repository: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.GitRepositoryDefinition + :keyword bucket: Parameters to reconcile to the Bucket source kind type. + :paramtype bucket: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.BucketDefinition + :keyword kustomizations: Array of kustomizations used to reconcile the artifact pulled by the + source type on the cluster. + :paramtype kustomizations: dict[str, + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.KustomizationDefinition] + :keyword configuration_protected_settings: Key-value pairs of protected configuration settings + for the configuration. + :paramtype configuration_protected_settings: dict[str, str] + """ + super(FluxConfiguration, self).__init__(**kwargs) + self.system_data = None + self.scope = scope + self.namespace = namespace + self.source_kind = source_kind + self.suspend = suspend + self.git_repository = git_repository + self.bucket = bucket + self.kustomizations = kustomizations + self.configuration_protected_settings = configuration_protected_settings + self.statuses = None + self.repository_public_key = None + self.last_source_updated_commit_id = None + self.last_source_updated_at = None + self.compliance_state = None + self.provisioning_state = None + self.error_message = None + + +class FluxConfigurationPatch(msrest.serialization.Model): + """The Flux Configuration Patch Request object. + + :ivar source_kind: Source Kind to pull the configuration data from. Possible values include: + "GitRepository", "Bucket". + :vartype source_kind: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.SourceKindType + :ivar suspend: Whether this configuration should suspend its reconciliation of its + kustomizations and sources. + :vartype suspend: bool + :ivar git_repository: Parameters to reconcile to the GitRepository source kind type. + :vartype git_repository: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.GitRepositoryPatchDefinition + :ivar bucket: Parameters to reconcile to the Bucket source kind type. + :vartype bucket: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.BucketDefinition + :ivar kustomizations: Array of kustomizations used to reconcile the artifact pulled by the + source type on the cluster. + :vartype kustomizations: dict[str, + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.KustomizationPatchDefinition] + :ivar configuration_protected_settings: Key-value pairs of protected configuration settings for + the configuration. + :vartype configuration_protected_settings: dict[str, str] + """ + + _attribute_map = { + 'source_kind': {'key': 'properties.sourceKind', 'type': 'str'}, + 'suspend': {'key': 'properties.suspend', 'type': 'bool'}, + 'git_repository': {'key': 'properties.gitRepository', 'type': 'GitRepositoryPatchDefinition'}, + 'bucket': {'key': 'properties.bucket', 'type': 'BucketDefinition'}, + 'kustomizations': {'key': 'properties.kustomizations', 'type': '{KustomizationPatchDefinition}'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, + } + + def __init__( + self, + *, + source_kind: Optional[Union[str, "SourceKindType"]] = None, + suspend: Optional[bool] = None, + git_repository: Optional["GitRepositoryPatchDefinition"] = None, + bucket: Optional["BucketDefinition"] = None, + kustomizations: Optional[Dict[str, "KustomizationPatchDefinition"]] = None, + configuration_protected_settings: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword source_kind: Source Kind to pull the configuration data from. Possible values include: + "GitRepository", "Bucket". + :paramtype source_kind: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.SourceKindType + :keyword suspend: Whether this configuration should suspend its reconciliation of its + kustomizations and sources. + :paramtype suspend: bool + :keyword git_repository: Parameters to reconcile to the GitRepository source kind type. + :paramtype git_repository: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.GitRepositoryPatchDefinition + :keyword bucket: Parameters to reconcile to the Bucket source kind type. + :paramtype bucket: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.BucketDefinition + :keyword kustomizations: Array of kustomizations used to reconcile the artifact pulled by the + source type on the cluster. + :paramtype kustomizations: dict[str, + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.KustomizationPatchDefinition] + :keyword configuration_protected_settings: Key-value pairs of protected configuration settings + for the configuration. + :paramtype configuration_protected_settings: dict[str, str] + """ + super(FluxConfigurationPatch, self).__init__(**kwargs) + self.source_kind = source_kind + self.suspend = suspend + self.git_repository = git_repository + self.bucket = bucket + self.kustomizations = kustomizations + self.configuration_protected_settings = configuration_protected_settings + + +class FluxConfigurationsList(msrest.serialization.Model): + """Result of the request to list Flux Configurations. It contains a list of FluxConfiguration objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Flux Configurations within a Kubernetes cluster. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.FluxConfiguration] + :ivar next_link: URL to get the next set of configuration objects, if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FluxConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(FluxConfigurationsList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class GitRepositoryDefinition(msrest.serialization.Model): + """Parameters to reconcile to the GitRepository source kind type. + + :ivar url: The URL to sync for the flux configuration git repository. + :vartype url: str + :ivar timeout_in_seconds: The maximum time to attempt to reconcile the cluster git repository + source with the remote. + :vartype timeout_in_seconds: long + :ivar sync_interval_in_seconds: The interval at which to re-reconcile the cluster git + repository source with the remote. + :vartype sync_interval_in_seconds: long + :ivar repository_ref: The source reference for the GitRepository object. + :vartype repository_ref: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.RepositoryRefDefinition + :ivar ssh_known_hosts: Base64-encoded known_hosts value containing public SSH keys required to + access private git repositories over SSH. + :vartype ssh_known_hosts: str + :ivar https_user: Plaintext HTTPS username used to access private git repositories over HTTPS. + :vartype https_user: str + :ivar https_ca_cert: Base64-encoded HTTPS certificate authority contents used to access git + private git repositories over HTTPS. + :vartype https_ca_cert: str + :ivar local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :vartype local_auth_ref: str + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'timeout_in_seconds': {'key': 'timeoutInSeconds', 'type': 'long'}, + 'sync_interval_in_seconds': {'key': 'syncIntervalInSeconds', 'type': 'long'}, + 'repository_ref': {'key': 'repositoryRef', 'type': 'RepositoryRefDefinition'}, + 'ssh_known_hosts': {'key': 'sshKnownHosts', 'type': 'str'}, + 'https_user': {'key': 'httpsUser', 'type': 'str'}, + 'https_ca_cert': {'key': 'httpsCACert', 'type': 'str'}, + 'local_auth_ref': {'key': 'localAuthRef', 'type': 'str'}, + } + + def __init__( + self, + *, + url: Optional[str] = None, + timeout_in_seconds: Optional[int] = 600, + sync_interval_in_seconds: Optional[int] = 600, + repository_ref: Optional["RepositoryRefDefinition"] = None, + ssh_known_hosts: Optional[str] = None, + https_user: Optional[str] = None, + https_ca_cert: Optional[str] = None, + local_auth_ref: Optional[str] = None, + **kwargs + ): + """ + :keyword url: The URL to sync for the flux configuration git repository. + :paramtype url: str + :keyword timeout_in_seconds: The maximum time to attempt to reconcile the cluster git + repository source with the remote. + :paramtype timeout_in_seconds: long + :keyword sync_interval_in_seconds: The interval at which to re-reconcile the cluster git + repository source with the remote. + :paramtype sync_interval_in_seconds: long + :keyword repository_ref: The source reference for the GitRepository object. + :paramtype repository_ref: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.RepositoryRefDefinition + :keyword ssh_known_hosts: Base64-encoded known_hosts value containing public SSH keys required + to access private git repositories over SSH. + :paramtype ssh_known_hosts: str + :keyword https_user: Plaintext HTTPS username used to access private git repositories over + HTTPS. + :paramtype https_user: str + :keyword https_ca_cert: Base64-encoded HTTPS certificate authority contents used to access git + private git repositories over HTTPS. + :paramtype https_ca_cert: str + :keyword local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :paramtype local_auth_ref: str + """ + super(GitRepositoryDefinition, self).__init__(**kwargs) + self.url = url + self.timeout_in_seconds = timeout_in_seconds + self.sync_interval_in_seconds = sync_interval_in_seconds + self.repository_ref = repository_ref + self.ssh_known_hosts = ssh_known_hosts + self.https_user = https_user + self.https_ca_cert = https_ca_cert + self.local_auth_ref = local_auth_ref + + +class GitRepositoryPatchDefinition(msrest.serialization.Model): + """Parameters to reconcile to the GitRepository source kind type. + + :ivar url: The URL to sync for the flux configuration git repository. + :vartype url: str + :ivar timeout_in_seconds: The maximum time to attempt to reconcile the cluster git repository + source with the remote. + :vartype timeout_in_seconds: long + :ivar sync_interval_in_seconds: The interval at which to re-reconcile the cluster git + repository source with the remote. + :vartype sync_interval_in_seconds: long + :ivar repository_ref: The source reference for the GitRepository object. + :vartype repository_ref: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.RepositoryRefDefinition + :ivar ssh_known_hosts: Base64-encoded known_hosts value containing public SSH keys required to + access private git repositories over SSH. + :vartype ssh_known_hosts: str + :ivar https_user: Plaintext HTTPS username used to access private git repositories over HTTPS. + :vartype https_user: str + :ivar https_ca_cert: Base64-encoded HTTPS certificate authority contents used to access git + private git repositories over HTTPS. + :vartype https_ca_cert: str + :ivar local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :vartype local_auth_ref: str + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'timeout_in_seconds': {'key': 'timeoutInSeconds', 'type': 'long'}, + 'sync_interval_in_seconds': {'key': 'syncIntervalInSeconds', 'type': 'long'}, + 'repository_ref': {'key': 'repositoryRef', 'type': 'RepositoryRefDefinition'}, + 'ssh_known_hosts': {'key': 'sshKnownHosts', 'type': 'str'}, + 'https_user': {'key': 'httpsUser', 'type': 'str'}, + 'https_ca_cert': {'key': 'httpsCACert', 'type': 'str'}, + 'local_auth_ref': {'key': 'localAuthRef', 'type': 'str'}, + } + + def __init__( + self, + *, + url: Optional[str] = None, + timeout_in_seconds: Optional[int] = None, + sync_interval_in_seconds: Optional[int] = None, + repository_ref: Optional["RepositoryRefDefinition"] = None, + ssh_known_hosts: Optional[str] = None, + https_user: Optional[str] = None, + https_ca_cert: Optional[str] = None, + local_auth_ref: Optional[str] = None, + **kwargs + ): + """ + :keyword url: The URL to sync for the flux configuration git repository. + :paramtype url: str + :keyword timeout_in_seconds: The maximum time to attempt to reconcile the cluster git + repository source with the remote. + :paramtype timeout_in_seconds: long + :keyword sync_interval_in_seconds: The interval at which to re-reconcile the cluster git + repository source with the remote. + :paramtype sync_interval_in_seconds: long + :keyword repository_ref: The source reference for the GitRepository object. + :paramtype repository_ref: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.RepositoryRefDefinition + :keyword ssh_known_hosts: Base64-encoded known_hosts value containing public SSH keys required + to access private git repositories over SSH. + :paramtype ssh_known_hosts: str + :keyword https_user: Plaintext HTTPS username used to access private git repositories over + HTTPS. + :paramtype https_user: str + :keyword https_ca_cert: Base64-encoded HTTPS certificate authority contents used to access git + private git repositories over HTTPS. + :paramtype https_ca_cert: str + :keyword local_auth_ref: Name of a local secret on the Kubernetes cluster to use as the + authentication secret rather than the managed or user-provided configuration secrets. + :paramtype local_auth_ref: str + """ + super(GitRepositoryPatchDefinition, self).__init__(**kwargs) + self.url = url + self.timeout_in_seconds = timeout_in_seconds + self.sync_interval_in_seconds = sync_interval_in_seconds + self.repository_ref = repository_ref + self.ssh_known_hosts = ssh_known_hosts + self.https_user = https_user + self.https_ca_cert = https_ca_cert + self.local_auth_ref = local_auth_ref + + +class HelmOperatorProperties(msrest.serialization.Model): + """Properties for Helm operator. + + :ivar chart_version: Version of the operator Helm chart. + :vartype chart_version: str + :ivar chart_values: Values override for the operator Helm chart. + :vartype chart_values: str + """ + + _attribute_map = { + 'chart_version': {'key': 'chartVersion', 'type': 'str'}, + 'chart_values': {'key': 'chartValues', 'type': 'str'}, + } + + def __init__( + self, + *, + chart_version: Optional[str] = None, + chart_values: Optional[str] = None, + **kwargs + ): + """ + :keyword chart_version: Version of the operator Helm chart. + :paramtype chart_version: str + :keyword chart_values: Values override for the operator Helm chart. + :paramtype chart_values: str + """ + super(HelmOperatorProperties, self).__init__(**kwargs) + self.chart_version = chart_version + self.chart_values = chart_values + + +class HelmReleasePropertiesDefinition(msrest.serialization.Model): + """HelmReleasePropertiesDefinition. + + :ivar last_revision_applied: The revision number of the last released object change. + :vartype last_revision_applied: long + :ivar helm_chart_ref: The reference to the HelmChart object used as the source to this + HelmRelease. + :vartype helm_chart_ref: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ObjectReferenceDefinition + :ivar failure_count: Total number of times that the HelmRelease failed to install or upgrade. + :vartype failure_count: long + :ivar install_failure_count: Number of times that the HelmRelease failed to install. + :vartype install_failure_count: long + :ivar upgrade_failure_count: Number of times that the HelmRelease failed to upgrade. + :vartype upgrade_failure_count: long + """ + + _attribute_map = { + 'last_revision_applied': {'key': 'lastRevisionApplied', 'type': 'long'}, + 'helm_chart_ref': {'key': 'helmChartRef', 'type': 'ObjectReferenceDefinition'}, + 'failure_count': {'key': 'failureCount', 'type': 'long'}, + 'install_failure_count': {'key': 'installFailureCount', 'type': 'long'}, + 'upgrade_failure_count': {'key': 'upgradeFailureCount', 'type': 'long'}, + } + + def __init__( + self, + *, + last_revision_applied: Optional[int] = None, + helm_chart_ref: Optional["ObjectReferenceDefinition"] = None, + failure_count: Optional[int] = None, + install_failure_count: Optional[int] = None, + upgrade_failure_count: Optional[int] = None, + **kwargs + ): + """ + :keyword last_revision_applied: The revision number of the last released object change. + :paramtype last_revision_applied: long + :keyword helm_chart_ref: The reference to the HelmChart object used as the source to this + HelmRelease. + :paramtype helm_chart_ref: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ObjectReferenceDefinition + :keyword failure_count: Total number of times that the HelmRelease failed to install or + upgrade. + :paramtype failure_count: long + :keyword install_failure_count: Number of times that the HelmRelease failed to install. + :paramtype install_failure_count: long + :keyword upgrade_failure_count: Number of times that the HelmRelease failed to upgrade. + :paramtype upgrade_failure_count: long + """ + super(HelmReleasePropertiesDefinition, self).__init__(**kwargs) + self.last_revision_applied = last_revision_applied + self.helm_chart_ref = helm_chart_ref + self.failure_count = failure_count + self.install_failure_count = install_failure_count + self.upgrade_failure_count = upgrade_failure_count + + +class Identity(msrest.serialization.Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: The identity type. The only acceptable values to pass in are None and + "SystemAssigned". The default value is None. + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + **kwargs + ): + """ + :keyword type: The identity type. The only acceptable values to pass in are None and + "SystemAssigned". The default value is None. + :paramtype type: str + """ + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + +class KustomizationDefinition(msrest.serialization.Model): + """The Kustomization defining how to reconcile the artifact pulled by the source type on the cluster. + + :ivar path: The path in the source reference to reconcile on the cluster. + :vartype path: str + :ivar depends_on: Specifies other Kustomizations that this Kustomization depends on. This + Kustomization will not reconcile until all dependencies have completed their reconciliation. + :vartype depends_on: + list[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.DependsOnDefinition] + :ivar timeout_in_seconds: The maximum time to attempt to reconcile the Kustomization on the + cluster. + :vartype timeout_in_seconds: long + :ivar sync_interval_in_seconds: The interval at which to re-reconcile the Kustomization on the + cluster. + :vartype sync_interval_in_seconds: long + :ivar retry_interval_in_seconds: The interval at which to re-reconcile the Kustomization on the + cluster in the event of failure on reconciliation. + :vartype retry_interval_in_seconds: long + :ivar prune: Enable/disable garbage collections of Kubernetes objects created by this + Kustomization. + :vartype prune: bool + :ivar force: Enable/disable re-creating Kubernetes resources on the cluster when patching fails + due to an immutable field change. + :vartype force: bool + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'depends_on': {'key': 'dependsOn', 'type': '[DependsOnDefinition]'}, + 'timeout_in_seconds': {'key': 'timeoutInSeconds', 'type': 'long'}, + 'sync_interval_in_seconds': {'key': 'syncIntervalInSeconds', 'type': 'long'}, + 'retry_interval_in_seconds': {'key': 'retryIntervalInSeconds', 'type': 'long'}, + 'prune': {'key': 'prune', 'type': 'bool'}, + 'force': {'key': 'force', 'type': 'bool'}, + } + + def __init__( + self, + *, + path: Optional[str] = "", + depends_on: Optional[List["DependsOnDefinition"]] = None, + timeout_in_seconds: Optional[int] = 600, + sync_interval_in_seconds: Optional[int] = 600, + retry_interval_in_seconds: Optional[int] = None, + prune: Optional[bool] = False, + force: Optional[bool] = False, + **kwargs + ): + """ + :keyword path: The path in the source reference to reconcile on the cluster. + :paramtype path: str + :keyword depends_on: Specifies other Kustomizations that this Kustomization depends on. This + Kustomization will not reconcile until all dependencies have completed their reconciliation. + :paramtype depends_on: + list[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.DependsOnDefinition] + :keyword timeout_in_seconds: The maximum time to attempt to reconcile the Kustomization on the + cluster. + :paramtype timeout_in_seconds: long + :keyword sync_interval_in_seconds: The interval at which to re-reconcile the Kustomization on + the cluster. + :paramtype sync_interval_in_seconds: long + :keyword retry_interval_in_seconds: The interval at which to re-reconcile the Kustomization on + the cluster in the event of failure on reconciliation. + :paramtype retry_interval_in_seconds: long + :keyword prune: Enable/disable garbage collections of Kubernetes objects created by this + Kustomization. + :paramtype prune: bool + :keyword force: Enable/disable re-creating Kubernetes resources on the cluster when patching + fails due to an immutable field change. + :paramtype force: bool + """ + super(KustomizationDefinition, self).__init__(**kwargs) + self.path = path + self.depends_on = depends_on + self.timeout_in_seconds = timeout_in_seconds + self.sync_interval_in_seconds = sync_interval_in_seconds + self.retry_interval_in_seconds = retry_interval_in_seconds + self.prune = prune + self.force = force + + +class KustomizationPatchDefinition(msrest.serialization.Model): + """The Kustomization defining how to reconcile the artifact pulled by the source type on the cluster. + + :ivar path: The path in the source reference to reconcile on the cluster. + :vartype path: str + :ivar depends_on: Specifies other Kustomizations that this Kustomization depends on. This + Kustomization will not reconcile until all dependencies have completed their reconciliation. + :vartype depends_on: + list[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.DependsOnDefinition] + :ivar timeout_in_seconds: The maximum time to attempt to reconcile the Kustomization on the + cluster. + :vartype timeout_in_seconds: long + :ivar sync_interval_in_seconds: The interval at which to re-reconcile the Kustomization on the + cluster. + :vartype sync_interval_in_seconds: long + :ivar retry_interval_in_seconds: The interval at which to re-reconcile the Kustomization on the + cluster in the event of failure on reconciliation. + :vartype retry_interval_in_seconds: long + :ivar prune: Enable/disable garbage collections of Kubernetes objects created by this + Kustomization. + :vartype prune: bool + :ivar force: Enable/disable re-creating Kubernetes resources on the cluster when patching fails + due to an immutable field change. + :vartype force: bool + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'depends_on': {'key': 'dependsOn', 'type': '[DependsOnDefinition]'}, + 'timeout_in_seconds': {'key': 'timeoutInSeconds', 'type': 'long'}, + 'sync_interval_in_seconds': {'key': 'syncIntervalInSeconds', 'type': 'long'}, + 'retry_interval_in_seconds': {'key': 'retryIntervalInSeconds', 'type': 'long'}, + 'prune': {'key': 'prune', 'type': 'bool'}, + 'force': {'key': 'force', 'type': 'bool'}, + } + + def __init__( + self, + *, + path: Optional[str] = None, + depends_on: Optional[List["DependsOnDefinition"]] = None, + timeout_in_seconds: Optional[int] = None, + sync_interval_in_seconds: Optional[int] = None, + retry_interval_in_seconds: Optional[int] = None, + prune: Optional[bool] = None, + force: Optional[bool] = None, + **kwargs + ): + """ + :keyword path: The path in the source reference to reconcile on the cluster. + :paramtype path: str + :keyword depends_on: Specifies other Kustomizations that this Kustomization depends on. This + Kustomization will not reconcile until all dependencies have completed their reconciliation. + :paramtype depends_on: + list[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.DependsOnDefinition] + :keyword timeout_in_seconds: The maximum time to attempt to reconcile the Kustomization on the + cluster. + :paramtype timeout_in_seconds: long + :keyword sync_interval_in_seconds: The interval at which to re-reconcile the Kustomization on + the cluster. + :paramtype sync_interval_in_seconds: long + :keyword retry_interval_in_seconds: The interval at which to re-reconcile the Kustomization on + the cluster in the event of failure on reconciliation. + :paramtype retry_interval_in_seconds: long + :keyword prune: Enable/disable garbage collections of Kubernetes objects created by this + Kustomization. + :paramtype prune: bool + :keyword force: Enable/disable re-creating Kubernetes resources on the cluster when patching + fails due to an immutable field change. + :paramtype force: bool + """ + super(KustomizationPatchDefinition, self).__init__(**kwargs) + self.path = path + self.depends_on = depends_on + self.timeout_in_seconds = timeout_in_seconds + self.sync_interval_in_seconds = sync_interval_in_seconds + self.retry_interval_in_seconds = retry_interval_in_seconds + self.prune = prune + self.force = force + + +class ObjectReferenceDefinition(msrest.serialization.Model): + """Object reference to a Kubernetes object on a cluster. + + :ivar name: Name of the object. + :vartype name: str + :ivar namespace: Namespace of the object. + :vartype namespace: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + namespace: Optional[str] = None, + **kwargs + ): + """ + :keyword name: Name of the object. + :paramtype name: str + :keyword namespace: Namespace of the object. + :paramtype namespace: str + """ + super(ObjectReferenceDefinition, self).__init__(**kwargs) + self.name = name + self.namespace = namespace + + +class ObjectStatusConditionDefinition(msrest.serialization.Model): + """Status condition of Kubernetes object. + + :ivar last_transition_time: Last time this status condition has changed. + :vartype last_transition_time: ~datetime.datetime + :ivar message: A more verbose description of the object status condition. + :vartype message: str + :ivar reason: Reason for the specified status condition type status. + :vartype reason: str + :ivar status: Status of the Kubernetes object condition type. + :vartype status: str + :ivar type: Object status condition type for this object. + :vartype type: str + """ + + _attribute_map = { + 'last_transition_time': {'key': 'lastTransitionTime', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + last_transition_time: Optional[datetime.datetime] = None, + message: Optional[str] = None, + reason: Optional[str] = None, + status: Optional[str] = None, + type: Optional[str] = None, + **kwargs + ): + """ + :keyword last_transition_time: Last time this status condition has changed. + :paramtype last_transition_time: ~datetime.datetime + :keyword message: A more verbose description of the object status condition. + :paramtype message: str + :keyword reason: Reason for the specified status condition type status. + :paramtype reason: str + :keyword status: Status of the Kubernetes object condition type. + :paramtype status: str + :keyword type: Object status condition type for this object. + :paramtype type: str + """ + super(ObjectStatusConditionDefinition, self).__init__(**kwargs) + self.last_transition_time = last_transition_time + self.message = message + self.reason = reason + self.status = status + self.type = type + + +class ObjectStatusDefinition(msrest.serialization.Model): + """Statuses of objects deployed by the user-specified kustomizations from the git repository. + + :ivar name: Name of the applied object. + :vartype name: str + :ivar namespace: Namespace of the applied object. + :vartype namespace: str + :ivar kind: Kind of the applied object. + :vartype kind: str + :ivar compliance_state: Compliance state of the applied object showing whether the applied + object has come into a ready state on the cluster. Possible values include: "Compliant", + "Non-Compliant", "Pending", "Suspended", "Unknown". Default value: "Unknown". + :vartype compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.FluxComplianceState + :ivar applied_by: Object reference to the Kustomization that applied this object. + :vartype applied_by: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ObjectReferenceDefinition + :ivar status_conditions: List of Kubernetes object status conditions present on the cluster. + :vartype status_conditions: + list[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ObjectStatusConditionDefinition] + :ivar helm_release_properties: Additional properties that are provided from objects of the + HelmRelease kind. + :vartype helm_release_properties: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.HelmReleasePropertiesDefinition + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'compliance_state': {'key': 'complianceState', 'type': 'str'}, + 'applied_by': {'key': 'appliedBy', 'type': 'ObjectReferenceDefinition'}, + 'status_conditions': {'key': 'statusConditions', 'type': '[ObjectStatusConditionDefinition]'}, + 'helm_release_properties': {'key': 'helmReleaseProperties', 'type': 'HelmReleasePropertiesDefinition'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + namespace: Optional[str] = None, + kind: Optional[str] = None, + compliance_state: Optional[Union[str, "FluxComplianceState"]] = "Unknown", + applied_by: Optional["ObjectReferenceDefinition"] = None, + status_conditions: Optional[List["ObjectStatusConditionDefinition"]] = None, + helm_release_properties: Optional["HelmReleasePropertiesDefinition"] = None, + **kwargs + ): + """ + :keyword name: Name of the applied object. + :paramtype name: str + :keyword namespace: Namespace of the applied object. + :paramtype namespace: str + :keyword kind: Kind of the applied object. + :paramtype kind: str + :keyword compliance_state: Compliance state of the applied object showing whether the applied + object has come into a ready state on the cluster. Possible values include: "Compliant", + "Non-Compliant", "Pending", "Suspended", "Unknown". Default value: "Unknown". + :paramtype compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.FluxComplianceState + :keyword applied_by: Object reference to the Kustomization that applied this object. + :paramtype applied_by: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ObjectReferenceDefinition + :keyword status_conditions: List of Kubernetes object status conditions present on the cluster. + :paramtype status_conditions: + list[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ObjectStatusConditionDefinition] + :keyword helm_release_properties: Additional properties that are provided from objects of the + HelmRelease kind. + :paramtype helm_release_properties: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.HelmReleasePropertiesDefinition + """ + super(ObjectStatusDefinition, self).__init__(**kwargs) + self.name = name + self.namespace = namespace + self.kind = kind + self.compliance_state = compliance_state + self.applied_by = applied_by + self.status_conditions = status_conditions + self.helm_release_properties = helm_release_properties + + +class OperationStatusList(msrest.serialization.Model): + """The async operations in progress, in the cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of async operations in progress, in the cluster. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.OperationStatusResult] + :ivar next_link: URL to get the next set of Operation Result objects, if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OperationStatusResult]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(OperationStatusList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class OperationStatusResult(msrest.serialization.Model): + """The current status of an async operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Required. Operation status. + :vartype status: str + :ivar properties: Additional information, if available. + :vartype properties: dict[str, str] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ErrorDetail + """ + + _validation = { + 'status': {'required': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + *, + status: str, + id: Optional[str] = None, + name: Optional[str] = None, + properties: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword id: Fully qualified ID for the async operation. + :paramtype id: str + :keyword name: Name of the async operation. + :paramtype name: str + :keyword status: Required. Operation status. + :paramtype status: str + :keyword properties: Additional information, if available. + :paramtype properties: dict[str, str] + """ + super(OperationStatusResult, self).__init__(**kwargs) + self.id = id + self.name = name + self.status = status + self.properties = properties + self.error = None + + +class PatchExtension(msrest.serialization.Model): + """The Extension Patch Request object. + + :ivar auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade + of minor version, or not. + :vartype auto_upgrade_minor_version: bool + :ivar release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. Stable, + Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :vartype release_train: str + :ivar version: Version of the extension for this extension, if it is 'pinned' to a specific + version. autoUpgradeMinorVersion must be 'false'. + :vartype version: str + :ivar configuration_settings: Configuration settings, as name-value pairs for configuring this + extension. + :vartype configuration_settings: dict[str, str] + :ivar configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :vartype configuration_protected_settings: dict[str, str] + """ + + _attribute_map = { + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'release_train': {'key': 'properties.releaseTrain', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'configuration_settings': {'key': 'properties.configurationSettings', 'type': '{str}'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, + } + + def __init__( + self, + *, + auto_upgrade_minor_version: Optional[bool] = True, + release_train: Optional[str] = "Stable", + version: Optional[str] = None, + configuration_settings: Optional[Dict[str, str]] = None, + configuration_protected_settings: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword auto_upgrade_minor_version: Flag to note if this extension participates in auto + upgrade of minor version, or not. + :paramtype auto_upgrade_minor_version: bool + :keyword release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. + Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :paramtype release_train: str + :keyword version: Version of the extension for this extension, if it is 'pinned' to a specific + version. autoUpgradeMinorVersion must be 'false'. + :paramtype version: str + :keyword configuration_settings: Configuration settings, as name-value pairs for configuring + this extension. + :paramtype configuration_settings: dict[str, str] + :keyword configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :paramtype configuration_protected_settings: dict[str, str] + """ + super(PatchExtension, self).__init__(**kwargs) + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.release_train = release_train + self.version = version + self.configuration_settings = configuration_settings + self.configuration_protected_settings = configuration_protected_settings + + +class RepositoryRefDefinition(msrest.serialization.Model): + """The source reference for the GitRepository object. + + :ivar branch: The git repository branch name to checkout. + :vartype branch: str + :ivar tag: The git repository tag name to checkout. This takes precedence over branch. + :vartype tag: str + :ivar semver: The semver range used to match against git repository tags. This takes precedence + over tag. + :vartype semver: str + :ivar commit: The commit SHA to checkout. This value must be combined with the branch name to + be valid. This takes precedence over semver. + :vartype commit: str + """ + + _attribute_map = { + 'branch': {'key': 'branch', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'semver': {'key': 'semver', 'type': 'str'}, + 'commit': {'key': 'commit', 'type': 'str'}, + } + + def __init__( + self, + *, + branch: Optional[str] = None, + tag: Optional[str] = None, + semver: Optional[str] = None, + commit: Optional[str] = None, + **kwargs + ): + """ + :keyword branch: The git repository branch name to checkout. + :paramtype branch: str + :keyword tag: The git repository tag name to checkout. This takes precedence over branch. + :paramtype tag: str + :keyword semver: The semver range used to match against git repository tags. This takes + precedence over tag. + :paramtype semver: str + :keyword commit: The commit SHA to checkout. This value must be combined with the branch name + to be valid. This takes precedence over semver. + :paramtype commit: str + """ + super(RepositoryRefDefinition, self).__init__(**kwargs) + self.branch = branch + self.tag = tag + self.semver = semver + self.commit = commit + + +class ResourceProviderOperation(msrest.serialization.Model): + """Supported operation of this resource provider. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Operation name, in format of {provider}/{resource}/{operation}. + :vartype name: str + :ivar display: Display metadata associated with the operation. + :vartype display: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ResourceProviderOperationDisplay + :ivar is_data_action: The flag that indicates whether the operation applies to data plane. + :vartype is_data_action: bool + :ivar origin: Origin of the operation. + :vartype origin: str + """ + + _validation = { + 'is_data_action': {'readonly': True}, + 'origin': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional["ResourceProviderOperationDisplay"] = None, + **kwargs + ): + """ + :keyword name: Operation name, in format of {provider}/{resource}/{operation}. + :paramtype name: str + :keyword display: Display metadata associated with the operation. + :paramtype display: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ResourceProviderOperationDisplay + """ + super(ResourceProviderOperation, self).__init__(**kwargs) + self.name = name + self.display = display + self.is_data_action = None + self.origin = None + + +class ResourceProviderOperationDisplay(msrest.serialization.Model): + """Display metadata associated with the operation. + + :ivar provider: Resource provider: Microsoft KubernetesConfiguration. + :vartype provider: str + :ivar resource: Resource on which the operation is performed. + :vartype resource: str + :ivar operation: Type of operation: get, read, delete, etc. + :vartype operation: str + :ivar description: Description of this operation. + :vartype description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + """ + :keyword provider: Resource provider: Microsoft KubernetesConfiguration. + :paramtype provider: str + :keyword resource: Resource on which the operation is performed. + :paramtype resource: str + :keyword operation: Type of operation: get, read, delete, etc. + :paramtype operation: str + :keyword description: Description of this operation. + :paramtype description: str + """ + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class ResourceProviderOperationList(msrest.serialization.Model): + """Result of the request to list operations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of operations supported by this resource provider. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ResourceProviderOperation] + :ivar next_link: URL to the next set of results, if any. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ResourceProviderOperation"]] = None, + **kwargs + ): + """ + :keyword value: List of operations supported by this resource provider. + :paramtype value: + list[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ResourceProviderOperation] + """ + super(ResourceProviderOperationList, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class Scope(msrest.serialization.Model): + """Scope of the extension. It can be either Cluster or Namespace; but not both. + + :ivar cluster: Specifies that the scope of the extension is Cluster. + :vartype cluster: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ScopeCluster + :ivar namespace: Specifies that the scope of the extension is Namespace. + :vartype namespace: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ScopeNamespace + """ + + _attribute_map = { + 'cluster': {'key': 'cluster', 'type': 'ScopeCluster'}, + 'namespace': {'key': 'namespace', 'type': 'ScopeNamespace'}, + } + + def __init__( + self, + *, + cluster: Optional["ScopeCluster"] = None, + namespace: Optional["ScopeNamespace"] = None, + **kwargs + ): + """ + :keyword cluster: Specifies that the scope of the extension is Cluster. + :paramtype cluster: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ScopeCluster + :keyword namespace: Specifies that the scope of the extension is Namespace. + :paramtype namespace: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ScopeNamespace + """ + super(Scope, self).__init__(**kwargs) + self.cluster = cluster + self.namespace = namespace + + +class ScopeCluster(msrest.serialization.Model): + """Specifies that the scope of the extension is Cluster. + + :ivar release_namespace: Namespace where the extension Release must be placed, for a Cluster + scoped extension. If this namespace does not exist, it will be created. + :vartype release_namespace: str + """ + + _attribute_map = { + 'release_namespace': {'key': 'releaseNamespace', 'type': 'str'}, + } + + def __init__( + self, + *, + release_namespace: Optional[str] = None, + **kwargs + ): + """ + :keyword release_namespace: Namespace where the extension Release must be placed, for a Cluster + scoped extension. If this namespace does not exist, it will be created. + :paramtype release_namespace: str + """ + super(ScopeCluster, self).__init__(**kwargs) + self.release_namespace = release_namespace + + +class ScopeNamespace(msrest.serialization.Model): + """Specifies that the scope of the extension is Namespace. + + :ivar target_namespace: Namespace where the extension will be created for an Namespace scoped + extension. If this namespace does not exist, it will be created. + :vartype target_namespace: str + """ + + _attribute_map = { + 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, + } + + def __init__( + self, + *, + target_namespace: Optional[str] = None, + **kwargs + ): + """ + :keyword target_namespace: Namespace where the extension will be created for an Namespace + scoped extension. If this namespace does not exist, it will be created. + :paramtype target_namespace: str + """ + super(ScopeNamespace, self).__init__(**kwargs) + self.target_namespace = target_namespace + + +class SourceControlConfiguration(ProxyResource): + """The SourceControl Configuration object returned in Get & Put response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.SystemData + :ivar repository_url: Url of the SourceControl Repository. + :vartype repository_url: str + :ivar operator_namespace: The namespace to which this operator is installed to. Maximum of 253 + lower case alphanumeric characters, hyphen and period only. + :vartype operator_namespace: str + :ivar operator_instance_name: Instance name of the operator - identifying the specific + configuration. + :vartype operator_instance_name: str + :ivar operator_type: Type of the operator. Possible values include: "Flux". + :vartype operator_type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.OperatorType + :ivar operator_params: Any Parameters for the Operator instance in string format. + :vartype operator_params: str + :ivar configuration_protected_settings: Name-value pairs of protected configuration settings + for the configuration. + :vartype configuration_protected_settings: dict[str, str] + :ivar operator_scope: Scope at which the operator will be installed. Possible values include: + "cluster", "namespace". Default value: "cluster". + :vartype operator_scope: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.OperatorScopeType + :ivar repository_public_key: Public Key associated with this SourceControl configuration + (either generated within the cluster or provided by the user). + :vartype repository_public_key: str + :ivar ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH keys + required to access private Git instances. + :vartype ssh_known_hosts_contents: str + :ivar enable_helm_operator: Option to enable Helm Operator for this git configuration. + :vartype enable_helm_operator: bool + :ivar helm_operator_properties: Properties for Helm operator. + :vartype helm_operator_properties: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.HelmOperatorProperties + :ivar provisioning_state: The provisioning state of the resource provider. Possible values + include: "Accepted", "Deleting", "Running", "Succeeded", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ProvisioningStateType + :ivar compliance_status: Compliance Status of the Configuration. + :vartype compliance_status: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ComplianceStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'repository_public_key': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'compliance_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'operator_namespace': {'key': 'properties.operatorNamespace', 'type': 'str'}, + 'operator_instance_name': {'key': 'properties.operatorInstanceName', 'type': 'str'}, + 'operator_type': {'key': 'properties.operatorType', 'type': 'str'}, + 'operator_params': {'key': 'properties.operatorParams', 'type': 'str'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, + 'operator_scope': {'key': 'properties.operatorScope', 'type': 'str'}, + 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, + 'ssh_known_hosts_contents': {'key': 'properties.sshKnownHostsContents', 'type': 'str'}, + 'enable_helm_operator': {'key': 'properties.enableHelmOperator', 'type': 'bool'}, + 'helm_operator_properties': {'key': 'properties.helmOperatorProperties', 'type': 'HelmOperatorProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'compliance_status': {'key': 'properties.complianceStatus', 'type': 'ComplianceStatus'}, + } + + def __init__( + self, + *, + repository_url: Optional[str] = None, + operator_namespace: Optional[str] = "default", + operator_instance_name: Optional[str] = None, + operator_type: Optional[Union[str, "OperatorType"]] = None, + operator_params: Optional[str] = None, + configuration_protected_settings: Optional[Dict[str, str]] = None, + operator_scope: Optional[Union[str, "OperatorScopeType"]] = "cluster", + ssh_known_hosts_contents: Optional[str] = None, + enable_helm_operator: Optional[bool] = None, + helm_operator_properties: Optional["HelmOperatorProperties"] = None, + **kwargs + ): + """ + :keyword repository_url: Url of the SourceControl Repository. + :paramtype repository_url: str + :keyword operator_namespace: The namespace to which this operator is installed to. Maximum of + 253 lower case alphanumeric characters, hyphen and period only. + :paramtype operator_namespace: str + :keyword operator_instance_name: Instance name of the operator - identifying the specific + configuration. + :paramtype operator_instance_name: str + :keyword operator_type: Type of the operator. Possible values include: "Flux". + :paramtype operator_type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.OperatorType + :keyword operator_params: Any Parameters for the Operator instance in string format. + :paramtype operator_params: str + :keyword configuration_protected_settings: Name-value pairs of protected configuration settings + for the configuration. + :paramtype configuration_protected_settings: dict[str, str] + :keyword operator_scope: Scope at which the operator will be installed. Possible values + include: "cluster", "namespace". Default value: "cluster". + :paramtype operator_scope: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.OperatorScopeType + :keyword ssh_known_hosts_contents: Base64-encoded known_hosts contents containing public SSH + keys required to access private Git instances. + :paramtype ssh_known_hosts_contents: str + :keyword enable_helm_operator: Option to enable Helm Operator for this git configuration. + :paramtype enable_helm_operator: bool + :keyword helm_operator_properties: Properties for Helm operator. + :paramtype helm_operator_properties: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.HelmOperatorProperties + """ + super(SourceControlConfiguration, self).__init__(**kwargs) + self.system_data = None + self.repository_url = repository_url + self.operator_namespace = operator_namespace + self.operator_instance_name = operator_instance_name + self.operator_type = operator_type + self.operator_params = operator_params + self.configuration_protected_settings = configuration_protected_settings + self.operator_scope = operator_scope + self.repository_public_key = None + self.ssh_known_hosts_contents = ssh_known_hosts_contents + self.enable_helm_operator = enable_helm_operator + self.helm_operator_properties = helm_operator_properties + self.provisioning_state = None + self.compliance_status = None + + +class SourceControlConfigurationList(msrest.serialization.Model): + """Result of the request to list Source Control Configurations. It contains a list of SourceControlConfiguration objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Source Control Configurations within a Kubernetes cluster. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.SourceControlConfiguration] + :ivar next_link: URL to get the next set of configuration objects, if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SourceControlConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(SourceControlConfigurationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SupportedScopes(msrest.serialization.Model): + """Extension scopes. + + :ivar default_scope: Default extension scopes: cluster or namespace. + :vartype default_scope: str + :ivar cluster_scope_settings: Scope settings. + :vartype cluster_scope_settings: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ClusterScopeSettings + """ + + _attribute_map = { + 'default_scope': {'key': 'defaultScope', 'type': 'str'}, + 'cluster_scope_settings': {'key': 'clusterScopeSettings', 'type': 'ClusterScopeSettings'}, + } + + def __init__( + self, + *, + default_scope: Optional[str] = None, + cluster_scope_settings: Optional["ClusterScopeSettings"] = None, + **kwargs + ): + """ + :keyword default_scope: Default extension scopes: cluster or namespace. + :paramtype default_scope: str + :keyword cluster_scope_settings: Scope settings. + :paramtype cluster_scope_settings: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ClusterScopeSettings + """ + super(SupportedScopes, self).__init__(**kwargs) + self.default_scope = default_scope + self.cluster_scope_settings = cluster_scope_settings + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :vartype last_modified_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :paramtype created_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :paramtype last_modified_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.CreatedByType + :keyword last_modified_at: The timestamp of resource last modification (UTC). + :paramtype last_modified_at: ~datetime.datetime + """ + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/models/_source_control_configuration_client_enums.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/models/_source_control_configuration_client_enums.py new file mode 100644 index 00000000000..29b28882046 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/models/_source_control_configuration_client_enums.py @@ -0,0 +1,124 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum +from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta + + +class ComplianceStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The compliance state of the configuration. + """ + + PENDING = "Pending" + COMPLIANT = "Compliant" + NONCOMPLIANT = "Noncompliant" + INSTALLED = "Installed" + FAILED = "Failed" + +class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class ExtensionsClusterResourceName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + MANAGED_CLUSTERS = "managedClusters" + CONNECTED_CLUSTERS = "connectedClusters" + +class ExtensionsClusterRp(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + MICROSOFT_CONTAINER_SERVICE = "Microsoft.ContainerService" + MICROSOFT_KUBERNETES = "Microsoft.Kubernetes" + +class FluxComplianceState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Compliance state of the cluster object. + """ + + COMPLIANT = "Compliant" + NON_COMPLIANT = "Non-Compliant" + PENDING = "Pending" + SUSPENDED = "Suspended" + UNKNOWN = "Unknown" + +class KustomizationValidationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Specify whether to validate the Kubernetes objects referenced in the Kustomization before + applying them to the cluster. + """ + + NONE = "none" + CLIENT = "client" + SERVER = "server" + +class LevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Level of the status. + """ + + ERROR = "Error" + WARNING = "Warning" + INFORMATION = "Information" + +class MessageLevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Level of the message. + """ + + ERROR = "Error" + WARNING = "Warning" + INFORMATION = "Information" + +class OperatorScopeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Scope at which the operator will be installed. + """ + + CLUSTER = "cluster" + NAMESPACE = "namespace" + +class OperatorType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Type of the operator + """ + + FLUX = "Flux" + +class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The provisioning state of the resource. + """ + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + CREATING = "Creating" + UPDATING = "Updating" + DELETING = "Deleting" + +class ProvisioningStateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The provisioning state of the resource provider. + """ + + ACCEPTED = "Accepted" + DELETING = "Deleting" + RUNNING = "Running" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + +class ScopeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Scope at which the configuration will be installed. + """ + + CLUSTER = "cluster" + NAMESPACE = "namespace" + +class SourceKindType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Source Kind to pull the configuration data from. + """ + + GIT_REPOSITORY = "GitRepository" + BUCKET = "Bucket" diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/__init__.py new file mode 100644 index 00000000000..37008240af3 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/__init__.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._cluster_extension_type_operations import ClusterExtensionTypeOperations +from ._cluster_extension_types_operations import ClusterExtensionTypesOperations +from ._extension_type_versions_operations import ExtensionTypeVersionsOperations +from ._location_extension_types_operations import LocationExtensionTypesOperations +from ._extensions_operations import ExtensionsOperations +from ._operation_status_operations import OperationStatusOperations +from ._flux_configurations_operations import FluxConfigurationsOperations +from ._flux_config_operation_status_operations import FluxConfigOperationStatusOperations +from ._source_control_configurations_operations import SourceControlConfigurationsOperations +from ._operations import Operations + +__all__ = [ + 'ClusterExtensionTypeOperations', + 'ClusterExtensionTypesOperations', + 'ExtensionTypeVersionsOperations', + 'LocationExtensionTypesOperations', + 'ExtensionsOperations', + 'OperationStatusOperations', + 'FluxConfigurationsOperations', + 'FluxConfigOperationStatusOperations', + 'SourceControlConfigurationsOperations', + 'Operations', +] diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_cluster_extension_type_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_cluster_extension_type_operations.py new file mode 100644 index 00000000000..65d6128ce4c --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_cluster_extension_type_operations.py @@ -0,0 +1,156 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_type_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-15-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{extensionTypeName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "extensionTypeName": _SERIALIZER.url("extension_type_name", extension_type_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class ClusterExtensionTypeOperations(object): + """ClusterExtensionTypeOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_type_name: str, + **kwargs: Any + ) -> "_models.ExtensionType": + """Get Extension Type details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param extension_type_name: Extension type name. + :type extension_type_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExtensionType, or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionType + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionType"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_type_name=extension_type_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ExtensionType', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes/{extensionTypeName}'} # type: ignore + diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_cluster_extension_types_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_cluster_extension_types_operations.py new file mode 100644 index 00000000000..a11a0c09852 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_cluster_extension_types_operations.py @@ -0,0 +1,176 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-15-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class ClusterExtensionTypesOperations(object): + """ClusterExtensionTypesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + **kwargs: Any + ) -> Iterable["_models.ExtensionTypeList"]: + """Get Extension Types. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExtensionTypeList or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionTypeList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionTypeList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionTypeList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensionTypes'} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_extension_type_versions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_extension_type_versions_operations.py new file mode 100644 index 00000000000..77c96ba2eaf --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_extension_type_versions_operations.py @@ -0,0 +1,159 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + location: str, + extension_type_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-15-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/locations/{location}/extensionTypes/{extensionTypeName}/versions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "location": _SERIALIZER.url("location", location, 'str'), + "extensionTypeName": _SERIALIZER.url("extension_type_name", extension_type_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class ExtensionTypeVersionsOperations(object): + """ExtensionTypeVersionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + location: str, + extension_type_name: str, + **kwargs: Any + ) -> Iterable["_models.ExtensionVersionList"]: + """List available versions for an Extension Type. + + :param location: extension location. + :type location: str + :param extension_type_name: Extension type name. + :type extension_type_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExtensionVersionList or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionVersionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionVersionList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + location=location, + extension_type_name=extension_type_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + location=location, + extension_type_name=extension_type_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionVersionList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/locations/{location}/extensionTypes/{extensionTypeName}/versions'} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_extensions_operations.py new file mode 100644 index 00000000000..98cbe46745c --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_extensions_operations.py @@ -0,0 +1,840 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_create_request_initial( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "extensionName": _SERIALIZER.url("extension_name", extension_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "extensionName": _SERIALIZER.url("extension_name", extension_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_name: str, + *, + force_delete: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "extensionName": _SERIALIZER.url("extension_name", extension_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if force_delete is not None: + query_parameters['forceDelete'] = _SERIALIZER.query("force_delete", force_delete, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request_initial( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "extensionName": _SERIALIZER.url("extension_name", extension_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class ExtensionsOperations(object): + """ExtensionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_initial( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_name: str, + extension: "_models.Extension", + **kwargs: Any + ) -> "_models.Extension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(extension, 'Extension') + + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Extension', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Extension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_name: str, + extension: "_models.Extension", + **kwargs: Any + ) -> LROPoller["_models.Extension"]: + """Create a new Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param extension_name: Name of the Extension. + :type extension_name: str + :param extension: Properties necessary to Create an Extension. + :type extension: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.Extension + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either Extension or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.Extension] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + extension=extension, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('Extension', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_name: str, + **kwargs: Any + ) -> "_models.Extension": + """Gets Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param extension_name: Name of the Extension. + :type extension_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Extension, or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.Extension + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Extension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + + def _delete_initial( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + force_delete=force_delete, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension + from the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param extension_name: Name of the Extension. + :type extension_name: str + :param force_delete: Delete the extension resource in Azure - not the normal asynchronous + delete. + :type force_delete: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + force_delete=force_delete, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + def _update_initial( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_name: str, + patch_extension: "_models.PatchExtension", + **kwargs: Any + ) -> "_models.Extension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(patch_extension, 'PatchExtension') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Extension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_name: str, + patch_extension: "_models.PatchExtension", + **kwargs: Any + ) -> LROPoller["_models.Extension"]: + """Patch an existing Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param extension_name: Name of the Extension. + :type extension_name: str + :param patch_extension: Properties to Patch in an existing Extension. + :type patch_extension: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.PatchExtension + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either Extension or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.Extension] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + patch_extension=patch_extension, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('Extension', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + **kwargs: Any + ) -> Iterable["_models.ExtensionsList"]: + """List all Extensions in the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExtensionsList or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionsList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions'} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_flux_config_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_flux_config_operation_status_operations.py new file mode 100644 index 00000000000..223e75545c5 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_flux_config_operation_status_operations.py @@ -0,0 +1,162 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + flux_configuration_name: str, + operation_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}/operations/{operationId}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "fluxConfigurationName": _SERIALIZER.url("flux_configuration_name", flux_configuration_name, 'str'), + "operationId": _SERIALIZER.url("operation_id", operation_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class FluxConfigOperationStatusOperations(object): + """FluxConfigOperationStatusOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + flux_configuration_name: str, + operation_id: str, + **kwargs: Any + ) -> "_models.OperationStatusResult": + """Get Async Operation status. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. + :type flux_configuration_name: str + :param operation_id: operation Id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatusResult, or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.OperationStatusResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + operation_id=operation_id, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OperationStatusResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}/operations/{operationId}'} # type: ignore + diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_flux_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_flux_configurations_operations.py new file mode 100644 index 00000000000..87950e54b26 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_flux_configurations_operations.py @@ -0,0 +1,844 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + flux_configuration_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "fluxConfigurationName": _SERIALIZER.url("flux_configuration_name", flux_configuration_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + flux_configuration_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "fluxConfigurationName": _SERIALIZER.url("flux_configuration_name", flux_configuration_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_request_initial( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + flux_configuration_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "fluxConfigurationName": _SERIALIZER.url("flux_configuration_name", flux_configuration_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + flux_configuration_name: str, + *, + force_delete: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "fluxConfigurationName": _SERIALIZER.url("flux_configuration_name", flux_configuration_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if force_delete is not None: + query_parameters['forceDelete'] = _SERIALIZER.query("force_delete", force_delete, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class FluxConfigurationsOperations(object): + """FluxConfigurationsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + flux_configuration_name: str, + **kwargs: Any + ) -> "_models.FluxConfiguration": + """Gets details of the Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. + :type flux_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FluxConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.FluxConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FluxConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore + + + def _create_or_update_initial( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + flux_configuration_name: str, + flux_configuration: "_models.FluxConfiguration", + **kwargs: Any + ) -> "_models.FluxConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(flux_configuration, 'FluxConfiguration') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('FluxConfiguration', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('FluxConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + flux_configuration_name: str, + flux_configuration: "_models.FluxConfiguration", + **kwargs: Any + ) -> LROPoller["_models.FluxConfiguration"]: + """Create a new Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. + :type flux_configuration_name: str + :param flux_configuration: Properties necessary to Create a FluxConfiguration. + :type flux_configuration: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.FluxConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.FluxConfiguration] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + flux_configuration=flux_configuration, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('FluxConfiguration', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore + + def _update_initial( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + flux_configuration_name: str, + flux_configuration_patch: "_models.FluxConfigurationPatch", + **kwargs: Any + ) -> "_models.FluxConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(flux_configuration_patch, 'FluxConfigurationPatch') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FluxConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore + + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + flux_configuration_name: str, + flux_configuration_patch: "_models.FluxConfigurationPatch", + **kwargs: Any + ) -> LROPoller["_models.FluxConfiguration"]: + """Update an existing Kubernetes Flux Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. + :type flux_configuration_name: str + :param flux_configuration_patch: Properties to Patch in an existing Flux Configuration. + :type flux_configuration_patch: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.FluxConfigurationPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either FluxConfiguration or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.FluxConfiguration] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfiguration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + flux_configuration_patch=flux_configuration_patch, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('FluxConfiguration', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + flux_configuration_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + force_delete=force_delete, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore + + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + flux_configuration_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> LROPoller[None]: + """This will delete the YAML file used to set up the Flux Configuration, thus stopping future sync + from the source repo. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param flux_configuration_name: Name of the Flux Configuration. + :type flux_configuration_name: str + :param force_delete: Delete the extension resource in Azure - not the normal asynchronous + delete. + :type force_delete: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + flux_configuration_name=flux_configuration_name, + force_delete=force_delete, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}'} # type: ignore + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + **kwargs: Any + ) -> Iterable["_models.FluxConfigurationsList"]: + """List all Flux Configurations. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FluxConfigurationsList or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.FluxConfigurationsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FluxConfigurationsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("FluxConfigurationsList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations'} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_location_extension_types_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_location_extension_types_operations.py new file mode 100644 index 00000000000..5bc2fc8b26c --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_location_extension_types_operations.py @@ -0,0 +1,151 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + location: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-15-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/locations/{location}/extensionTypes') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class LocationExtensionTypesOperations(object): + """LocationExtensionTypesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + location: str, + **kwargs: Any + ) -> Iterable["_models.ExtensionTypeList"]: + """List all Extension Types. + + :param location: extension location. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExtensionTypeList or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionTypeList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionTypeList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + location=location, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + location=location, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionTypeList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/locations/{location}/extensionTypes'} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_operation_status_operations.py new file mode 100644 index 00000000000..8ac74a8b6e3 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_operation_status_operations.py @@ -0,0 +1,291 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_name: str, + operation_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "extensionName": _SERIALIZER.url("extension_name", extension_name, 'str'), + "operationId": _SERIALIZER.url("operation_id", operation_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/operations') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class OperationStatusOperations(object): + """OperationStatusOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + extension_name: str, + operation_id: str, + **kwargs: Any + ) -> "_models.OperationStatusResult": + """Get Async Operation status. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param extension_name: Name of the Extension. + :type extension_name: str + :param operation_id: operation Id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatusResult, or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.OperationStatusResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + operation_id=operation_id, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OperationStatusResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore + + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + **kwargs: Any + ) -> Iterable["_models.OperationStatusList"]: + """List Async Operations, currently in progress, in a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationStatusList or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.OperationStatusList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OperationStatusList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/operations'} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_operations.py new file mode 100644 index 00000000000..a7260755d38 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_operations.py @@ -0,0 +1,137 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.KubernetesConfiguration/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + **kwargs: Any + ) -> Iterable["_models.ResourceProviderOperationList"]: + """List all the available operations the KubernetesConfiguration resource provider supports. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceProviderOperationList or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ResourceProviderOperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceProviderOperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ResourceProviderOperationList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.KubernetesConfiguration/operations'} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_source_control_configurations_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_source_control_configurations_operations.py new file mode 100644 index 00000000000..c3ca075ad19 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_01_15_preview/operations/_source_control_configurations_operations.py @@ -0,0 +1,582 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + source_control_configuration_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "sourceControlConfigurationName": _SERIALIZER.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + source_control_configuration_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "sourceControlConfigurationName": _SERIALIZER.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + source_control_configuration_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "sourceControlConfigurationName": _SERIALIZER.url("source_control_configuration_name", source_control_configuration_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class SourceControlConfigurationsOperations(object): + """SourceControlConfigurationsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + source_control_configuration_name: str, + **kwargs: Any + ) -> "_models.SourceControlConfiguration": + """Gets details of the Source Control Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control Configuration. + :type source_control_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration, or the result of cls(response) + :rtype: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.SourceControlConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + source_control_configuration_name=source_control_configuration_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + source_control_configuration_name: str, + source_control_configuration: "_models.SourceControlConfiguration", + **kwargs: Any + ) -> "_models.SourceControlConfiguration": + """Create a new Kubernetes Source Control Configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control Configuration. + :type source_control_configuration_name: str + :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. + :type source_control_configuration: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.SourceControlConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControlConfiguration, or the result of cls(response) + :rtype: + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.SourceControlConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + source_control_configuration_name=source_control_configuration_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SourceControlConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + + + def _delete_initial( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + source_control_configuration_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + source_control_configuration_name=source_control_configuration_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + source_control_configuration_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """This will delete the YAML file used to set up the Source control configuration, thus stopping + future sync from the source repo. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control Configuration. + :type source_control_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + source_control_configuration_name=source_control_configuration_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} # type: ignore + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_rp: Union[str, "_models.ExtensionsClusterRp"], + cluster_resource_name: Union[str, "_models.ExtensionsClusterResourceName"], + cluster_name: str, + **kwargs: Any + ) -> Iterable["_models.SourceControlConfigurationList"]: + """List all Source Control Configurations. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS + clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). + :type cluster_rp: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterRp + :param cluster_resource_name: The Kubernetes cluster resource name - either managedClusters + (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). + :type cluster_resource_name: str or + ~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.ExtensionsClusterResourceName + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SourceControlConfigurationList or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_01_15_preview.models.SourceControlConfigurationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlConfigurationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SourceControlConfigurationList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations'} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_03_01/models/_models_py3.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_03_01/models/_models_py3.py index d3ddc1536de..6378d3e0d25 100644 --- a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_03_01/models/_models_py3.py +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_03_01/models/_models_py3.py @@ -428,8 +428,8 @@ class Extension(ProxyResource): :ivar release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. :vartype release_train: str - :ivar version: Version of the extension for this extension, if it is 'pinned' to a specific - version. autoUpgradeMinorVersion must be 'false'. + :ivar version: User-specified version of the extension for this extension to 'pin'. To use + 'version', autoUpgradeMinorVersion must be 'false'. :vartype version: str :ivar scope: Scope at which the extension is installed. :vartype scope: ~azure.mgmt.kubernetesconfiguration.v2022_03_01.models.Scope @@ -439,6 +439,8 @@ class Extension(ProxyResource): :ivar configuration_protected_settings: Configuration settings that are sensitive, as name-value pairs for configuring this extension. :vartype configuration_protected_settings: dict[str, str] + :ivar installed_version: Installed version of the extension. + :vartype installed_version: str :ivar provisioning_state: Status of installation of this extension. Possible values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". :vartype provisioning_state: str or @@ -461,6 +463,7 @@ class Extension(ProxyResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'system_data': {'readonly': True}, + 'installed_version': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'error_info': {'readonly': True}, 'custom_location_settings': {'readonly': True}, @@ -480,6 +483,7 @@ class Extension(ProxyResource): 'scope': {'key': 'properties.scope', 'type': 'Scope'}, 'configuration_settings': {'key': 'properties.configurationSettings', 'type': '{str}'}, 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, + 'installed_version': {'key': 'properties.installedVersion', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'statuses': {'key': 'properties.statuses', 'type': '[ExtensionStatus]'}, 'error_info': {'key': 'properties.errorInfo', 'type': 'ErrorDetail'}, @@ -516,8 +520,8 @@ def __init__( :keyword release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. :paramtype release_train: str - :keyword version: Version of the extension for this extension, if it is 'pinned' to a specific - version. autoUpgradeMinorVersion must be 'false'. + :keyword version: User-specified version of the extension for this extension to 'pin'. To use + 'version', autoUpgradeMinorVersion must be 'false'. :paramtype version: str :keyword scope: Scope at which the extension is installed. :paramtype scope: ~azure.mgmt.kubernetesconfiguration.v2022_03_01.models.Scope @@ -544,6 +548,7 @@ def __init__( self.scope = scope self.configuration_settings = configuration_settings self.configuration_protected_settings = configuration_protected_settings + self.installed_version = None self.provisioning_state = None self.statuses = statuses self.error_info = None @@ -1714,8 +1719,8 @@ class PatchExtension(msrest.serialization.Model): def __init__( self, *, - auto_upgrade_minor_version: Optional[bool] = None, - release_train: Optional[str] = None, + auto_upgrade_minor_version: Optional[bool] = True, + release_train: Optional[str] = "Stable", version: Optional[str] = None, configuration_settings: Optional[Dict[str, str]] = None, configuration_protected_settings: Optional[Dict[str, str]] = None, diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/__init__.py new file mode 100644 index 00000000000..e9096303633 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._source_control_configuration_client import SourceControlConfigurationClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['SourceControlConfigurationClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/_configuration.py new file mode 100644 index 00000000000..41cedb1d6a3 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/_configuration.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class SourceControlConfigurationClientConfiguration(Configuration): + """Configuration for SourceControlConfigurationClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2022-04-02-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-kubernetesconfiguration/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + 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 = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/_patch.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/_patch.py new file mode 100644 index 00000000000..74e48ecd07c --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/_source_control_configuration_client.py new file mode 100644 index 00000000000..f2dfa7cb902 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/_source_control_configuration_client.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.rest import HttpRequest, HttpResponse +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +from . import models +from ._configuration import SourceControlConfigurationClientConfiguration +from .operations import ExtensionsOperations, OperationStatusOperations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, PrivateLinkScopesOperations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + +class SourceControlConfigurationClient: + """KubernetesConfiguration Client. + + :ivar extensions: ExtensionsOperations operations + :vartype extensions: + azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.operations.ExtensionsOperations + :ivar operation_status: OperationStatusOperations operations + :vartype operation_status: + azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.operations.OperationStatusOperations + :ivar private_link_scopes: PrivateLinkScopesOperations operations + :vartype private_link_scopes: + azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.operations.PrivateLinkScopesOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: + azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.operations.PrivateLinkResourcesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: + azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.operations.PrivateEndpointConnectionsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operation_status = OperationStatusOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_scopes = PrivateLinkScopesOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + + + def _send_request( + self, + request, # type: HttpRequest + **kwargs: Any + ) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> SourceControlConfigurationClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/_vendor.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/_vendor.py new file mode 100644 index 00000000000..138f663c53a --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/_version.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/_version.py new file mode 100644 index 00000000000..59deb8c7263 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.1.0" diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/__init__.py new file mode 100644 index 00000000000..5f583276b4e --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/__init__.py @@ -0,0 +1,15 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._source_control_configuration_client import SourceControlConfigurationClient +__all__ = ['SourceControlConfigurationClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/_configuration.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/_configuration.py new file mode 100644 index 00000000000..f792add6d98 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/_configuration.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class SourceControlConfigurationClientConfiguration(Configuration): + """Configuration for SourceControlConfigurationClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(SourceControlConfigurationClientConfiguration, self).__init__(**kwargs) + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2022-04-02-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-kubernetesconfiguration/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + 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 = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/_patch.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/_patch.py new file mode 100644 index 00000000000..74e48ecd07c --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/_source_control_configuration_client.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/_source_control_configuration_client.py new file mode 100644 index 00000000000..d9aeb4a303f --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/_source_control_configuration_client.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING + +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +from .. import models +from ._configuration import SourceControlConfigurationClientConfiguration +from .operations import ExtensionsOperations, OperationStatusOperations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, PrivateLinkScopesOperations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +class SourceControlConfigurationClient: + """KubernetesConfiguration Client. + + :ivar extensions: ExtensionsOperations operations + :vartype extensions: + azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.aio.operations.ExtensionsOperations + :ivar operation_status: OperationStatusOperations operations + :vartype operation_status: + azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.aio.operations.OperationStatusOperations + :ivar private_link_scopes: PrivateLinkScopesOperations operations + :vartype private_link_scopes: + azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.aio.operations.PrivateLinkScopesOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: + azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.aio.operations.PrivateLinkResourcesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: + azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.aio.operations.PrivateEndpointConnectionsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = SourceControlConfigurationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operation_status = OperationStatusOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_scopes = PrivateLinkScopesOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize) + + + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "SourceControlConfigurationClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/__init__.py new file mode 100644 index 00000000000..2dbecc9b3cd --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/__init__.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._extensions_operations import ExtensionsOperations +from ._operation_status_operations import OperationStatusOperations +from ._private_link_scopes_operations import PrivateLinkScopesOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations + +__all__ = [ + 'ExtensionsOperations', + 'OperationStatusOperations', + 'PrivateLinkScopesOperations', + 'PrivateLinkResourcesOperations', + 'PrivateEndpointConnectionsOperations', +] diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/_extensions_operations.py new file mode 100644 index 00000000000..fd3ee8ce504 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/_extensions_operations.py @@ -0,0 +1,605 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._extensions_operations import build_create_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ExtensionsOperations: + """ExtensionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_initial( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + extension: "_models.Extension", + **kwargs: Any + ) -> "_models.Extension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(extension, 'Extension') + + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Extension', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Extension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + extension: "_models.Extension", + **kwargs: Any + ) -> AsyncLROPoller["_models.Extension"]: + """Create a new Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param extension_name: Name of the Extension. + :type extension_name: str + :param extension: Properties necessary to Create an Extension. + :type extension: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.Extension + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.Extension] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + extension=extension, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('Extension', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + **kwargs: Any + ) -> "_models.Extension": + """Gets Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param extension_name: Name of the Extension. + :type extension_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Extension, or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.Extension + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Extension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + + async def _delete_initial( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + force_delete=force_delete, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension + from the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param extension_name: Name of the Extension. + :type extension_name: str + :param force_delete: Delete the extension resource in Azure - not the normal asynchronous + delete. + :type force_delete: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + force_delete=force_delete, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + patch_extension: "_models.PatchExtension", + **kwargs: Any + ) -> "_models.Extension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(patch_extension, 'PatchExtension') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Extension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + patch_extension: "_models.PatchExtension", + **kwargs: Any + ) -> AsyncLROPoller["_models.Extension"]: + """Patch an existing Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param extension_name: Name of the Extension. + :type extension_name: str + :param patch_extension: Properties to Patch in an existing Extension. + :type patch_extension: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PatchExtension + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Extension or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.Extension] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + patch_extension=patch_extension, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('Extension', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ExtensionsList"]: + """List all Extensions in the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExtensionsList or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.ExtensionsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionsList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions'} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/_operation_status_operations.py new file mode 100644 index 00000000000..94dff99771c --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/_operation_status_operations.py @@ -0,0 +1,115 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._operation_status_operations import build_get_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OperationStatusOperations: + """OperationStatusOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + operation_id: str, + **kwargs: Any + ) -> "_models.OperationStatusResult": + """Get Async Operation status. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param extension_name: Name of the Extension. + :type extension_name: str + :param operation_id: operation Id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatusResult, or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.OperationStatusResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + operation_id=operation_id, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OperationStatusResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore + diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/_private_endpoint_connections_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/_private_endpoint_connections_operations.py new file mode 100644 index 00000000000..0b181475c34 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,388 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._private_endpoint_connections_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_private_link_scope_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations: + """PrivateEndpointConnectionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + scope_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + """Gets a private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + scope_name=scope_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + + async def _create_or_update_initial( + self, + resource_group_name: str, + scope_name: str, + private_endpoint_connection_name: str, + properties: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> Optional["_models.PrivateEndpointConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateEndpointConnection"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(properties, 'PrivateEndpointConnection') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + scope_name=scope_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + scope_name: str, + private_endpoint_connection_name: str, + properties: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> AsyncLROPoller["_models.PrivateEndpointConnection"]: + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. + :type properties: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateEndpointConnection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + scope_name=scope_name, + private_endpoint_connection_name=private_endpoint_connection_name, + properties=properties, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + scope_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + scope_name=scope_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + scope_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + scope_name=scope_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace_async + async def list_by_private_link_scope( + self, + resource_group_name: str, + scope_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnectionListResult": + """Gets all private endpoint connections on a private link scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionListResult, or the result of cls(response) + :rtype: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateEndpointConnectionListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_list_by_private_link_scope_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + scope_name=scope_name, + template_url=self.list_by_private_link_scope.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_by_private_link_scope.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections'} # type: ignore + diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/_private_link_resources_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/_private_link_resources_operations.py new file mode 100644 index 00000000000..de4c77f0e56 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/_private_link_resources_operations.py @@ -0,0 +1,154 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._private_link_resources_operations import build_get_request, build_list_by_private_link_scope_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourcesOperations: + """PrivateLinkResourcesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace_async + async def list_by_private_link_scope( + self, + resource_group_name: str, + scope_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourceListResult": + """Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourceListResult, or the result of cls(response) + :rtype: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateLinkResourceListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_list_by_private_link_scope_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + scope_name=scope_name, + template_url=self.list_by_private_link_scope.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_by_private_link_scope.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateLinkResources'} # type: ignore + + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + scope_name: str, + group_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResource": + """Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param group_name: The name of the private link resource. + :type group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResource, or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateLinkResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + scope_name=scope_name, + group_name=group_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}'} # type: ignore + diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/_private_link_scopes_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/_private_link_scopes_operations.py new file mode 100644 index 00000000000..1fdd8a440cc --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/aio/operations/_private_link_scopes_operations.py @@ -0,0 +1,467 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._private_link_scopes_operations import build_create_or_update_request, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_request, build_update_tags_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkScopesOperations: + """PrivateLinkScopesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.KubernetesConfigurationPrivateLinkScopeListResult"]: + """Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either KubernetesConfigurationPrivateLinkScopeListResult + or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.KubernetesConfigurationPrivateLinkScopeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KubernetesConfigurationPrivateLinkScopeListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("KubernetesConfigurationPrivateLinkScopeListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes'} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.KubernetesConfigurationPrivateLinkScopeListResult"]: + """Gets a list of Azure Arc PrivateLinkScopes within a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either KubernetesConfigurationPrivateLinkScopeListResult + or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.KubernetesConfigurationPrivateLinkScopeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KubernetesConfigurationPrivateLinkScopeListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("KubernetesConfigurationPrivateLinkScopeListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + scope_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + scope_name=scope_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}'} # type: ignore + + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + scope_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a Azure Arc PrivateLinkScope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + scope_name=scope_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}'} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + scope_name: str, + **kwargs: Any + ) -> "_models.KubernetesConfigurationPrivateLinkScope": + """Returns a Azure Arc PrivateLinkScope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KubernetesConfigurationPrivateLinkScope, or the result of cls(response) + :rtype: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.KubernetesConfigurationPrivateLinkScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KubernetesConfigurationPrivateLinkScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + scope_name=scope_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('KubernetesConfigurationPrivateLinkScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}'} # type: ignore + + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + scope_name: str, + parameters: "_models.KubernetesConfigurationPrivateLinkScope", + **kwargs: Any + ) -> "_models.KubernetesConfigurationPrivateLinkScope": + """Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value + for InstrumentationKey nor AppId in the Put operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param parameters: Properties that need to be specified to create or update a Azure Arc for + Servers and Clusters PrivateLinkScope. + :type parameters: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.KubernetesConfigurationPrivateLinkScope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KubernetesConfigurationPrivateLinkScope, or the result of cls(response) + :rtype: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.KubernetesConfigurationPrivateLinkScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KubernetesConfigurationPrivateLinkScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'KubernetesConfigurationPrivateLinkScope') + + request = build_create_or_update_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + scope_name=scope_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KubernetesConfigurationPrivateLinkScope', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KubernetesConfigurationPrivateLinkScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}'} # type: ignore + + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + scope_name: str, + private_link_scope_tags: "_models.TagsResource", + **kwargs: Any + ) -> "_models.KubernetesConfigurationPrivateLinkScope": + """Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate + method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param private_link_scope_tags: Updated tag information to set into the PrivateLinkScope + instance. + :type private_link_scope_tags: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.TagsResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KubernetesConfigurationPrivateLinkScope, or the result of cls(response) + :rtype: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.KubernetesConfigurationPrivateLinkScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KubernetesConfigurationPrivateLinkScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(private_link_scope_tags, 'TagsResource') + + request = build_update_tags_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + scope_name=scope_name, + content_type=content_type, + json=_json, + template_url=self.update_tags.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('KubernetesConfigurationPrivateLinkScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}'} # type: ignore + diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/models/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/models/__init__.py new file mode 100644 index 00000000000..cd8d39b0cea --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/models/__init__.py @@ -0,0 +1,87 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._models_py3 import ErrorAdditionalInfo +from ._models_py3 import ErrorDetail +from ._models_py3 import ErrorResponse +from ._models_py3 import Extension +from ._models_py3 import ExtensionPropertiesAksAssignedIdentity +from ._models_py3 import ExtensionStatus +from ._models_py3 import ExtensionsList +from ._models_py3 import Identity +from ._models_py3 import KubernetesConfigurationPrivateLinkScope +from ._models_py3 import KubernetesConfigurationPrivateLinkScopeListResult +from ._models_py3 import KubernetesConfigurationPrivateLinkScopeProperties +from ._models_py3 import OperationStatusResult +from ._models_py3 import PatchExtension +from ._models_py3 import Plan +from ._models_py3 import PrivateEndpoint +from ._models_py3 import PrivateEndpointConnection +from ._models_py3 import PrivateEndpointConnectionListResult +from ._models_py3 import PrivateLinkResource +from ._models_py3 import PrivateLinkResourceListResult +from ._models_py3 import PrivateLinkServiceConnectionState +from ._models_py3 import ProxyResource +from ._models_py3 import Resource +from ._models_py3 import ResourceAutoGenerated +from ._models_py3 import Scope +from ._models_py3 import ScopeCluster +from ._models_py3 import ScopeNamespace +from ._models_py3 import SystemData +from ._models_py3 import TagsResource +from ._models_py3 import TrackedResource + + +from ._source_control_configuration_client_enums import ( + AKSIdentityType, + CreatedByType, + LevelType, + PrivateEndpointConnectionProvisioningState, + PrivateEndpointServiceConnectionStatus, + ProvisioningState, + PublicNetworkAccessType, +) + +__all__ = [ + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', + 'Extension', + 'ExtensionPropertiesAksAssignedIdentity', + 'ExtensionStatus', + 'ExtensionsList', + 'Identity', + 'KubernetesConfigurationPrivateLinkScope', + 'KubernetesConfigurationPrivateLinkScopeListResult', + 'KubernetesConfigurationPrivateLinkScopeProperties', + 'OperationStatusResult', + 'PatchExtension', + 'Plan', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionListResult', + 'PrivateLinkResource', + 'PrivateLinkResourceListResult', + 'PrivateLinkServiceConnectionState', + 'ProxyResource', + 'Resource', + 'ResourceAutoGenerated', + 'Scope', + 'ScopeCluster', + 'ScopeNamespace', + 'SystemData', + 'TagsResource', + 'TrackedResource', + 'AKSIdentityType', + 'CreatedByType', + 'LevelType', + 'PrivateEndpointConnectionProvisioningState', + 'PrivateEndpointServiceConnectionStatus', + 'ProvisioningState', + 'PublicNetworkAccessType', +] diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/models/_models_py3.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/models/_models_py3.py new file mode 100644 index 00000000000..8c14404b9d6 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/models/_models_py3.py @@ -0,0 +1,1437 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._source_control_configuration_client_enums import * + + +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(msrest.serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(msrest.serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). + + :ivar error: The error object. + :vartype error: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + *, + error: Optional["ErrorDetail"] = None, + **kwargs + ): + """ + :keyword error: The error object. + :paramtype error: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.ErrorDetail + """ + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ProxyResource, self).__init__(**kwargs) + + +class Extension(ProxyResource): + """The Extension object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar identity: Identity of the Extension resource. + :vartype identity: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.Identity + :ivar system_data: Top level metadata + https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.SystemData + :ivar plan: The plan information. + :vartype plan: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.Plan + :ivar extension_type: Type of the Extension, of which this resource is an instance of. It must + be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the + Extension publisher. + :vartype extension_type: str + :ivar auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade + of minor version, or not. + :vartype auto_upgrade_minor_version: bool + :ivar release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. Stable, + Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :vartype release_train: str + :ivar version: User-specified version of the extension for this extension to 'pin'. To use + 'version', autoUpgradeMinorVersion must be 'false'. + :vartype version: str + :ivar scope: Scope at which the extension is installed. + :vartype scope: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.Scope + :ivar configuration_settings: Configuration settings, as name-value pairs for configuring this + extension. + :vartype configuration_settings: dict[str, str] + :ivar configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :vartype configuration_protected_settings: dict[str, str] + :ivar installed_version: Installed version of the extension. + :vartype installed_version: str + :ivar provisioning_state: Status of installation of this extension. Possible values include: + "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.ProvisioningState + :ivar statuses: Status from this extension. + :vartype statuses: + list[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.ExtensionStatus] + :ivar error_info: Error information from the Agent - e.g. errors during installation. + :vartype error_info: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.ErrorDetail + :ivar custom_location_settings: Custom Location settings properties. + :vartype custom_location_settings: dict[str, str] + :ivar package_uri: Uri of the Helm package. + :vartype package_uri: str + :ivar aks_assigned_identity: Identity of the Extension resource in an AKS cluster. + :vartype aks_assigned_identity: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.ExtensionPropertiesAksAssignedIdentity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'installed_version': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'error_info': {'readonly': True}, + 'custom_location_settings': {'readonly': True}, + 'package_uri': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'extension_type': {'key': 'properties.extensionType', 'type': 'str'}, + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'release_train': {'key': 'properties.releaseTrain', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'Scope'}, + 'configuration_settings': {'key': 'properties.configurationSettings', 'type': '{str}'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, + 'installed_version': {'key': 'properties.installedVersion', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'statuses': {'key': 'properties.statuses', 'type': '[ExtensionStatus]'}, + 'error_info': {'key': 'properties.errorInfo', 'type': 'ErrorDetail'}, + 'custom_location_settings': {'key': 'properties.customLocationSettings', 'type': '{str}'}, + 'package_uri': {'key': 'properties.packageUri', 'type': 'str'}, + 'aks_assigned_identity': {'key': 'properties.aksAssignedIdentity', 'type': 'ExtensionPropertiesAksAssignedIdentity'}, + } + + def __init__( + self, + *, + identity: Optional["Identity"] = None, + plan: Optional["Plan"] = None, + extension_type: Optional[str] = None, + auto_upgrade_minor_version: Optional[bool] = True, + release_train: Optional[str] = "Stable", + version: Optional[str] = None, + scope: Optional["Scope"] = None, + configuration_settings: Optional[Dict[str, str]] = None, + configuration_protected_settings: Optional[Dict[str, str]] = None, + statuses: Optional[List["ExtensionStatus"]] = None, + aks_assigned_identity: Optional["ExtensionPropertiesAksAssignedIdentity"] = None, + **kwargs + ): + """ + :keyword identity: Identity of the Extension resource. + :paramtype identity: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.Identity + :keyword plan: The plan information. + :paramtype plan: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.Plan + :keyword extension_type: Type of the Extension, of which this resource is an instance of. It + must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the + Extension publisher. + :paramtype extension_type: str + :keyword auto_upgrade_minor_version: Flag to note if this extension participates in auto + upgrade of minor version, or not. + :paramtype auto_upgrade_minor_version: bool + :keyword release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. + Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :paramtype release_train: str + :keyword version: User-specified version of the extension for this extension to 'pin'. To use + 'version', autoUpgradeMinorVersion must be 'false'. + :paramtype version: str + :keyword scope: Scope at which the extension is installed. + :paramtype scope: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.Scope + :keyword configuration_settings: Configuration settings, as name-value pairs for configuring + this extension. + :paramtype configuration_settings: dict[str, str] + :keyword configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :paramtype configuration_protected_settings: dict[str, str] + :keyword statuses: Status from this extension. + :paramtype statuses: + list[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.ExtensionStatus] + :keyword aks_assigned_identity: Identity of the Extension resource in an AKS cluster. + :paramtype aks_assigned_identity: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.ExtensionPropertiesAksAssignedIdentity + """ + super(Extension, self).__init__(**kwargs) + self.identity = identity + self.system_data = None + self.plan = plan + self.extension_type = extension_type + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.release_train = release_train + self.version = version + self.scope = scope + self.configuration_settings = configuration_settings + self.configuration_protected_settings = configuration_protected_settings + self.installed_version = None + self.provisioning_state = None + self.statuses = statuses + self.error_info = None + self.custom_location_settings = None + self.package_uri = None + self.aks_assigned_identity = aks_assigned_identity + + +class ExtensionPropertiesAksAssignedIdentity(msrest.serialization.Model): + """Identity of the Extension resource in an AKS cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: The identity type. Possible values include: "SystemAssigned", "UserAssigned". + :vartype type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.AKSIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "AKSIdentityType"]] = None, + **kwargs + ): + """ + :keyword type: The identity type. Possible values include: "SystemAssigned", "UserAssigned". + :paramtype type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.AKSIdentityType + """ + super(ExtensionPropertiesAksAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + +class ExtensionsList(msrest.serialization.Model): + """Result of the request to list Extensions. It contains a list of Extension objects and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Extensions within a Kubernetes cluster. + :vartype value: list[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.Extension] + :ivar next_link: URL to get the next set of extension objects, if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Extension]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ExtensionsList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ExtensionStatus(msrest.serialization.Model): + """Status from the extension. + + :ivar code: Status code provided by the Extension. + :vartype code: str + :ivar display_status: Short description of status of the extension. + :vartype display_status: str + :ivar level: Level of the status. Possible values include: "Error", "Warning", "Information". + Default value: "Information". + :vartype level: str or ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.LevelType + :ivar message: Detailed message of the status from the Extension. + :vartype message: str + :ivar time: DateLiteral (per ISO8601) noting the time of installation status. + :vartype time: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'display_status': {'key': 'displayStatus', 'type': 'str'}, + 'level': {'key': 'level', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + display_status: Optional[str] = None, + level: Optional[Union[str, "LevelType"]] = "Information", + message: Optional[str] = None, + time: Optional[str] = None, + **kwargs + ): + """ + :keyword code: Status code provided by the Extension. + :paramtype code: str + :keyword display_status: Short description of status of the extension. + :paramtype display_status: str + :keyword level: Level of the status. Possible values include: "Error", "Warning", + "Information". Default value: "Information". + :paramtype level: str or + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.LevelType + :keyword message: Detailed message of the status from the Extension. + :paramtype message: str + :keyword time: DateLiteral (per ISO8601) noting the time of installation status. + :paramtype time: str + """ + super(ExtensionStatus, self).__init__(**kwargs) + self.code = code + self.display_status = display_status + self.level = level + self.message = message + self.time = time + + +class Identity(msrest.serialization.Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: The identity type. The only acceptable values to pass in are None and + "SystemAssigned". The default value is None. + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + **kwargs + ): + """ + :keyword type: The identity type. The only acceptable values to pass in are None and + "SystemAssigned". The default value is None. + :paramtype type: str + """ + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + +class ResourceAutoGenerated(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ResourceAutoGenerated, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + + +class TrackedResource(ResourceAutoGenerated): + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + """ + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class KubernetesConfigurationPrivateLinkScope(TrackedResource): + """An Azure Arc PrivateLinkScope definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar properties: Properties that define a Azure Arc PrivateLinkScope resource. + :vartype properties: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.KubernetesConfigurationPrivateLinkScopeProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'KubernetesConfigurationPrivateLinkScopeProperties'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["KubernetesConfigurationPrivateLinkScopeProperties"] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword properties: Properties that define a Azure Arc PrivateLinkScope resource. + :paramtype properties: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.KubernetesConfigurationPrivateLinkScopeProperties + """ + super(KubernetesConfigurationPrivateLinkScope, self).__init__(tags=tags, location=location, **kwargs) + self.properties = properties + + +class KubernetesConfigurationPrivateLinkScopeListResult(msrest.serialization.Model): + """Describes the list of Azure Arc PrivateLinkScope resources. + + All required parameters must be populated in order to send to Azure. + + :ivar value: Required. List of Azure Arc PrivateLinkScope definitions. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.KubernetesConfigurationPrivateLinkScope] + :ivar next_link: The URI to get the next set of Azure Arc PrivateLinkScope definitions if too + many PrivateLinkScopes where returned in the result set. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[KubernetesConfigurationPrivateLinkScope]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["KubernetesConfigurationPrivateLinkScope"], + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword value: Required. List of Azure Arc PrivateLinkScope definitions. + :paramtype value: + list[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.KubernetesConfigurationPrivateLinkScope] + :keyword next_link: The URI to get the next set of Azure Arc PrivateLinkScope definitions if + too many PrivateLinkScopes where returned in the result set. + :paramtype next_link: str + """ + super(KubernetesConfigurationPrivateLinkScopeListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class KubernetesConfigurationPrivateLinkScopeProperties(msrest.serialization.Model): + """Properties that define a Azure Arc PrivateLinkScope resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar public_network_access: Indicates whether machines associated with the private link scope + can also use public Azure Arc service endpoints. Possible values include: "Enabled", + "Disabled". Default value: "Disabled". + :vartype public_network_access: str or + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PublicNetworkAccessType + :ivar provisioning_state: Current state of this PrivateLinkScope: whether or not is has been + provisioned within the resource group it is defined. Users cannot change this value but are + able to read from it. Values will include Provisioning ,Succeeded, Canceled and Failed. + Possible values include: "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.ProvisioningState + :ivar cluster_resource_id: Required. Managed Cluster ARM ID for the private link scope + (Required). + :vartype cluster_resource_id: str + :ivar private_link_scope_id: The Guid id of the private link scope. + :vartype private_link_scope_id: str + :ivar private_endpoint_connections: The collection of associated Private Endpoint Connections. + :vartype private_endpoint_connections: + list[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateEndpointConnection] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'cluster_resource_id': {'required': True}, + 'private_link_scope_id': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + } + + _attribute_map = { + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'cluster_resource_id': {'key': 'clusterResourceId', 'type': 'str'}, + 'private_link_scope_id': {'key': 'privateLinkScopeId', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + *, + cluster_resource_id: str, + public_network_access: Optional[Union[str, "PublicNetworkAccessType"]] = "Disabled", + **kwargs + ): + """ + :keyword public_network_access: Indicates whether machines associated with the private link + scope can also use public Azure Arc service endpoints. Possible values include: "Enabled", + "Disabled". Default value: "Disabled". + :paramtype public_network_access: str or + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PublicNetworkAccessType + :keyword cluster_resource_id: Required. Managed Cluster ARM ID for the private link scope + (Required). + :paramtype cluster_resource_id: str + """ + super(KubernetesConfigurationPrivateLinkScopeProperties, self).__init__(**kwargs) + self.public_network_access = public_network_access + self.provisioning_state = None + self.cluster_resource_id = cluster_resource_id + self.private_link_scope_id = None + self.private_endpoint_connections = None + + +class OperationStatusResult(msrest.serialization.Model): + """The current status of an async operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Required. Operation status. + :vartype status: str + :ivar properties: Additional information, if available. + :vartype properties: dict[str, str] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.ErrorDetail + """ + + _validation = { + 'status': {'required': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + *, + status: str, + id: Optional[str] = None, + name: Optional[str] = None, + properties: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword id: Fully qualified ID for the async operation. + :paramtype id: str + :keyword name: Name of the async operation. + :paramtype name: str + :keyword status: Required. Operation status. + :paramtype status: str + :keyword properties: Additional information, if available. + :paramtype properties: dict[str, str] + """ + super(OperationStatusResult, self).__init__(**kwargs) + self.id = id + self.name = name + self.status = status + self.properties = properties + self.error = None + + +class PatchExtension(msrest.serialization.Model): + """The Extension Patch Request object. + + :ivar auto_upgrade_minor_version: Flag to note if this extension participates in auto upgrade + of minor version, or not. + :vartype auto_upgrade_minor_version: bool + :ivar release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. Stable, + Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :vartype release_train: str + :ivar version: Version of the extension for this extension, if it is 'pinned' to a specific + version. autoUpgradeMinorVersion must be 'false'. + :vartype version: str + :ivar configuration_settings: Configuration settings, as name-value pairs for configuring this + extension. + :vartype configuration_settings: dict[str, str] + :ivar configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :vartype configuration_protected_settings: dict[str, str] + """ + + _attribute_map = { + 'auto_upgrade_minor_version': {'key': 'properties.autoUpgradeMinorVersion', 'type': 'bool'}, + 'release_train': {'key': 'properties.releaseTrain', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'configuration_settings': {'key': 'properties.configurationSettings', 'type': '{str}'}, + 'configuration_protected_settings': {'key': 'properties.configurationProtectedSettings', 'type': '{str}'}, + } + + def __init__( + self, + *, + auto_upgrade_minor_version: Optional[bool] = True, + release_train: Optional[str] = "Stable", + version: Optional[str] = None, + configuration_settings: Optional[Dict[str, str]] = None, + configuration_protected_settings: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword auto_upgrade_minor_version: Flag to note if this extension participates in auto + upgrade of minor version, or not. + :paramtype auto_upgrade_minor_version: bool + :keyword release_train: ReleaseTrain this extension participates in for auto-upgrade (e.g. + Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + :paramtype release_train: str + :keyword version: Version of the extension for this extension, if it is 'pinned' to a specific + version. autoUpgradeMinorVersion must be 'false'. + :paramtype version: str + :keyword configuration_settings: Configuration settings, as name-value pairs for configuring + this extension. + :paramtype configuration_settings: dict[str, str] + :keyword configuration_protected_settings: Configuration settings that are sensitive, as + name-value pairs for configuring this extension. + :paramtype configuration_protected_settings: dict[str, str] + """ + super(PatchExtension, self).__init__(**kwargs) + self.auto_upgrade_minor_version = auto_upgrade_minor_version + self.release_train = release_train + self.version = version + self.configuration_settings = configuration_settings + self.configuration_protected_settings = configuration_protected_settings + + +class Plan(msrest.serialization.Model): + """Plan for the resource. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Required. A user defined name of the 3rd Party Artifact that is being procured. + :vartype name: str + :ivar publisher: Required. The publisher of the 3rd Party Artifact that is being bought. E.g. + NewRelic. + :vartype publisher: str + :ivar product: Required. The 3rd Party artifact that is being procured. E.g. NewRelic. Product + maps to the OfferID specified for the artifact at the time of Data Market onboarding. + :vartype product: str + :ivar promotion_code: A publisher provided promotion code as provisioned in Data Market for the + said product/artifact. + :vartype promotion_code: str + :ivar version: The version of the desired product/artifact. + :vartype version: str + """ + + _validation = { + 'name': {'required': True}, + 'publisher': {'required': True}, + 'product': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + publisher: str, + product: str, + promotion_code: Optional[str] = None, + version: Optional[str] = None, + **kwargs + ): + """ + :keyword name: Required. A user defined name of the 3rd Party Artifact that is being procured. + :paramtype name: str + :keyword publisher: Required. The publisher of the 3rd Party Artifact that is being bought. + E.g. NewRelic. + :paramtype publisher: str + :keyword product: Required. The 3rd Party artifact that is being procured. E.g. NewRelic. + Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. + :paramtype product: str + :keyword promotion_code: A publisher provided promotion code as provisioned in Data Market for + the said product/artifact. + :paramtype promotion_code: str + :keyword version: The version of the desired product/artifact. + :paramtype version: str + """ + super(Plan, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + self.promotion_code = promotion_code + self.version = version + + +class PrivateEndpoint(msrest.serialization.Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ARM identifier for Private Endpoint. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(ResourceAutoGenerated): + """The Private Endpoint Connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.SystemData + :ivar private_endpoint: The resource of private end point. + :vartype private_endpoint: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateEndpoint + :ivar private_link_service_connection_state: A collection of information about the state of the + connection between service consumer and provider. + :vartype private_link_service_connection_state: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state of the private endpoint connection resource. + Possible values include: "Succeeded", "Creating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + private_endpoint: Optional["PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + **kwargs + ): + """ + :keyword private_endpoint: The resource of private end point. + :paramtype private_endpoint: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateEndpoint + :keyword private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :paramtype private_link_service_connection_state: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateLinkServiceConnectionState + """ + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = None + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """List of private endpoint connection associated with the specified storage account. + + :ivar value: Array of private endpoint connections. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateEndpointConnection] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateEndpointConnection"]] = None, + **kwargs + ): + """ + :keyword value: Array of private endpoint connections. + :paramtype value: + list[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateEndpointConnection] + """ + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkResource(ResourceAutoGenerated): + """A private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.SystemData + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :ivar required_zone_names: The private link resource Private link DNS zone name. + :vartype required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + required_zone_names: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword required_zone_names: The private link resource Private link DNS zone name. + :paramtype required_zone_names: list[str] + """ + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = required_zone_names + + +class PrivateLinkResourceListResult(msrest.serialization.Model): + """A list of private link resources. + + :ivar value: Array of private link resources. + :vartype value: + list[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateLinkResource"]] = None, + **kwargs + ): + """ + :keyword value: Array of private link resources. + :paramtype value: + list[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateLinkResource] + """ + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """A collection of information about the state of the connection between service consumer and provider. + + :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected". + :vartype status: str or + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateEndpointServiceConnectionStatus + :ivar description: The reason for approval/rejection of the connection. + :vartype description: str + :ivar actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :vartype actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + description: Optional[str] = None, + actions_required: Optional[str] = None, + **kwargs + ): + """ + :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the + owner of the service. Possible values include: "Pending", "Approved", "Rejected". + :paramtype status: str or + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateEndpointServiceConnectionStatus + :keyword description: The reason for approval/rejection of the connection. + :paramtype description: str + :keyword actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :paramtype actions_required: str + """ + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + +class Scope(msrest.serialization.Model): + """Scope of the extension. It can be either Cluster or Namespace; but not both. + + :ivar cluster: Specifies that the scope of the extension is Cluster. + :vartype cluster: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.ScopeCluster + :ivar namespace: Specifies that the scope of the extension is Namespace. + :vartype namespace: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.ScopeNamespace + """ + + _attribute_map = { + 'cluster': {'key': 'cluster', 'type': 'ScopeCluster'}, + 'namespace': {'key': 'namespace', 'type': 'ScopeNamespace'}, + } + + def __init__( + self, + *, + cluster: Optional["ScopeCluster"] = None, + namespace: Optional["ScopeNamespace"] = None, + **kwargs + ): + """ + :keyword cluster: Specifies that the scope of the extension is Cluster. + :paramtype cluster: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.ScopeCluster + :keyword namespace: Specifies that the scope of the extension is Namespace. + :paramtype namespace: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.ScopeNamespace + """ + super(Scope, self).__init__(**kwargs) + self.cluster = cluster + self.namespace = namespace + + +class ScopeCluster(msrest.serialization.Model): + """Specifies that the scope of the extension is Cluster. + + :ivar release_namespace: Namespace where the extension Release must be placed, for a Cluster + scoped extension. If this namespace does not exist, it will be created. + :vartype release_namespace: str + """ + + _attribute_map = { + 'release_namespace': {'key': 'releaseNamespace', 'type': 'str'}, + } + + def __init__( + self, + *, + release_namespace: Optional[str] = None, + **kwargs + ): + """ + :keyword release_namespace: Namespace where the extension Release must be placed, for a Cluster + scoped extension. If this namespace does not exist, it will be created. + :paramtype release_namespace: str + """ + super(ScopeCluster, self).__init__(**kwargs) + self.release_namespace = release_namespace + + +class ScopeNamespace(msrest.serialization.Model): + """Specifies that the scope of the extension is Namespace. + + :ivar target_namespace: Namespace where the extension will be created for an Namespace scoped + extension. If this namespace does not exist, it will be created. + :vartype target_namespace: str + """ + + _attribute_map = { + 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, + } + + def __init__( + self, + *, + target_namespace: Optional[str] = None, + **kwargs + ): + """ + :keyword target_namespace: Namespace where the extension will be created for an Namespace + scoped extension. If this namespace does not exist, it will be created. + :paramtype target_namespace: str + """ + super(ScopeNamespace, self).__init__(**kwargs) + self.target_namespace = target_namespace + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :vartype last_modified_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :paramtype created_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :paramtype last_modified_by_type: str or + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.CreatedByType + :keyword last_modified_at: The timestamp of resource last modification (UTC). + :paramtype last_modified_at: ~datetime.datetime + """ + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TagsResource(msrest.serialization.Model): + """A container holding only the Tags for a resource, allowing the user to update the tags on a PrivateLinkScope instance. + + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ + super(TagsResource, self).__init__(**kwargs) + self.tags = tags diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/models/_source_control_configuration_client_enums.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/models/_source_control_configuration_client_enums.py new file mode 100644 index 00000000000..ebc75ee35b8 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/models/_source_control_configuration_client_enums.py @@ -0,0 +1,76 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum +from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta + + +class AKSIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The identity type. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + +class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class LevelType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Level of the status. + """ + + ERROR = "Error" + WARNING = "Warning" + INFORMATION = "Information" + +class PrivateEndpointConnectionProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The current provisioning state. + """ + + SUCCEEDED = "Succeeded" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + +class PrivateEndpointServiceConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The private endpoint connection status. + """ + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + +class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The provisioning state of the resource. + """ + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + CREATING = "Creating" + UPDATING = "Updating" + DELETING = "Deleting" + +class PublicNetworkAccessType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The network access policy to determine if Azure Arc agents can use public Azure Arc service + endpoints. Defaults to disabled (access to Azure Arc services only via private link). + """ + + #: Allows Azure Arc agents to communicate with Azure Arc services over both public (internet) and + #: private endpoints. + ENABLED = "Enabled" + #: Does not allow Azure Arc agents to communicate with Azure Arc services over public (internet) + #: endpoints. The agents must use the private link. + DISABLED = "Disabled" diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/__init__.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/__init__.py new file mode 100644 index 00000000000..2dbecc9b3cd --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/__init__.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._extensions_operations import ExtensionsOperations +from ._operation_status_operations import OperationStatusOperations +from ._private_link_scopes_operations import PrivateLinkScopesOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations + +__all__ = [ + 'ExtensionsOperations', + 'OperationStatusOperations', + 'PrivateLinkScopesOperations', + 'PrivateLinkResourcesOperations', + 'PrivateEndpointConnectionsOperations', +] diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/_extensions_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/_extensions_operations.py new file mode 100644 index 00000000000..bfa891e2a90 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/_extensions_operations.py @@ -0,0 +1,830 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_create_request_initial( + subscription_id: str, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-04-02-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "extensionName": _SERIALIZER.url("extension_name", extension_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-04-02-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "extensionName": _SERIALIZER.url("extension_name", extension_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + *, + force_delete: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-04-02-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "extensionName": _SERIALIZER.url("extension_name", extension_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if force_delete is not None: + query_parameters['forceDelete'] = _SERIALIZER.query("force_delete", force_delete, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request_initial( + subscription_id: str, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-04-02-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "extensionName": _SERIALIZER.url("extension_name", extension_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-04-02-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class ExtensionsOperations(object): + """ExtensionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_initial( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + extension: "_models.Extension", + **kwargs: Any + ) -> "_models.Extension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(extension, 'Extension') + + request = build_create_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Extension', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Extension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + extension: "_models.Extension", + **kwargs: Any + ) -> LROPoller["_models.Extension"]: + """Create a new Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param extension_name: Name of the Extension. + :type extension_name: str + :param extension: Properties necessary to Create an Extension. + :type extension: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.Extension + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either Extension or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.Extension] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + extension=extension, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('Extension', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + **kwargs: Any + ) -> "_models.Extension": + """Gets Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param extension_name: Name of the Extension. + :type extension_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Extension, or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.Extension + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Extension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + + def _delete_initial( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + force_delete=force_delete, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension + from the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param extension_name: Name of the Extension. + :type extension_name: str + :param force_delete: Delete the extension resource in Azure - not the normal asynchronous + delete. + :type force_delete: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + force_delete=force_delete, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + def _update_initial( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + patch_extension: "_models.PatchExtension", + **kwargs: Any + ) -> "_models.Extension": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(patch_extension, 'PatchExtension') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Extension', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + patch_extension: "_models.PatchExtension", + **kwargs: Any + ) -> LROPoller["_models.Extension"]: + """Patch an existing Kubernetes Cluster Extension. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param extension_name: Name of the Extension. + :type extension_name: str + :param patch_extension: Properties to Patch in an existing Extension. + :type patch_extension: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PatchExtension + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either Extension or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.Extension] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Extension"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + patch_extension=patch_extension, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('Extension', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}'} # type: ignore + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + **kwargs: Any + ) -> Iterable["_models.ExtensionsList"]: + """List all Extensions in the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ExtensionsList or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.ExtensionsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ExtensionsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ExtensionsList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions'} # type: ignore diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/_operation_status_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/_operation_status_operations.py new file mode 100644 index 00000000000..911e3583611 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/_operation_status_operations.py @@ -0,0 +1,160 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + subscription_id: str, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + operation_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-04-02-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "clusterRp": _SERIALIZER.url("cluster_rp", cluster_rp, 'str'), + "clusterResourceName": _SERIALIZER.url("cluster_resource_name", cluster_resource_name, 'str'), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), + "extensionName": _SERIALIZER.url("extension_name", extension_name, 'str'), + "operationId": _SERIALIZER.url("operation_id", operation_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class OperationStatusOperations(object): + """OperationStatusOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_rp: str, + cluster_resource_name: str, + cluster_name: str, + extension_name: str, + operation_id: str, + **kwargs: Any + ) -> "_models.OperationStatusResult": + """Get Async Operation status. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - i.e. Microsoft.ContainerService, + Microsoft.Kubernetes, Microsoft.HybridContainerService. + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - i.e. managedClusters, + connectedClusters, provisionedClusters. + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param extension_name: Name of the Extension. + :type extension_name: str + :param operation_id: operation Id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatusResult, or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.OperationStatusResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatusResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + extension_name=extension_name, + operation_id=operation_id, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OperationStatusResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}'} # type: ignore + diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/_private_endpoint_connections_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/_private_endpoint_connections_operations.py new file mode 100644 index 00000000000..cf6cd974df3 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,546 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + subscription_id: str, + resource_group_name: str, + scope_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-04-02-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "scopeName": _SERIALIZER.url("scope_name", scope_name, 'str'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + scope_name: str, + private_endpoint_connection_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-04-02-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "scopeName": _SERIALIZER.url("scope_name", scope_name, 'str'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id: str, + resource_group_name: str, + scope_name: str, + private_endpoint_connection_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-04-02-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "scopeName": _SERIALIZER.url("scope_name", scope_name, 'str'), + "privateEndpointConnectionName": _SERIALIZER.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_private_link_scope_request( + subscription_id: str, + resource_group_name: str, + scope_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-04-02-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "scopeName": _SERIALIZER.url("scope_name", scope_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def get( + self, + resource_group_name: str, + scope_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + """Gets a private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + scope_name=scope_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + + def _create_or_update_initial( + self, + resource_group_name: str, + scope_name: str, + private_endpoint_connection_name: str, + properties: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> Optional["_models.PrivateEndpointConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PrivateEndpointConnection"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(properties, 'PrivateEndpointConnection') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + scope_name=scope_name, + private_endpoint_connection_name=private_endpoint_connection_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + scope_name: str, + private_endpoint_connection_name: str, + properties: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> LROPoller["_models.PrivateEndpointConnection"]: + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. + :type properties: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateEndpointConnection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + scope_name=scope_name, + private_endpoint_connection_name=private_endpoint_connection_name, + properties=properties, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name: str, + scope_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + scope_name=scope_name, + private_endpoint_connection_name=private_endpoint_connection_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + scope_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + scope_name=scope_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + @distributed_trace + def list_by_private_link_scope( + self, + resource_group_name: str, + scope_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnectionListResult": + """Gets all private endpoint connections on a private link scope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionListResult, or the result of cls(response) + :rtype: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateEndpointConnectionListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_list_by_private_link_scope_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + scope_name=scope_name, + template_url=self.list_by_private_link_scope.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_by_private_link_scope.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateEndpointConnections'} # type: ignore + diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/_private_link_resources_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/_private_link_resources_operations.py new file mode 100644 index 00000000000..02341728e5a --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/_private_link_resources_operations.py @@ -0,0 +1,228 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_private_link_scope_request( + subscription_id: str, + resource_group_name: str, + scope_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-04-02-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateLinkResources') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "scopeName": _SERIALIZER.url("scope_name", scope_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + scope_name: str, + group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-04-02-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "scopeName": _SERIALIZER.url("scope_name", scope_name, 'str'), + "groupName": _SERIALIZER.url("group_name", group_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_by_private_link_scope( + self, + resource_group_name: str, + scope_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourceListResult": + """Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourceListResult, or the result of cls(response) + :rtype: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateLinkResourceListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_list_by_private_link_scope_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + scope_name=scope_name, + template_url=self.list_by_private_link_scope.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_by_private_link_scope.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateLinkResources'} # type: ignore + + + @distributed_trace + def get( + self, + resource_group_name: str, + scope_name: str, + group_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResource": + """Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param group_name: The name of the private link resource. + :type group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResource, or the result of cls(response) + :rtype: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.PrivateLinkResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + scope_name=scope_name, + group_name=group_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}'} # type: ignore + diff --git a/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/_private_link_scopes_operations.py b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/_private_link_scopes_operations.py new file mode 100644 index 00000000000..16572bcc9a9 --- /dev/null +++ b/src/k8s-extension/azext_k8s_extension/vendored_sdks/v2022_04_02_preview/operations/_private_link_scopes_operations.py @@ -0,0 +1,691 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-04-02-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + resource_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-04-02-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_delete_request_initial( + resource_group_name: str, + subscription_id: str, + scope_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-04-02-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "scopeName": _SERIALIZER.url("scope_name", scope_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_group_name: str, + subscription_id: str, + scope_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-04-02-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "scopeName": _SERIALIZER.url("scope_name", scope_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + resource_group_name: str, + subscription_id: str, + scope_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-04-02-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "scopeName": _SERIALIZER.url("scope_name", scope_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_tags_request( + resource_group_name: str, + subscription_id: str, + scope_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-04-02-preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "scopeName": _SERIALIZER.url("scope_name", scope_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + +class PrivateLinkScopesOperations(object): + """PrivateLinkScopesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + **kwargs: Any + ) -> Iterable["_models.KubernetesConfigurationPrivateLinkScopeListResult"]: + """Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either KubernetesConfigurationPrivateLinkScopeListResult + or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.KubernetesConfigurationPrivateLinkScopeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KubernetesConfigurationPrivateLinkScopeListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("KubernetesConfigurationPrivateLinkScopeListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes'} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.KubernetesConfigurationPrivateLinkScopeListResult"]: + """Gets a list of Azure Arc PrivateLinkScopes within a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either KubernetesConfigurationPrivateLinkScopeListResult + or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.KubernetesConfigurationPrivateLinkScopeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KubernetesConfigurationPrivateLinkScopeListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("KubernetesConfigurationPrivateLinkScopeListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes'} # type: ignore + + def _delete_initial( + self, + resource_group_name: str, + scope_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + scope_name=scope_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}'} # type: ignore + + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + scope_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes a Azure Arc PrivateLinkScope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + scope_name=scope_name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}'} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + scope_name: str, + **kwargs: Any + ) -> "_models.KubernetesConfigurationPrivateLinkScope": + """Returns a Azure Arc PrivateLinkScope. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KubernetesConfigurationPrivateLinkScope, or the result of cls(response) + :rtype: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.KubernetesConfigurationPrivateLinkScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KubernetesConfigurationPrivateLinkScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + scope_name=scope_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('KubernetesConfigurationPrivateLinkScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}'} # type: ignore + + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + scope_name: str, + parameters: "_models.KubernetesConfigurationPrivateLinkScope", + **kwargs: Any + ) -> "_models.KubernetesConfigurationPrivateLinkScope": + """Creates (or updates) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value + for InstrumentationKey nor AppId in the Put operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param parameters: Properties that need to be specified to create or update a Azure Arc for + Servers and Clusters PrivateLinkScope. + :type parameters: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.KubernetesConfigurationPrivateLinkScope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KubernetesConfigurationPrivateLinkScope, or the result of cls(response) + :rtype: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.KubernetesConfigurationPrivateLinkScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KubernetesConfigurationPrivateLinkScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'KubernetesConfigurationPrivateLinkScope') + + request = build_create_or_update_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + scope_name=scope_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KubernetesConfigurationPrivateLinkScope', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KubernetesConfigurationPrivateLinkScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}'} # type: ignore + + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + scope_name: str, + private_link_scope_tags: "_models.TagsResource", + **kwargs: Any + ) -> "_models.KubernetesConfigurationPrivateLinkScope": + """Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate + method. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param scope_name: The name of the Azure Arc PrivateLinkScope resource. + :type scope_name: str + :param private_link_scope_tags: Updated tag information to set into the PrivateLinkScope + instance. + :type private_link_scope_tags: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.TagsResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KubernetesConfigurationPrivateLinkScope, or the result of cls(response) + :rtype: + ~azure.mgmt.kubernetesconfiguration.v2022_04_02_preview.models.KubernetesConfigurationPrivateLinkScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KubernetesConfigurationPrivateLinkScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(private_link_scope_tags, 'TagsResource') + + request = build_update_tags_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + scope_name=scope_name, + content_type=content_type, + json=_json, + template_url=self.update_tags.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('KubernetesConfigurationPrivateLinkScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KubernetesConfiguration/privateLinkScopes/{scopeName}'} # type: ignore + From 0744894fa5dac15c3d787d633906c11c1a00ee71 Mon Sep 17 00:00:00 2001 From: Deeksha Sharma Date: Tue, 21 Jun 2022 21:22:30 -0700 Subject: [PATCH 08/20] updating api version --- src/k8s-extension/azext_k8s_extension/_client_factory.py | 8 ++++---- src/k8s-extension/azext_k8s_extension/custom.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/k8s-extension/azext_k8s_extension/_client_factory.py b/src/k8s-extension/azext_k8s_extension/_client_factory.py index fb592a2bc23..338fa8eaa72 100644 --- a/src/k8s-extension/azext_k8s_extension/_client_factory.py +++ b/src/k8s-extension/azext_k8s_extension/_client_factory.py @@ -17,19 +17,19 @@ def cf_k8s_extension_operation(cli_ctx, _): def cf_k8s_cluster_extension_types_operation(cli_ctx, _): - return cf_k8s_extension(cli_ctx, api_version='2021-05-01-preview').cluster_extension_types + return cf_k8s_extension(cli_ctx, api_version='2022-01-15-preview').cluster_extension_types def cf_k8s_cluster_extension_type_operation(cli_ctx, _): - return cf_k8s_extension(cli_ctx, api_version='2021-05-01-preview').cluster_extension_type + return cf_k8s_extension(cli_ctx, api_version='2022-01-15-preview').cluster_extension_type def cf_k8s_location_extension_types_operation(cli_ctx, _): - return cf_k8s_extension(cli_ctx, api_version='2021-05-01-preview').location_extension_types + return cf_k8s_extension(cli_ctx, api_version='2022-01-15-preview').location_extension_types def cf_k8s_extension_type_versions_operation(cli_ctx, _): - return cf_k8s_extension(cli_ctx, api_version='2021-05-01-preview').extension_type_versions + return cf_k8s_extension(cli_ctx, api_version='2022-01-15-preview').extension_type_versions def cf_resource_groups(cli_ctx, subscription_id=None): diff --git a/src/k8s-extension/azext_k8s_extension/custom.py b/src/k8s-extension/azext_k8s_extension/custom.py index daa2f6ed6e9..ba27c8cbcae 100644 --- a/src/k8s-extension/azext_k8s_extension/custom.py +++ b/src/k8s-extension/azext_k8s_extension/custom.py @@ -367,7 +367,7 @@ def list_k8s_extension_type_versions(cmd, client, location, extension_type): def list_k8s_cluster_extension_types(client, resource_group_name, cluster_name, cluster_type): """ List available extension types """ - cluster_rp = __get_cluster_rp(cluster_type) + cluster_rp, parent_api_version = get_cluster_rp_api_version(cluster_type) return client.list(resource_group_name, cluster_rp, cluster_name) @@ -381,7 +381,7 @@ def show_k8s_cluster_extension_type(client, resource_group_name, cluster_type, c """Get an existing Extension Type. """ # Determine ClusterRP - cluster_rp = __get_cluster_rp(cluster_type) + cluster_rp, parent_api_version = get_cluster_rp_api_version(cluster_type) try: extension_type = client.get(resource_group_name, From b65fc0c782cf10c3b8641c00023ef9bda345a8fb Mon Sep 17 00:00:00 2001 From: Deeksha Sharma Date: Tue, 12 Jul 2022 11:50:07 -0700 Subject: [PATCH 09/20] fixing some errors --- src/k8s-extension/azext_k8s_extension/_format.py | 4 ++-- src/k8s-extension/azext_k8s_extension/custom.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/k8s-extension/azext_k8s_extension/_format.py b/src/k8s-extension/azext_k8s_extension/_format.py index 78bf9536833..05ff231fd86 100644 --- a/src/k8s-extension/azext_k8s_extension/_format.py +++ b/src/k8s-extension/azext_k8s_extension/_format.py @@ -35,11 +35,11 @@ def k8s_extension_type_show_table_format(result): def __get_extension_type_table_row(result, showReleaseTrains): # Populate the values to be returned if they are not undefined clusterTypes = ', '.join(result['clusterTypes']) - defaultScope, name, allowMultipleInstances, defaultReleaseNamespace = '','','','' + name = result['name'] + defaultScope, allowMultipleInstances, defaultReleaseNamespace = '','','' if result['supportedScopes']: defaultScope = result['supportedScopes']['defaultScope'] if result['supportedScopes']['clusterScopeSettings']: - name = result['supportedScopes']['clusterScopeSettings']['name'] allowMultipleInstances = result['supportedScopes']['clusterScopeSettings']['allowMultipleInstances'] defaultReleaseNamespace = result['supportedScopes']['clusterScopeSettings']['defaultReleaseNamespace'] diff --git a/src/k8s-extension/azext_k8s_extension/custom.py b/src/k8s-extension/azext_k8s_extension/custom.py index ba27c8cbcae..049919a5669 100644 --- a/src/k8s-extension/azext_k8s_extension/custom.py +++ b/src/k8s-extension/azext_k8s_extension/custom.py @@ -368,7 +368,7 @@ def list_k8s_cluster_extension_types(client, resource_group_name, cluster_name, """ List available extension types """ cluster_rp, parent_api_version = get_cluster_rp_api_version(cluster_type) - return client.list(resource_group_name, cluster_rp, cluster_name) + return client.list(resource_group_name, cluster_rp, cluster_type, cluster_name) def list_k8s_location_extension_types(client, location): From 52025e66d6eaa95aba5440f19794898e0e589dd9 Mon Sep 17 00:00:00 2001 From: Deeksha Sharma Date: Mon, 25 Jul 2022 15:51:09 -0700 Subject: [PATCH 10/20] fixing formatting issues --- src/k8s-extension/azext_k8s_extension/_format.py | 6 +++--- src/k8s-extension/azext_k8s_extension/_help.py | 2 +- src/k8s-extension/azext_k8s_extension/custom.py | 9 +++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/k8s-extension/azext_k8s_extension/_format.py b/src/k8s-extension/azext_k8s_extension/_format.py index 05ff231fd86..e930771c05b 100644 --- a/src/k8s-extension/azext_k8s_extension/_format.py +++ b/src/k8s-extension/azext_k8s_extension/_format.py @@ -36,13 +36,13 @@ def __get_extension_type_table_row(result, showReleaseTrains): # Populate the values to be returned if they are not undefined clusterTypes = ', '.join(result['clusterTypes']) name = result['name'] - defaultScope, allowMultipleInstances, defaultReleaseNamespace = '','','' + defaultScope, allowMultipleInstances, defaultReleaseNamespace = '', '', '' if result['supportedScopes']: defaultScope = result['supportedScopes']['defaultScope'] if result['supportedScopes']['clusterScopeSettings']: allowMultipleInstances = result['supportedScopes']['clusterScopeSettings']['allowMultipleInstances'] defaultReleaseNamespace = result['supportedScopes']['clusterScopeSettings']['defaultReleaseNamespace'] - + retVal = OrderedDict([ ('name', name), ('defaultScope', defaultScope), @@ -53,7 +53,7 @@ def __get_extension_type_table_row(result, showReleaseTrains): if showReleaseTrains: releaseTrains = ', '.join(result['releaseTrains']) retVal['releaseTrains'] = releaseTrains - + return retVal diff --git a/src/k8s-extension/azext_k8s_extension/_help.py b/src/k8s-extension/azext_k8s_extension/_help.py index 47e8046e0c7..7405279217a 100644 --- a/src/k8s-extension/azext_k8s_extension/_help.py +++ b/src/k8s-extension/azext_k8s_extension/_help.py @@ -95,7 +95,7 @@ type: command short-summary: Show properties for a Kubernetes Extension Type. examples: - - name: Show Kubernetes Extension Type + - name: Show Kubernetes Extension Type text: |- az {consts.EXTENSION_NAME} extension-types show --resource-group my-resource-group \ --cluster-name mycluster --cluster-type connectedClusters --extension_type cassandradatacenteroperator diff --git a/src/k8s-extension/azext_k8s_extension/custom.py b/src/k8s-extension/azext_k8s_extension/custom.py index 049919a5669..2b39ef98607 100644 --- a/src/k8s-extension/azext_k8s_extension/custom.py +++ b/src/k8s-extension/azext_k8s_extension/custom.py @@ -340,7 +340,7 @@ def delete_k8s_extension( ) return None extension_class = ExtensionFactory(extension.extension_type.lower()) - + # If there is any custom delete logic, this will call the logic extension_class.Delete( cmd, client, resource_group_name, cluster_name, name, cluster_type, yes @@ -357,6 +357,7 @@ def delete_k8s_extension( force_delete=force, ) + def list_k8s_extension_type_versions(cmd, client, location, extension_type): """ List available extension type versions """ @@ -372,7 +373,7 @@ def list_k8s_cluster_extension_types(client, resource_group_name, cluster_name, def list_k8s_location_extension_types(client, location): - """ List available extension types based on location + """ List available extension types based on location """ return client.list(location) @@ -384,8 +385,8 @@ def show_k8s_cluster_extension_type(client, resource_group_name, cluster_type, c cluster_rp, parent_api_version = get_cluster_rp_api_version(cluster_type) try: - extension_type = client.get(resource_group_name, - cluster_rp, cluster_type, cluster_name, extension_type) + extension_type = client.get(resource_group_name, + cluster_rp, cluster_type, cluster_name, extension_type) return extension_type except HttpResponseError as ex: # Customize the error message for resources not found From 866da4d21a7b7cf9199a28cc1ccf65f3c3ef5d93 Mon Sep 17 00:00:00 2001 From: Deeksha Sharma Date: Mon, 25 Jul 2022 16:01:37 -0700 Subject: [PATCH 11/20] fixing some errors --- src/k8s-extension/azext_k8s_extension/_help.py | 11 ++++++++--- src/k8s-extension/azext_k8s_extension/_params.py | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/k8s-extension/azext_k8s_extension/_help.py b/src/k8s-extension/azext_k8s_extension/_help.py index 7405279217a..7b170fdaa90 100644 --- a/src/k8s-extension/azext_k8s_extension/_help.py +++ b/src/k8s-extension/azext_k8s_extension/_help.py @@ -72,6 +72,11 @@ --configuration-protected-settings-file=protected-settings-file """ +helps[f'{consts.EXTENSION_NAME} extension-types'] = """ + type: group + short-summary: Commands to discover Kubernetes Extension Types. +""" + helps[f'{consts.EXTENSION_NAME} extension-types list'] = f""" type: command short-summary: List Kubernetes Extension Types. @@ -98,15 +103,15 @@ - name: Show Kubernetes Extension Type text: |- az {consts.EXTENSION_NAME} extension-types show --resource-group my-resource-group \ ---cluster-name mycluster --cluster-type connectedClusters --extension_type cassandradatacenteroperator +--cluster-name mycluster --cluster-type connectedClusters --extension-type cassandradatacenteroperator """ -helps[f'{consts.EXTENSION_NAME} extension-types versions list'] = f""" +helps[f'{consts.EXTENSION_NAME} extension-types list-versions'] = f""" type: command short-summary: List available versions for a Kubernetes Extension Type. examples: - name: List versions for an Extension Type text: |- - az {consts.EXTENSION_NAME} extension-types versions list --location eastus2euap \ + az {consts.EXTENSION_NAME} extension-types list-versions --location eastus2euap \ --extension_type cassandradatacenteroperator """ diff --git a/src/k8s-extension/azext_k8s_extension/_params.py b/src/k8s-extension/azext_k8s_extension/_params.py index 100059d3c25..8221369661b 100644 --- a/src/k8s-extension/azext_k8s_extension/_params.py +++ b/src/k8s-extension/azext_k8s_extension/_params.py @@ -109,7 +109,7 @@ def load_arguments(self, _): options_list=['--cluster-type', '-t'], help='Specify Arc clusters or AKS managed clusters or Arc appliances.') - with self.argument_context(f"{consts.EXTENSION_NAME} extension-types versions list") as c: + with self.argument_context(f"{consts.EXTENSION_NAME} extension-types list-versions") as c: c.argument('extension_type', help='Name of the extension type.') c.argument('location', From 654355f4ec9f070371df68b99c62bd897950b77a Mon Sep 17 00:00:00 2001 From: Deeksha Sharma Date: Tue, 26 Jul 2022 11:40:05 -0700 Subject: [PATCH 12/20] fixing some errors --- src/k8s-extension/azext_k8s_extension/_help.py | 2 +- src/k8s-extension/azext_k8s_extension/custom.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/k8s-extension/azext_k8s_extension/_help.py b/src/k8s-extension/azext_k8s_extension/_help.py index 7b170fdaa90..e8c4554df58 100644 --- a/src/k8s-extension/azext_k8s_extension/_help.py +++ b/src/k8s-extension/azext_k8s_extension/_help.py @@ -113,5 +113,5 @@ - name: List versions for an Extension Type text: |- az {consts.EXTENSION_NAME} extension-types list-versions --location eastus2euap \ ---extension_type cassandradatacenteroperator +--extension-type cassandradatacenteroperator """ diff --git a/src/k8s-extension/azext_k8s_extension/custom.py b/src/k8s-extension/azext_k8s_extension/custom.py index 2b39ef98607..ab3206bc383 100644 --- a/src/k8s-extension/azext_k8s_extension/custom.py +++ b/src/k8s-extension/azext_k8s_extension/custom.py @@ -385,7 +385,7 @@ def show_k8s_cluster_extension_type(client, resource_group_name, cluster_type, c cluster_rp, parent_api_version = get_cluster_rp_api_version(cluster_type) try: - extension_type = client.get(resource_group_name, + extension_type = client.get(resource_group_name, cluster_rp, cluster_type, cluster_name, extension_type) return extension_type except HttpResponseError as ex: From ed5e3853c7c46c06fc9c28a945bc04977154fc52 Mon Sep 17 00:00:00 2001 From: Deeksha Sharma Date: Thu, 28 Jul 2022 12:14:00 -0700 Subject: [PATCH 13/20] adding api version to cf_k8s_extension --- src/k8s-extension/azext_k8s_extension/_client_factory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k8s-extension/azext_k8s_extension/_client_factory.py b/src/k8s-extension/azext_k8s_extension/_client_factory.py index 338fa8eaa72..f94bc1b2a3e 100644 --- a/src/k8s-extension/azext_k8s_extension/_client_factory.py +++ b/src/k8s-extension/azext_k8s_extension/_client_factory.py @@ -13,7 +13,7 @@ def cf_k8s_extension(cli_ctx, **kwargs): def cf_k8s_extension_operation(cli_ctx, _): - return cf_k8s_extension(cli_ctx).extensions + return cf_k8s_extension(cli_ctx, api_version='2022-01-15-preview').extensions def cf_k8s_cluster_extension_types_operation(cli_ctx, _): From 47177def6472259c6366453a637835e6dc406d34 Mon Sep 17 00:00:00 2001 From: Deeksha Sharma Date: Thu, 28 Jul 2022 12:59:23 -0700 Subject: [PATCH 14/20] updating extensionsoperations api version --- src/k8s-extension/azext_k8s_extension/_client_factory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k8s-extension/azext_k8s_extension/_client_factory.py b/src/k8s-extension/azext_k8s_extension/_client_factory.py index f94bc1b2a3e..537eb9898e9 100644 --- a/src/k8s-extension/azext_k8s_extension/_client_factory.py +++ b/src/k8s-extension/azext_k8s_extension/_client_factory.py @@ -13,7 +13,7 @@ def cf_k8s_extension(cli_ctx, **kwargs): def cf_k8s_extension_operation(cli_ctx, _): - return cf_k8s_extension(cli_ctx, api_version='2022-01-15-preview').extensions + return cf_k8s_extension(cli_ctx, api_version='2022-04-02-preview').extensions def cf_k8s_cluster_extension_types_operation(cli_ctx, _): From bc9725bccf463da6548b804bbdc3616b03eb067e Mon Sep 17 00:00:00 2001 From: Deeksha Sharma Date: Thu, 28 Jul 2022 21:45:16 -0700 Subject: [PATCH 15/20] small update --- src/k8s-extension/azext_k8s_extension/_client_factory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k8s-extension/azext_k8s_extension/_client_factory.py b/src/k8s-extension/azext_k8s_extension/_client_factory.py index 537eb9898e9..338fa8eaa72 100644 --- a/src/k8s-extension/azext_k8s_extension/_client_factory.py +++ b/src/k8s-extension/azext_k8s_extension/_client_factory.py @@ -13,7 +13,7 @@ def cf_k8s_extension(cli_ctx, **kwargs): def cf_k8s_extension_operation(cli_ctx, _): - return cf_k8s_extension(cli_ctx, api_version='2022-04-02-preview').extensions + return cf_k8s_extension(cli_ctx).extensions def cf_k8s_cluster_extension_types_operation(cli_ctx, _): From 7bdf62c46daf3c14bad4934ab2b2aa37f2513395 Mon Sep 17 00:00:00 2001 From: Deeksha Sharma Date: Fri, 29 Jul 2022 10:20:22 -0700 Subject: [PATCH 16/20] reverting bad old changes --- .../vendored_sdks/v2021_09_01/aio/operations/__init__.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/k8s-configuration/azext_k8s_configuration/vendored_sdks/v2021_09_01/aio/operations/__init__.py b/src/k8s-configuration/azext_k8s_configuration/vendored_sdks/v2021_09_01/aio/operations/__init__.py index 5f4504b206d..e4fcc4d8c45 100644 --- a/src/k8s-configuration/azext_k8s_configuration/vendored_sdks/v2021_09_01/aio/operations/__init__.py +++ b/src/k8s-configuration/azext_k8s_configuration/vendored_sdks/v2021_09_01/aio/operations/__init__.py @@ -8,11 +8,6 @@ from ._extensions_operations import ExtensionsOperations from ._operation_status_operations import OperationStatusOperations -from ._cluster_extension_type_operations import ClusterExtensionTypeOperations -from ._cluster_extension_types_operations import ClusterExtensionTypesOperations -from ._extension_type_versions_operations import ExtensionTypeVersionsOperations -from ._location_extension_types_operations import LocationExtensionTypesOperations -from ._source_control_configurations_operations import SourceControlConfigurationsOperations from ._operations import Operations __all__ = [ From 20a2f49232c483f2c06268c508e889c8cffe3db0 Mon Sep 17 00:00:00 2001 From: Deeksha Sharma Date: Tue, 2 Aug 2022 22:21:03 -0700 Subject: [PATCH 17/20] reverting old commit --- .../vendored_sdks/v2021_09_01/aio/operations/__init__.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/k8s-configuration/azext_k8s_configuration/vendored_sdks/v2021_09_01/aio/operations/__init__.py b/src/k8s-configuration/azext_k8s_configuration/vendored_sdks/v2021_09_01/aio/operations/__init__.py index e4fcc4d8c45..632ac4c1eeb 100644 --- a/src/k8s-configuration/azext_k8s_configuration/vendored_sdks/v2021_09_01/aio/operations/__init__.py +++ b/src/k8s-configuration/azext_k8s_configuration/vendored_sdks/v2021_09_01/aio/operations/__init__.py @@ -13,10 +13,5 @@ __all__ = [ 'ExtensionsOperations', 'OperationStatusOperations', - 'ClusterExtensionTypeOperations', - 'ClusterExtensionTypesOperations', - 'ExtensionTypeVersionsOperations', - 'LocationExtensionTypesOperations', - 'SourceControlConfigurationsOperations', 'Operations', ] From 29d0f273f62de7ab20dee671ee914a8752f609ce Mon Sep 17 00:00:00 2001 From: Deeksha Sharma Date: Tue, 2 Aug 2022 22:30:04 -0700 Subject: [PATCH 18/20] const --- .../azext_k8s_extension/_client_factory.py | 10 +++++----- src/k8s-extension/azext_k8s_extension/consts.py | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/k8s-extension/azext_k8s_extension/_client_factory.py b/src/k8s-extension/azext_k8s_extension/_client_factory.py index 338fa8eaa72..acda2b4fde9 100644 --- a/src/k8s-extension/azext_k8s_extension/_client_factory.py +++ b/src/k8s-extension/azext_k8s_extension/_client_factory.py @@ -5,7 +5,7 @@ from azure.cli.core.commands.client_factory import get_mgmt_service_client from azure.cli.core.profiles import ResourceType - +from . import consts def cf_k8s_extension(cli_ctx, **kwargs): from .vendored_sdks import SourceControlConfigurationClient @@ -17,19 +17,19 @@ def cf_k8s_extension_operation(cli_ctx, _): def cf_k8s_cluster_extension_types_operation(cli_ctx, _): - return cf_k8s_extension(cli_ctx, api_version='2022-01-15-preview').cluster_extension_types + return cf_k8s_extension(cli_ctx, consts.EXTENSION_TYPE_API_VERSION).cluster_extension_types def cf_k8s_cluster_extension_type_operation(cli_ctx, _): - return cf_k8s_extension(cli_ctx, api_version='2022-01-15-preview').cluster_extension_type + return cf_k8s_extension(cli_ctx, consts.EXTENSION_TYPE_API_VERSION).cluster_extension_type def cf_k8s_location_extension_types_operation(cli_ctx, _): - return cf_k8s_extension(cli_ctx, api_version='2022-01-15-preview').location_extension_types + return cf_k8s_extension(cli_ctx, consts.EXTENSION_TYPE_API_VERSION).location_extension_types def cf_k8s_extension_type_versions_operation(cli_ctx, _): - return cf_k8s_extension(cli_ctx, api_version='2022-01-15-preview').extension_type_versions + return cf_k8s_extension(cli_ctx, consts.EXTENSION_TYPE_API_VERSION).extension_type_versions def cf_resource_groups(cli_ctx, subscription_id=None): diff --git a/src/k8s-extension/azext_k8s_extension/consts.py b/src/k8s-extension/azext_k8s_extension/consts.py index dff2e32b886..b40cf57ed27 100644 --- a/src/k8s-extension/azext_k8s_extension/consts.py +++ b/src/k8s-extension/azext_k8s_extension/consts.py @@ -21,3 +21,5 @@ CONNECTED_CLUSTER_API_VERSION = "2021-10-01" MANAGED_CLUSTER_API_VERSION = "2021-10-01" APPLIANCE_API_VERSION = "2021-10-31-preview" + +EXTENSION_TYPE_API_VERSION = "2022-01-15-preview" From 8b9da044a837ad55e57beeda8b5e5512480b3dc6 Mon Sep 17 00:00:00 2001 From: Deeksha Sharma Date: Wed, 3 Aug 2022 09:34:10 -0700 Subject: [PATCH 19/20] fixing styling --- src/k8s-extension/azext_k8s_extension/_client_factory.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/k8s-extension/azext_k8s_extension/_client_factory.py b/src/k8s-extension/azext_k8s_extension/_client_factory.py index acda2b4fde9..01fda393236 100644 --- a/src/k8s-extension/azext_k8s_extension/_client_factory.py +++ b/src/k8s-extension/azext_k8s_extension/_client_factory.py @@ -7,6 +7,7 @@ from azure.cli.core.profiles import ResourceType from . import consts + def cf_k8s_extension(cli_ctx, **kwargs): from .vendored_sdks import SourceControlConfigurationClient return get_mgmt_service_client(cli_ctx, SourceControlConfigurationClient, **kwargs) From 52c26999f73ce42b0f9a9ce938f9d2c4da1e0d12 Mon Sep 17 00:00:00 2001 From: Deeksha Sharma Date: Wed, 3 Aug 2022 19:07:37 -0700 Subject: [PATCH 20/20] updating version --- src/k8s-extension/HISTORY.rst | 4 ++++ src/k8s-extension/setup.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/k8s-extension/HISTORY.rst b/src/k8s-extension/HISTORY.rst index 02546900bce..040ef934ffa 100644 --- a/src/k8s-extension/HISTORY.rst +++ b/src/k8s-extension/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +1.2.6 +++++++++++++++++++ +* k8s-extension new sub command group for extension types + 1.2.5 ++++++++++++++++++ * microsoft.azuremonitor.containers: ContainerInsights Extension Managed Identity Auth Onboarding related bug fixes. diff --git a/src/k8s-extension/setup.py b/src/k8s-extension/setup.py index bcaef1d5887..0de2022b47f 100644 --- a/src/k8s-extension/setup.py +++ b/src/k8s-extension/setup.py @@ -33,7 +33,7 @@ # TODO: Add any additional SDK dependencies here DEPENDENCIES = [] -VERSION = "1.2.5" +VERSION = "1.2.6" with open("README.rst", "r", encoding="utf-8") as f: README = f.read()