From 0bf7b9896294ece176950c5ac71bd28d77fc0e95 Mon Sep 17 00:00:00 2001 From: nanthi Date: Wed, 15 Apr 2020 18:56:33 -0700 Subject: [PATCH 01/20] WIP {KubernetesConfiguration} Add CLI --- src/k8sconfiguration/HISTORY.rst | 8 + src/k8sconfiguration/README.rst | 5 + .../azext_k8sconfiguration/__init__.py | 32 ++ .../azext_k8sconfiguration/_client_factory.py | 13 + .../azext_k8sconfiguration/_help.py | 38 ++ .../azext_k8sconfiguration/_params.py | 38 ++ .../azext_k8sconfiguration/_validators.py | 35 ++ .../azext_metadata.json | 4 + .../azext_k8sconfiguration/commands.py | 29 ++ .../azext_k8sconfiguration/custom.py | 173 ++++++++ .../azext_k8sconfiguration/tests/__init__.py | 5 + .../tests/latest/__init__.py | 5 + .../test_kubernetesconfiguration_scenario.py | 71 ++++ .../vendored_sdks/__init__.py | 19 + .../vendored_sdks/models/__init__.py | 64 +++ .../vendored_sdks/models/compliance_status.py | 51 +++ .../models/compliance_status_py3.py | 51 +++ .../vendored_sdks/models/error_definition.py | 47 ++ .../models/error_definition_py3.py | 47 ++ .../vendored_sdks/models/error_response.py | 41 ++ .../models/error_response_py3.py | 41 ++ .../models/helm_operator_properties.py | 32 ++ .../models/helm_operator_properties_py3.py | 32 ++ .../vendored_sdks/models/proxy_resource.py | 42 ++ .../models/proxy_resource_py3.py | 42 ++ .../vendored_sdks/models/resource.py | 45 ++ .../models/resource_provider_operation.py | 34 ++ .../resource_provider_operation_display.py | 40 ++ ...resource_provider_operation_display_py3.py | 40 ++ .../resource_provider_operation_paged.py | 27 ++ .../models/resource_provider_operation_py3.py | 34 ++ .../vendored_sdks/models/resource_py3.py | 45 ++ .../vendored_sdks/models/result.py | 28 ++ .../vendored_sdks/models/result_py3.py | 28 ++ .../models/source_control_configuration.py | 107 +++++ ...urce_control_configuration_client_enums.py | 52 +++ .../source_control_configuration_paged.py | 27 ++ .../source_control_configuration_py3.py | 108 +++++ .../vendored_sdks/operations/__init__.py | 18 + .../vendored_sdks/operations/operations.py | 99 +++++ ...ource_control_configurations_operations.py | 400 ++++++++++++++++++ .../source_control_configuration_client.py | 88 ++++ .../vendored_sdks/version.py | 13 + src/k8sconfiguration/setup.cfg | 2 + src/k8sconfiguration/setup.py | 62 +++ 45 files changed, 2262 insertions(+) create mode 100644 src/k8sconfiguration/HISTORY.rst create mode 100644 src/k8sconfiguration/README.rst create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/__init__.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/_client_factory.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/_help.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/_params.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/_validators.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/azext_metadata.json create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/commands.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/custom.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/tests/__init__.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/tests/latest/__init__.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/__init__.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/__init__.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/compliance_status.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/compliance_status_py3.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_definition.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_definition_py3.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_response.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_response_py3.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/helm_operator_properties.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/helm_operator_properties_py3.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/proxy_resource.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/proxy_resource_py3.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_display.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_display_py3.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_paged.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_py3.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_py3.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/result.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/result_py3.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration_client_enums.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration_paged.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration_py3.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/__init__.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/operations.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/source_control_configurations_operations.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/source_control_configuration_client.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/version.py create mode 100644 src/k8sconfiguration/setup.cfg create mode 100644 src/k8sconfiguration/setup.py diff --git a/src/k8sconfiguration/HISTORY.rst b/src/k8sconfiguration/HISTORY.rst new file mode 100644 index 00000000000..8c34bccfff8 --- /dev/null +++ b/src/k8sconfiguration/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. \ No newline at end of file diff --git a/src/k8sconfiguration/README.rst b/src/k8sconfiguration/README.rst new file mode 100644 index 00000000000..edff60e977e --- /dev/null +++ b/src/k8sconfiguration/README.rst @@ -0,0 +1,5 @@ +Microsoft Azure CLI 'k8sconfiguration' Extension +========================================== + +This package is for the 'k8sconfiguration' extension. +i.e. 'az k8sconfiguration' \ No newline at end of file diff --git a/src/k8sconfiguration/azext_k8sconfiguration/__init__.py b/src/k8sconfiguration/azext_k8sconfiguration/__init__.py new file mode 100644 index 00000000000..5f5baae724d --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/__init__.py @@ -0,0 +1,32 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader + +from azext_k8sconfiguration._help import helps # pylint: disable=unused-import + + +class K8sconfigurationCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_k8sconfiguration._client_factory import cf_k8sconfiguration + k8sconfiguration_custom = CliCommandType( + operations_tmpl='azext_k8sconfiguration.custom#{}', + client_factory=cf_k8sconfiguration) + super(K8sconfigurationCommandsLoader, self).__init__(cli_ctx=cli_ctx, + custom_command_type=k8sconfiguration_custom) + + def load_command_table(self, args): + from azext_k8sconfiguration.commands import load_command_table + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from azext_k8sconfiguration._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = K8sconfigurationCommandsLoader diff --git a/src/k8sconfiguration/azext_k8sconfiguration/_client_factory.py b/src/k8sconfiguration/azext_k8sconfiguration/_client_factory.py new file mode 100644 index 00000000000..0869cb5a08c --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/_client_factory.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +def cf_k8sconfiguration(cli_ctx, *_): + + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from azext_k8sconfiguration.vendored_sdks import SourceControlConfigurationClient + return get_mgmt_service_client(cli_ctx, SourceControlConfigurationClient) + +def cf_k8sconfiguration_operation(cli_ctx, _): + return cf_k8sconfiguration(cli_ctx).source_control_configurations \ No newline at end of file diff --git a/src/k8sconfiguration/azext_k8sconfiguration/_help.py b/src/k8sconfiguration/azext_k8sconfiguration/_help.py new file mode 100644 index 00000000000..20bc0900f63 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/_help.py @@ -0,0 +1,38 @@ +# 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. +# -------------------------------------------------------------------------------------------- + +from knack.help_files import helps # pylint: disable=unused-import + + +helps['k8sconfiguration'] = """ + type: group + short-summary: Commands to manage K8sconfigurations. +""" + +helps['k8sconfiguration create'] = """ + type: command + short-summary: Create a K8sconfiguration. +""" + +helps['k8sconfiguration list'] = """ + type: command + short-summary: List K8sconfigurations. +""" + +helps['k8sconfiguration delete'] = """ + type: command + short-summary: Delete a K8sconfiguration. +""" + +helps['k8sconfiguration show'] = """ + type: command + short-summary: Show details of a K8sconfiguration. +""" + +helps['k8sconfiguration update'] = """ + type: command + short-summary: Update a K8sconfiguration. +""" diff --git a/src/k8sconfiguration/azext_k8sconfiguration/_params.py b/src/k8sconfiguration/azext_k8sconfiguration/_params.py new file mode 100644 index 00000000000..d1a0bb32915 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/_params.py @@ -0,0 +1,38 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=line-too-long + +from knack.arguments import CLIArgumentType + +from azure.cli.core.commands.parameters import ( + resource_group_name_type, + get_resource_name_completion_list, + get_three_state_flag, + get_location_type, + get_enum_type, + tags_type, + name_type +) + +def load_arguments(self, _): + + from azure.cli.core.commands.parameters import tags_type + from azure.cli.core.commands.validators import get_default_location_from_resource_group + + #sourcecontrolconfiguration_type = CLIArgumentType(options_list='--sourcecontrolconfiguration-name', help='Name of the K8sconfiguration.', id_part='name') + sourcecontrolconfiguration_type = CLIArgumentType(help='Name of the K8sconfiguration.') + + with self.argument_context('k8sconfiguration') as c: + c.argument('tags', tags_type) + c.argument('location', validator=get_default_location_from_resource_group) + c.argument('name', sourcecontrolconfiguration_type, options_list=['--name', '-n']) + 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']), help='Optional parameter to specify Onprem clusters (default) or AKS clusters.') + c.argument('repository_url', options_list=['--repository-url', '-u'], help='Url of the sourceControl repository') + c.argument('enable_helm_operator', arg_type=get_three_state_flag(), help='Enable support for Helm chart deployments') + c.argument('cluster_scoped', action='store_true', help='''Optional switch to set the scope of the operator to be cluster. Default scope is 'namespace' ''') + + with self.argument_context('k8sconfiguration list') as c: + c.argument('sourcecontrolconfiguration', sourcecontrolconfiguration_type, id_part=None) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/_validators.py b/src/k8sconfiguration/azext_k8sconfiguration/_validators.py new file mode 100644 index 00000000000..f054a7d91fd --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/_validators.py @@ -0,0 +1,35 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from knack.util import CLIError + +def example_name_or_id_validator(cmd, namespace): + # Example of a storage account name or ID validator. + # See: https://github.com/Azure/azure-cli/blob/dev/doc/authoring_command_modules/authoring_commands.md#supporting-name-or-id-parameters + from azure.cli.core.commands.client_factory import get_subscription_id + from msrestazure.tools import is_valid_resource_id, resource_id + if namespace.storage_account: + if not is_valid_resource_id(namespace.RESOURCE): + namespace.storage_account = resource_id( + subscription=get_subscription_id(cmd.cli_ctx), + resource_group=namespace.resource_group_name, + namespace='Microsoft.Storage', + type='storageAccounts', + name=namespace.storage_account + ) + +def validate_configuration_type(namespace): + if namespace.configuration_type.lower() != 'sourcecontrolconfiguration': + raise CLIError('Invalid configuration-type. Valid value is "sourceControlConfiguration"') + +def validate_operator_scope(namespace): + if namespace.cluster_scoped: + namespace.operator_scope = 'cluster' + else: + # Operator Namespace is mandatory if the Operator Scope is 'namespace' + if namespace.operator_namespace.string() == None: + raise CLIError('Invalid operator-namespace. Namespace is mandatory if the scope is "namespace"') + else: + namespace.operator_scope = 'namespace' diff --git a/src/k8sconfiguration/azext_k8sconfiguration/azext_metadata.json b/src/k8sconfiguration/azext_k8sconfiguration/azext_metadata.json new file mode 100644 index 00000000000..55c81bf3328 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.0.67" +} \ No newline at end of file diff --git a/src/k8sconfiguration/azext_k8sconfiguration/commands.py b/src/k8sconfiguration/azext_k8sconfiguration/commands.py new file mode 100644 index 00000000000..32f20e8536d --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/commands.py @@ -0,0 +1,29 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +from azure.cli.core.commands import CliCommandType +from azext_k8sconfiguration._client_factory import (cf_k8sconfiguration, cf_k8sconfiguration_operation) + + +def load_command_table(self, _): + + k8sconfiguration_sdk = CliCommandType( + operations_tmpl='azext_k8sconfiguration.vendored_sdks.operations#SourceControlConfigurationsOperations.{}', + client_factory=cf_k8sconfiguration) + + + with self.command_group('k8sconfiguration', k8sconfiguration_sdk, client_factory=cf_k8sconfiguration_operation) as g: + g.custom_command('create', 'create_k8sconfiguration') + g.custom_command('update', 'update_k8sconfiguration') + g.custom_command('delete', 'delete_k8sconfiguration') + g.custom_command('list', 'list_k8sconfiguration') + g.custom_command('show', 'show_k8sconfiguration') + #g.generic_update_command('update', setter_name='update', custom_func_name='update_k8sconfiguration') + + + with self.command_group('k8sconfiguration', is_preview=True): + pass + diff --git a/src/k8sconfiguration/azext_k8sconfiguration/custom.py b/src/k8sconfiguration/azext_k8sconfiguration/custom.py new file mode 100644 index 00000000000..d35c4e87aed --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/custom.py @@ -0,0 +1,173 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from knack.util import CLIError + +from azext_k8sconfiguration.vendored_sdks.models.source_control_configuration_py3 import SourceControlConfiguration +from azext_k8sconfiguration.vendored_sdks.models.helm_operator_properties import HelmOperatorProperties + +def show_k8sconfiguration(cmd, client, resource_group_name, cluster_name, name, cluster_type='connectedClusters', + configuration_type='sourceControlConfiguration', api_version='2019-11-01-preview'): + # Determine ClusterRP + if 'connectedclusters' == cluster_type.lower(): + cluster_rp = 'Microsoft.Kubernetes' + elif 'managedclusters' == cluster_type.lower(): + cluster_rp = 'Microsoft.ContainerService' + else: + raise CLIError("Invalid cluster-type. Supported values are 'connectedClusters' and 'managedClusters'.") + + # Validate ConfigurationType + if configuration_type.lower() != 'sourcecontrolconfiguration': + raise CLIError('Invalid configuration_type. Valid value is "sourceControlConfiguration"') + else: + source_control_configuration_name = name + + # Ensure apiVersion value + if api_version is None: + api_version = client.api_version + + return client.get(resource_group_name, cluster_rp, cluster_type, cluster_name, source_control_configuration_name, + api_version) + +def create_k8sconfiguration(cmd, client, resource_group_name, cluster_name, name, repository_url, + operator_instance_name=None, operator_namespace='default', cluster_type='connectedClusters', + configuration_type='sourceControlConfiguration', operator_params='', cluster_scoped=None, + operator_type='flux', enable_helm_operator=None, helm_operator_version='0.2.0', + helm_operator_params='', api_version='2019-11-01-preview'): + # Determine ClusterRP + if cluster_type == 'connectedClusters': + cluster_rp = 'Microsoft.Kubernetes' + elif cluster_type == 'managedClusters' == cluster_type: + cluster_rp = 'Microsoft.ContainerService' + else: + raise CLIError("Invalid cluster-type. Supported values are 'connectedClusters' and 'managedClusters'.") + + # Validate configurationType + if configuration_type.lower() != 'sourcecontrolconfiguration': + raise CLIError('Invalid configuration_type. Valid value is "sourceControlConfiguration"') + else: + source_control_configuration_name = name.strip() + + # Ensure apiVersion value + if api_version is None: + api_version = client.api_version + + # Determine operatorScope + operator_scope = '' + if cluster_scoped is None: + operator_scope = 'namespace' + + # Determine operatorInstanceName + if operator_instance_name is None: + operator_instance_name = source_control_configuration_name + + # Create helmOperatorProperties object + helm_operator_properties = HelmOperatorProperties() + + if enable_helm_operator: + helm_operator_properties.chart_version = helm_operator_version.strip() + helm_operator_properties.chart_values = helm_operator_params.strip() + else: + helm_operator_properties = None + + # Create sourceControlConfiguration object + source_control_configuration = SourceControlConfiguration(repository_url=repository_url, + operator_namespace=operator_namespace, + operator_instance_name=operator_instance_name, + operator_type=operator_type, + operator_params=operator_params, + operator_scope=operator_scope, + enable_helm_operator=enable_helm_operator, + helm_operator_properties=helm_operator_properties) + + # Try to create the resource + return client.create_or_update(resource_group_name, cluster_rp, cluster_type, cluster_name, + source_control_configuration_name, api_version, source_control_configuration) + +def update_k8sconfiguration(cmd, client, resource_group_name, cluster_name, name, + configuration_type='sourceControlConfiguration', cluster_type='connectedClusters', + repository_url=None, operator_params=None, enable_helm_operator=None, + helm_operator_version=None, helm_operator_params=None, api_version='2019-11-01-preview'): + # Determine ClusterRP + if 'connectedclusters' == cluster_type.lower(): + cluster_rp = 'Microsoft.Kubernetes' + elif 'managedclusters' == cluster_type.lower(): + cluster_rp = 'Microsoft.ContainerService' + else: + raise CLIError("Invalid cluster-type. Supported values are 'connectedClusters' and 'managedClusters'.") + + # Validate configurationType + if configuration_type.lower() != 'sourcecontrolconfiguration': + raise CLIError('Invalid configuration_type. Valid value is "sourceControlConfiguration"') + else: + source_control_configuration_name = name.strip() + + # Ensure apiVersion value + if api_version is None: + api_version = client.api_version + + config = client.get(resource_group_name, cluster_rp, cluster_type, cluster_name, + source_control_configuration_name, api_version).as_dict() + + updateYes = False + + # Set input values, if they are supplied + if repository_url is not None: + config['repository_url'] = repository_url + updateYes = True + + if operator_params is not None: + config['operator_params'] = operator_params + updateYes = True + + if enable_helm_operator is not None: + config['enable_helm_operator'] = enable_helm_operator + updateYes = True + + if helm_operator_version is not None: + config['helm_operator_version'] = helm_operator_version + updateYes = True + + if helm_operator_params is not None: + config['helm_operator_params'] = helm_operator_params + updateYes = True + + print ("#DEBUG#: updateYes b4 check", updateYes) + + if updateYes is False: + raise CLIError('Invalid update. No values to update!') + + return client.create_or_update(resource_group_name, cluster_rp, cluster_type, cluster_name, + source_control_configuration_name, api_version, config) + +def list_k8sconfiguration(cmd, client, resource_group_name, cluster_name, cluster_type='connectedClusters', + api_version='2019-11-01-preview'): + if 'connectedclusters' == cluster_type.lower(): + cluster_rp = 'Microsoft.Kubernetes' + elif 'managedclusters' == cluster_type.lower(): + cluster_rp = 'Microsoft.ContainerService' + else: + raise CLIError("Invalid cluster-type. Supported values are 'connectedClusters' and 'managedClusters'.") + + return client.list(resource_group_name, cluster_rp, cluster_type, cluster_name, api_version) + +def delete_k8sconfiguration(cmd, client, resource_group_name, cluster_name, name, cluster_type='connectedClusters', + configuration_type='sourceControlConfiguration', api_version='2019-11-01-preview'): + if 'connectedclusters' == cluster_type.lower(): + cluster_rp = 'Microsoft.Kubernetes' + elif 'managedclusters' == cluster_type.lower(): + cluster_rp = 'Microsoft.ContainerService' + else: + raise CLIError("Invalid cluster-type. Supported values are 'connectedClusters' and 'managedClusters'.") + + if configuration_type.lower() != 'sourcecontrolconfiguration': + raise CLIError('Invalid configuration_type. Valid value is "sourceControlConfiguration"') + else: + source_control_configuration_name = name + + custom_headers = {"x-ms-force": "true"} + + return client.delete(resource_group_name, cluster_rp, cluster_type, cluster_name, source_control_configuration_name, + api_version, custom_headers) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/tests/__init__.py b/src/k8sconfiguration/azext_k8sconfiguration/tests/__init__.py new file mode 100644 index 00000000000..2dcf9bb68b3 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/tests/__init__.py @@ -0,0 +1,5 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# ----------------------------------------------------------------------------- \ No newline at end of file diff --git a/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/__init__.py b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/__init__.py new file mode 100644 index 00000000000..2dcf9bb68b3 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/__init__.py @@ -0,0 +1,5 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# ----------------------------------------------------------------------------- \ No newline at end of file diff --git a/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py new file mode 100644 index 00000000000..d348c5212ab --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py @@ -0,0 +1,71 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import os +import unittest + +from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer, record_only) + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +class K8sconfigurationScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_k8sconfiguration') + @record_only() + def test_k8sconfiguration(self, resource_group): + + # self.kwargs.update({ + # 'name': 'azCliTest-testinghelminstallation-0108c', + # 'clusterName': 'testinghelminstallation', + # 'rg': 'haikudevtesting', + # 'repoUrl': 'git://github.com/anubhav929/flux-get-started', + # 'opInstanceName': 'azCliTest-testinghelminstallation-opInst', + # 'opNamespace': 'azCliTest-testinghelminstallation-opNS' + # }) + + self.kwargs.update({ + 'name': 'config225a', + 'clusterName': 'matrived-tpcomi', + 'rg': 'haikudevtesting', + 'repoUrl': 'git://github.com/anubhav929/flux-get-started', + 'opInstanceName': 'config225a-opin', + 'opNamespace': 'config225a-opnsnew' + }) + count = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {clusterName}').get_output_in_json()) + + self.greater_than(count, 7) + self.cmd(''' k8sconfiguration create -g {rg} + -n {name} + -c {clusterName} + -u {repoUrl} + --operator-instance-name {opInstanceName} + --operator-namespace {opNamespace} + --operator-params \"--git-readonly \" + --enable-helm-operator + --helm-operator-chart-version 0.2.0 + --helm-operator-chart-values \"--set git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system\" ''', + checks=[ + self.check('name', '{name}'), + self.check('resourceGroup', '{rg}'), + self.check('operatorInstanceName', '{opInstanceName}'), + self.check('operatorNamespace', '{opNamespace}'), + self.check('provisioningState', 'Succeeded'), + self.check('operatorScope', 'cluster'), + self.check('operatorType', 'Flux'), + ]) + + # count = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {clusterName}').get_output_in_json()) + # self.cmd('k8sconfiguration show -g {rg} --cluster-name {clusterName} --name {name}', checks=[ + # self.check('name', '{name}'), + # self.check('resourceGroup', '{rg}'), + # self.check('tags.foo', 'None') + # ]) + # + # self.cmd('k8sconfiguration delete -g {rg} --cluster-name {clusterName} --name {name}') + # final_count = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {clusterName}').get_output_in_json()) + # self.assertTrue(final_count, count - 1) \ No newline at end of file diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/__init__.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/__init__.py new file mode 100644 index 00000000000..1acad8634cd --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/__init__.py @@ -0,0 +1,19 @@ +# 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 .source_control_configuration_client import SourceControlConfigurationClientConfiguration +from .version import VERSION + +__all__ = ['SourceControlConfigurationClient', 'SourceControlConfigurationClientConfiguration'] + +__version__ = VERSION + diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/__init__.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/__init__.py new file mode 100644 index 00000000000..40bf48bccd4 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/__init__.py @@ -0,0 +1,64 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from .resource_py3 import Resource + from .proxy_resource_py3 import ProxyResource + from .result_py3 import Result + from .error_definition_py3 import ErrorDefinition + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .compliance_status_py3 import ComplianceStatus + from .helm_operator_properties_py3 import HelmOperatorProperties + from .source_control_configuration_py3 import SourceControlConfiguration + from .resource_provider_operation_display_py3 import ResourceProviderOperationDisplay + from .resource_provider_operation_py3 import ResourceProviderOperation +except (SyntaxError, ImportError): + from .resource import Resource + from .proxy_resource import ProxyResource + from .result import Result + from .error_definition import ErrorDefinition + from .error_response import ErrorResponse, ErrorResponseException + from .compliance_status import ComplianceStatus + from .helm_operator_properties import HelmOperatorProperties + from .source_control_configuration import SourceControlConfiguration + from .resource_provider_operation_display import ResourceProviderOperationDisplay + from .resource_provider_operation import ResourceProviderOperation +from .source_control_configuration_paged import SourceControlConfigurationPaged +from .resource_provider_operation_paged import ResourceProviderOperationPaged +from .source_control_configuration_client_enums import ( + ComplianceState, + MessageLevel, + OperatorType, + OperatorScope, + EnableHelmOperator, + ProvisioningState, +) + +__all__ = [ + 'Resource', + 'ProxyResource', + 'Result', + 'ErrorDefinition', + 'ErrorResponse', 'ErrorResponseException', + 'ComplianceStatus', + 'HelmOperatorProperties', + 'SourceControlConfiguration', + 'ResourceProviderOperationDisplay', + 'ResourceProviderOperation', + 'SourceControlConfigurationPaged', + 'ResourceProviderOperationPaged', + 'ComplianceState', + 'MessageLevel', + 'OperatorType', + 'OperatorScope', + 'EnableHelmOperator', + 'ProvisioningState', +] diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/compliance_status.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/compliance_status.py new file mode 100644 index 00000000000..c6c27eb4da3 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/compliance_status.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class ComplianceStatus(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' + :vartype compliance_state: str or + ~azure.mgmt.k8sconfiguration.models.ComplianceState + :param last_config_applied: Datetime the configuration was last applied. + :type last_config_applied: 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.k8sconfiguration.models.MessageLevel + """ + + _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) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/compliance_status_py3.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/compliance_status_py3.py new file mode 100644 index 00000000000..a2b738cdfb0 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/compliance_status_py3.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class ComplianceStatus(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' + :vartype compliance_state: str or + ~azure.mgmt.k8sconfiguration.models.ComplianceState + :param last_config_applied: Datetime the configuration was last applied. + :type last_config_applied: 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.k8sconfiguration.models.MessageLevel + """ + + _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=None, message: str=None, message_level=None, **kwargs) -> None: + super(ComplianceStatus, self).__init__(**kwargs) + self.compliance_state = None + self.last_config_applied = last_config_applied + self.message = message + self.message_level = message_level diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_definition.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_definition.py new file mode 100644 index 00000000000..c95b6462ada --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_definition.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class ErrorDefinition(Model): + """Error definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Service specific error code which serves as the substatus for + the HTTP error code. + :vartype code: str + :ivar message: Description of the error. + :vartype message: str + :ivar details: Internal error details. + :vartype details: + list[~azure.mgmt.k8sconfiguration.models.ErrorDefinition] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDefinition]'}, + } + + def __init__(self, **kwargs): + super(ErrorDefinition, self).__init__(**kwargs) + self.code = None + self.message = None + self.details = None diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_definition_py3.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_definition_py3.py new file mode 100644 index 00000000000..5c95e7c1b97 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_definition_py3.py @@ -0,0 +1,47 @@ +# 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 msrest.serialization import Model + + +class ErrorDefinition(Model): + """Error definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Service specific error code which serves as the substatus for + the HTTP error code. + :vartype code: str + :ivar message: Description of the error. + :vartype message: str + :ivar details: Internal error details. + :vartype details: + list[~azure.mgmt.k8sconfiguration.models.ErrorDefinition] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDefinition]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDefinition, self).__init__(**kwargs) + self.code = None + self.message = None + self.details = None diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_response.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_response.py new file mode 100644 index 00000000000..e95ade38243 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_response.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error response. + + :param error: Error definition. + :type error: ~azure.mgmt.k8sconfiguration.models.ErrorDefinition + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinition'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_response_py3.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_response_py3.py new file mode 100644 index 00000000000..f40d9d92d46 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_response_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error response. + + :param error: Error definition. + :type error: ~azure.mgmt.k8sconfiguration.models.ErrorDefinition + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinition'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/helm_operator_properties.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/helm_operator_properties.py new file mode 100644 index 00000000000..cdcc4e667f2 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/helm_operator_properties.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class HelmOperatorProperties(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) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/helm_operator_properties_py3.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/helm_operator_properties_py3.py new file mode 100644 index 00000000000..d5aa76fd60d --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/helm_operator_properties_py3.py @@ -0,0 +1,32 @@ +# 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 msrest.serialization import Model + + +class HelmOperatorProperties(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, *, chart_version: str = None, chart_values: str = None, **kwargs) -> None: + super(HelmOperatorProperties, self).__init__(**kwargs) + self.chart_version = chart_version + self.chart_values = chart_values diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/proxy_resource.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/proxy_resource.py new file mode 100644 index 00000000000..d1081c4e0fc --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/proxy_resource.py @@ -0,0 +1,42 @@ +# 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 .resource import Resource + + +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 + """ + + _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) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/proxy_resource_py3.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/proxy_resource_py3.py new file mode 100644 index 00000000000..01de2c50909 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/proxy_resource_py3.py @@ -0,0 +1,42 @@ +# 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 .resource_py3 import Resource + + +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 + """ + + _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) -> None: + super(ProxyResource, self).__init__(**kwargs) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource.py new file mode 100644 index 00000000000..9b91722756c --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class Resource(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 + """ + + _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 diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation.py new file mode 100644 index 00000000000..8f4b8427f19 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class ResourceProviderOperation(Model): + """Supported operation of this resource provider. + + :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.k8sconfiguration.models.ResourceProviderOperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderOperation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_display.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_display.py new file mode 100644 index 00000000000..32d8a009cdc --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_display.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class ResourceProviderOperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Resource provider: Microsoft K8sConfiguration. + :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) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_display_py3.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_display_py3.py new file mode 100644 index 00000000000..442dcb460f5 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_display_py3.py @@ -0,0 +1,40 @@ +# 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 msrest.serialization import Model + + +class ResourceProviderOperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Resource provider: Microsoft K8sConfiguration. + :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, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_paged.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_paged.py new file mode 100644 index 00000000000..540410b763d --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class ResourceProviderOperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`ResourceProviderOperation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ResourceProviderOperation]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourceProviderOperationPaged, self).__init__(*args, **kwargs) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_py3.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_py3.py new file mode 100644 index 00000000000..ad7b611c335 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_py3.py @@ -0,0 +1,34 @@ +# 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 msrest.serialization import Model + + +class ResourceProviderOperation(Model): + """Supported operation of this resource provider. + + :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.k8sconfiguration.models.ResourceProviderOperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(ResourceProviderOperation, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_py3.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_py3.py new file mode 100644 index 00000000000..29e573bf29f --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_py3.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class Resource(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 + """ + + _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) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/result.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/result.py new file mode 100644 index 00000000000..4281999aeeb --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/result.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class Result(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) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/result_py3.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/result_py3.py new file mode 100644 index 00000000000..9da83b057b1 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/result_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class Result(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, *, sample_property: str=None, **kwargs) -> None: + super(Result, self).__init__(**kwargs) + self.sample_property = sample_property diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration.py new file mode 100644 index 00000000000..83512e22638 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration.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 .proxy_resource import ProxyResource +from .helm_operator_properties import HelmOperatorProperties + +class SourceControlConfiguration(ProxyResource): + """The SourceControl Configuration 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 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. Default value: "default" . + :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.k8sconfiguration.models.OperatorType + :param operator_params: Any Parameters for the Operator instance in string + format. + :type operator_params: 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.k8sconfiguration.models.OperatorScope + :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 enable_helm_operator: Option to enable Helm Operator for this git + configuration. Possible values include: 'true', 'false' + :type enable_helm_operator: str or + ~azure.mgmt.k8sconfiguration.models.EnableHelmOperator + :param helm_operator_properties: Properties for Helm operator. + :type helm_operator_properties: + ~azure.mgmt.k8sconfiguration.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.k8sconfiguration.models.ProvisioningState + :ivar compliance_status: Compliance Status of the Configuration + :vartype compliance_status: + ~azure.mgmt.k8sconfiguration.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'}, + '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'}, + 'operator_scope': {'key': 'properties.operatorScope', 'type': 'str'}, + 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, + 'enable_helm_operator': {'key': 'properties.enableHelmOperator', 'type': 'str'}, + '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.operator_scope = kwargs.get('operator_scope', "cluster") + self.repository_public_key = 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 diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration_client_enums.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration_client_enums.py new file mode 100644 index 00000000000..08ec38590e2 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration_client_enums.py @@ -0,0 +1,52 @@ +# 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 + + +class ComplianceState(str, Enum): + + pending = "Pending" + compliant = "Compliant" + noncompliant = "Noncompliant" + + +class MessageLevel(str, Enum): + + error = "Error" + warning = "Warning" + information = "Information" + + +class OperatorType(str, Enum): + + flux = "Flux" + + +class OperatorScope(str, Enum): + + cluster = "cluster" + namespace = "namespace" + + +class EnableHelmOperator(str, Enum): + + true = "true" + false = "false" + + +class ProvisioningState(str, Enum): + + accepted = "Accepted" + deleting = "Deleting" + running = "Running" + succeeded = "Succeeded" + failed = "Failed" diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration_paged.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration_paged.py new file mode 100644 index 00000000000..2f8000af6d2 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class SourceControlConfigurationPaged(Paged): + """ + A paging container for iterating over a list of :class:`SourceControlConfiguration ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SourceControlConfiguration]'} + } + + def __init__(self, *args, **kwargs): + + super(SourceControlConfigurationPaged, self).__init__(*args, **kwargs) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration_py3.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration_py3.py new file mode 100644 index 00000000000..ff1646a46a7 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration_py3.py @@ -0,0 +1,108 @@ +# 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 .proxy_resource_py3 import ProxyResource +from .helm_operator_properties import HelmOperatorProperties + + +class SourceControlConfiguration(ProxyResource): + """The SourceControl Configuration 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 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. Default value: "default" . + :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.k8sconfiguration.models.OperatorType + :param operator_params: Any Parameters for the Operator instance in string + format. + :type operator_params: 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.k8sconfiguration.models.OperatorScope + :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 enable_helm_operator: Option to enable Helm Operator for this git + configuration. Possible values include: 'true', 'false' + :type enable_helm_operator: str or + ~azure.mgmt.k8sconfiguration.models.EnableHelmOperator + :param helm_operator_properties: Properties for Helm operator. + :type helm_operator_properties: + ~azure.mgmt.k8sconfiguration.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.k8sconfiguration.models.ProvisioningState + :ivar compliance_status: Compliance Status of the Configuration + :vartype compliance_status: + ~azure.mgmt.k8sconfiguration.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'}, + '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'}, + 'operator_scope': {'key': 'properties.operatorScope', 'type': 'str'}, + 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, + 'enable_helm_operator': {'key': 'properties.enableHelmOperator', 'type': 'str'}, + '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: str=None, operator_namespace: str="default", operator_instance_name: str=None, operator_type=None, operator_params: str=None, operator_scope="cluster", enable_helm_operator: str=None, helm_operator_properties: HelmOperatorProperties=None, **kwargs) -> None: + super(SourceControlConfiguration, self).__init__(**kwargs) + 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.operator_scope = operator_scope + self.repository_public_key = None + self.enable_helm_operator = enable_helm_operator + self.helm_operator_properties = helm_operator_properties + self.provisioning_state = None + self.compliance_status = None diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/__init__.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/__init__.py new file mode 100644 index 00000000000..53b6c2e911a --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/__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_configurations_operations import SourceControlConfigurationsOperations +from .operations import Operations + +__all__ = [ + 'SourceControlConfigurationsOperations', + 'Operations', +] diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/operations.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/operations.py new file mode 100644 index 00000000000..2226373d970 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/operations.py @@ -0,0 +1,99 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + :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 list( + self, api_version, custom_headers=None, raw=False, **operation_config): + """List all the available operations the K8sConfiguration resource + provider supports. + + :param api_version: The API version to be used with the HTTP request. + :type api_version: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ResourceProviderOperation + :rtype: + ~azure.mgmt.k8sconfiguration.models.ResourceProviderOperationPaged[~azure.mgmt.k8sconfiguration.models.ResourceProviderOperation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ResourceProviderOperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ResourceProviderOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.KubernetesConfiguration/operations'} diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/source_control_configurations_operations.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/source_control_configurations_operations.py new file mode 100644 index 00000000000..d757d2bcac1 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/source_control_configurations_operations.py @@ -0,0 +1,400 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class SourceControlConfigurationsOperations(object): + """SourceControlConfigurationsOperations operations. + + :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 get( + self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, api_version, custom_headers=None, raw=False, **operation_config): + """Gets details of the Source Control Configuration. + + :param resource_group_name: The name of the resource group. + :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). Possible values include: + 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - + either managedClusters (for AKS clusters) or connectedClusters (for + OnPrem K8S clusters). Possible values include: 'managedClusters', + 'connectedClusters' + :type cluster_resource_name: str + :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 api_version: The API version to be used with the HTTP request. + :type api_version: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SourceControlConfiguration or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.k8sconfiguration.models.SourceControlConfiguration + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SourceControlConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} + + def create_or_update( + self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, api_version, source_control_configuration, custom_headers=None, raw=False, **operation_config): + """Create a new Kubernetes Source Control Configuration. + + :param resource_group_name: The name of the resource group. + :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). Possible values include: + 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - + either managedClusters (for AKS clusters) or connectedClusters (for + OnPrem K8S clusters). Possible values include: 'managedClusters', + 'connectedClusters' + :type cluster_resource_name: str + :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 api_version: The API version to be used with the HTTP request. + :type api_version: str + :param source_control_configuration: Properties necessary to Create + K8sConfiguration. + :type source_control_configuration: + ~azure.mgmt.k8sconfiguration.models.SourceControlConfiguration + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SourceControlConfiguration or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.k8sconfiguration.models.SourceControlConfiguration + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(source_control_configuration, 'SourceControlConfiguration') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SourceControlConfiguration', response) + if response.status_code == 201: + deserialized = self._deserialize('SourceControlConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} + + + def _delete_initial( + self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, api_version, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, api_version, custom_headers=None, raw=False, polling=True, **operation_config): + """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. + :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). Possible values include: + 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - + either managedClusters (for AKS clusters) or connectedClusters (for + OnPrem K8S clusters). Possible values include: 'managedClusters', + 'connectedClusters' + :type cluster_resource_name: str + :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 api_version: The API version to be used with the HTTP request. + :type api_version: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + 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, + api_version=api_version, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} + + def list( + self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, api_version, custom_headers=None, raw=False, **operation_config): + """List all Source Control Configurations. + + :param resource_group_name: The name of the resource group. + :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). Possible values include: + 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - + either managedClusters (for AKS clusters) or connectedClusters (for + OnPrem K8S clusters). Possible values include: 'managedClusters', + 'connectedClusters' + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param api_version: The API version to be used with the HTTP request. + :type api_version: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SourceControlConfiguration + :rtype: + ~azure.mgmt.k8sconfiguration.models.SourceControlConfigurationPaged[~azure.mgmt.k8sconfiguration.models.SourceControlConfiguration] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SourceControlConfigurationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SourceControlConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations'} diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/source_control_configuration_client.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/source_control_configuration_client.py new file mode 100644 index 00000000000..08afb4a5cee --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/source_control_configuration_client.py @@ -0,0 +1,88 @@ +# 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 msrest.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.source_control_configurations_operations import SourceControlConfigurationsOperations +from .operations.operations import Operations +from . import models + + +class SourceControlConfigurationClientConfiguration(AzureConfiguration): + """Configuration for SourceControlConfigurationClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :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 + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(SourceControlConfigurationClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-k8sconfiguration/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class SourceControlConfigurationClient(SDKClient): + """Use these APIs to create Source Control Configuration resources through ARM, for Kubernetes Clusters. + + :ivar config: Configuration for client. + :vartype config: SourceControlConfigurationClientConfiguration + + :ivar source_control_configurations: SourceControlConfigurations operations + :vartype source_control_configurations: azure.mgmt.k8sconfiguration.operations.SourceControlConfigurationsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.k8sconfiguration.operations.Operations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :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 + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = SourceControlConfigurationClientConfiguration(credentials, subscription_id, base_url) + super(SourceControlConfigurationClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2019-11-01-preview' + self._serialize = Serializer(client_models) + 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) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/version.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/version.py new file mode 100644 index 00000000000..acc1a73a8bb --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/version.py @@ -0,0 +1,13 @@ +# 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 = "2019-11-01-preview" + diff --git a/src/k8sconfiguration/setup.cfg b/src/k8sconfiguration/setup.cfg new file mode 100644 index 00000000000..3c6e79cf31d --- /dev/null +++ b/src/k8sconfiguration/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/src/k8sconfiguration/setup.py b/src/k8sconfiguration/setup.py new file mode 100644 index 00000000000..3fb055284f2 --- /dev/null +++ b/src/k8sconfiguration/setup.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python + +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +from codecs import open +from setuptools import setup, find_packages +try: + from azure_bdist_wheel import cmdclass +except ImportError: + from distutils import log as logger + logger.warn("Wheel is not available, disabling bdist_wheel hook") + +# TODO: Confirm this is the right version number you want and it matches your +# HISTORY.rst entry. +VERSION = '0.1.7' + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'License :: OSI Approved :: MIT License', +] + +# TODO: Add any additional SDK dependencies here +DEPENDENCIES = [ + 'azure-cli-core' +] + +with open('README.rst', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='k8sconfiguration', + version=VERSION, + description='Microsoft Azure Command-Line Tools K8sconfiguration Extension', + # TODO: Update author and email, if applicable + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + # TODO: consider pointing directly to your source code instead of the generic repo + url='https://github.com/Azure/azure-cli-extensions', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_k8sconfiguration': ['azext_metadata.json']}, +) \ No newline at end of file From 9f47a1f2b6e64068af7892dcb522baf2365314f4 Mon Sep 17 00:00:00 2001 From: nanthi Date: Thu, 16 Apr 2020 07:55:12 -0700 Subject: [PATCH 02/20] Fix Pylint errors --- .../azext_k8sconfiguration/__init__.py | 2 +- .../azext_k8sconfiguration/_client_factory.py | 2 +- .../azext_k8sconfiguration/_params.py | 26 +++++----- .../azext_k8sconfiguration/_validators.py | 11 ++-- .../azext_k8sconfiguration/commands.py | 4 +- .../azext_k8sconfiguration/custom.py | 52 +++++++++---------- .../azext_k8sconfiguration/tests/__init__.py | 2 +- .../tests/latest/__init__.py | 2 +- 8 files changed, 51 insertions(+), 50 deletions(-) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/__init__.py b/src/k8sconfiguration/azext_k8sconfiguration/__init__.py index 5f5baae724d..993cec81f44 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/__init__.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/__init__.py @@ -17,7 +17,7 @@ def __init__(self, cli_ctx=None): operations_tmpl='azext_k8sconfiguration.custom#{}', client_factory=cf_k8sconfiguration) super(K8sconfigurationCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=k8sconfiguration_custom) + custom_command_type=k8sconfiguration_custom) def load_command_table(self, args): from azext_k8sconfiguration.commands import load_command_table diff --git a/src/k8sconfiguration/azext_k8sconfiguration/_client_factory.py b/src/k8sconfiguration/azext_k8sconfiguration/_client_factory.py index 0869cb5a08c..3bd47114316 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/_client_factory.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/_client_factory.py @@ -10,4 +10,4 @@ def cf_k8sconfiguration(cli_ctx, *_): return get_mgmt_service_client(cli_ctx, SourceControlConfigurationClient) def cf_k8sconfiguration_operation(cli_ctx, _): - return cf_k8sconfiguration(cli_ctx).source_control_configurations \ No newline at end of file + return cf_k8sconfiguration(cli_ctx).source_control_configurations diff --git a/src/k8sconfiguration/azext_k8sconfiguration/_params.py b/src/k8sconfiguration/azext_k8sconfiguration/_params.py index d1a0bb32915..5a493de0f51 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/_params.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/_params.py @@ -7,21 +7,17 @@ from knack.arguments import CLIArgumentType from azure.cli.core.commands.parameters import ( - resource_group_name_type, - get_resource_name_completion_list, get_three_state_flag, - get_location_type, get_enum_type, - tags_type, - name_type + tags_type ) -def load_arguments(self, _): +from azure.cli.core.commands.validators import get_default_location_from_resource_group - from azure.cli.core.commands.parameters import tags_type - from azure.cli.core.commands.validators import get_default_location_from_resource_group +def load_arguments(self, _): - #sourcecontrolconfiguration_type = CLIArgumentType(options_list='--sourcecontrolconfiguration-name', help='Name of the K8sconfiguration.', id_part='name') + #sourcecontrolconfiguration_type = CLIArgumentType(options_list='--sourcecontrolconfiguration-name', + # help='Name of the K8sconfiguration.', id_part='name') sourcecontrolconfiguration_type = CLIArgumentType(help='Name of the K8sconfiguration.') with self.argument_context('k8sconfiguration') as c: @@ -29,10 +25,14 @@ def load_arguments(self, _): c.argument('location', validator=get_default_location_from_resource_group) c.argument('name', sourcecontrolconfiguration_type, options_list=['--name', '-n']) 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']), help='Optional parameter to specify Onprem clusters (default) or AKS clusters.') - c.argument('repository_url', options_list=['--repository-url', '-u'], help='Url of the sourceControl repository') - c.argument('enable_helm_operator', arg_type=get_three_state_flag(), help='Enable support for Helm chart deployments') - c.argument('cluster_scoped', action='store_true', help='''Optional switch to set the scope of the operator to be cluster. Default scope is 'namespace' ''') + c.argument('cluster_type', arg_type=get_enum_type(['connectedClusters', 'managedClusters']), + help='Optional parameter to specify Onprem clusters (default) or AKS clusters.') + c.argument('repository_url', options_list=['--repository-url', '-u'], + help='Url of the sourceControl repository') + c.argument('enable_helm_operator', arg_type=get_three_state_flag(), + help='Enable support for Helm chart deployments') + c.argument('cluster_scoped', action='store_true', + help='''Optional switch to set the scope of the operator to be cluster. Default scope is 'namespace' ''') with self.argument_context('k8sconfiguration list') as c: c.argument('sourcecontrolconfiguration', sourcecontrolconfiguration_type, id_part=None) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/_validators.py b/src/k8sconfiguration/azext_k8sconfiguration/_validators.py index f054a7d91fd..72c987a3c3a 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/_validators.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/_validators.py @@ -5,9 +5,11 @@ from knack.util import CLIError + def example_name_or_id_validator(cmd, namespace): # Example of a storage account name or ID validator. - # See: https://github.com/Azure/azure-cli/blob/dev/doc/authoring_command_modules/authoring_commands.md#supporting-name-or-id-parameters + # See: https://github.com/Azure/azure-cli/blob/dev/doc/authoring_command_modules/ + # authoring_commands.md#supporting-name-or-id-parameters from azure.cli.core.commands.client_factory import get_subscription_id from msrestazure.tools import is_valid_resource_id, resource_id if namespace.storage_account: @@ -20,16 +22,17 @@ def example_name_or_id_validator(cmd, namespace): name=namespace.storage_account ) + def validate_configuration_type(namespace): if namespace.configuration_type.lower() != 'sourcecontrolconfiguration': raise CLIError('Invalid configuration-type. Valid value is "sourceControlConfiguration"') + def validate_operator_scope(namespace): if namespace.cluster_scoped: namespace.operator_scope = 'cluster' else: # Operator Namespace is mandatory if the Operator Scope is 'namespace' - if namespace.operator_namespace.string() == None: + if namespace.operator_namespace.string() is None: raise CLIError('Invalid operator-namespace. Namespace is mandatory if the scope is "namespace"') - else: - namespace.operator_scope = 'namespace' + namespace.operator_scope = 'namespace' diff --git a/src/k8sconfiguration/azext_k8sconfiguration/commands.py b/src/k8sconfiguration/azext_k8sconfiguration/commands.py index 32f20e8536d..31c615b048a 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/commands.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/commands.py @@ -15,7 +15,8 @@ def load_command_table(self, _): client_factory=cf_k8sconfiguration) - with self.command_group('k8sconfiguration', k8sconfiguration_sdk, client_factory=cf_k8sconfiguration_operation) as g: + with self.command_group('k8sconfiguration', k8sconfiguration_sdk, client_factory=cf_k8sconfiguration_operation) \ + as g: g.custom_command('create', 'create_k8sconfiguration') g.custom_command('update', 'update_k8sconfiguration') g.custom_command('delete', 'delete_k8sconfiguration') @@ -26,4 +27,3 @@ def load_command_table(self, _): with self.command_group('k8sconfiguration', is_preview=True): pass - diff --git a/src/k8sconfiguration/azext_k8sconfiguration/custom.py b/src/k8sconfiguration/azext_k8sconfiguration/custom.py index d35c4e87aed..10995ae9d3c 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/custom.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/custom.py @@ -8,12 +8,12 @@ from azext_k8sconfiguration.vendored_sdks.models.source_control_configuration_py3 import SourceControlConfiguration from azext_k8sconfiguration.vendored_sdks.models.helm_operator_properties import HelmOperatorProperties -def show_k8sconfiguration(cmd, client, resource_group_name, cluster_name, name, cluster_type='connectedClusters', - configuration_type='sourceControlConfiguration', api_version='2019-11-01-preview'): +def show_k8sconfiguration(client, resource_group_name, cluster_name, name, cluster_type='connectedClusters', + configuration_type='sourceControlConfiguration', api_version='2019-11-01-preview'): # Determine ClusterRP - if 'connectedclusters' == cluster_type.lower(): + if cluster_type.lower() == 'connectedclusters': cluster_rp = 'Microsoft.Kubernetes' - elif 'managedclusters' == cluster_type.lower(): + elif cluster_type.lower() == 'managedclusters': cluster_rp = 'Microsoft.ContainerService' else: raise CLIError("Invalid cluster-type. Supported values are 'connectedClusters' and 'managedClusters'.") @@ -21,8 +21,8 @@ def show_k8sconfiguration(cmd, client, resource_group_name, cluster_name, name, # Validate ConfigurationType if configuration_type.lower() != 'sourcecontrolconfiguration': raise CLIError('Invalid configuration_type. Valid value is "sourceControlConfiguration"') - else: - source_control_configuration_name = name + + source_control_configuration_name = name # Ensure apiVersion value if api_version is None: @@ -31,15 +31,15 @@ def show_k8sconfiguration(cmd, client, resource_group_name, cluster_name, name, return client.get(resource_group_name, cluster_rp, cluster_type, cluster_name, source_control_configuration_name, api_version) -def create_k8sconfiguration(cmd, client, resource_group_name, cluster_name, name, repository_url, +def create_k8sconfiguration(client, resource_group_name, cluster_name, name, repository_url, operator_instance_name=None, operator_namespace='default', cluster_type='connectedClusters', configuration_type='sourceControlConfiguration', operator_params='', cluster_scoped=None, operator_type='flux', enable_helm_operator=None, helm_operator_version='0.2.0', helm_operator_params='', api_version='2019-11-01-preview'): # Determine ClusterRP - if cluster_type == 'connectedClusters': + if cluster_type.lower() == 'connectedclusters': cluster_rp = 'Microsoft.Kubernetes' - elif cluster_type == 'managedClusters' == cluster_type: + elif cluster_type.lower() == 'managedclusters': cluster_rp = 'Microsoft.ContainerService' else: raise CLIError("Invalid cluster-type. Supported values are 'connectedClusters' and 'managedClusters'.") @@ -47,8 +47,8 @@ def create_k8sconfiguration(cmd, client, resource_group_name, cluster_name, name # Validate configurationType if configuration_type.lower() != 'sourcecontrolconfiguration': raise CLIError('Invalid configuration_type. Valid value is "sourceControlConfiguration"') - else: - source_control_configuration_name = name.strip() + + source_control_configuration_name = name.strip() # Ensure apiVersion value if api_version is None: @@ -86,14 +86,14 @@ def create_k8sconfiguration(cmd, client, resource_group_name, cluster_name, name return client.create_or_update(resource_group_name, cluster_rp, cluster_type, cluster_name, source_control_configuration_name, api_version, source_control_configuration) -def update_k8sconfiguration(cmd, client, resource_group_name, cluster_name, name, +def update_k8sconfiguration(client, resource_group_name, cluster_name, name, configuration_type='sourceControlConfiguration', cluster_type='connectedClusters', repository_url=None, operator_params=None, enable_helm_operator=None, helm_operator_version=None, helm_operator_params=None, api_version='2019-11-01-preview'): # Determine ClusterRP - if 'connectedclusters' == cluster_type.lower(): + if cluster_type.lower() == 'connectedclusters': cluster_rp = 'Microsoft.Kubernetes' - elif 'managedclusters' == cluster_type.lower(): + elif cluster_type.lower() == 'managedclusters': cluster_rp = 'Microsoft.ContainerService' else: raise CLIError("Invalid cluster-type. Supported values are 'connectedClusters' and 'managedClusters'.") @@ -101,15 +101,15 @@ def update_k8sconfiguration(cmd, client, resource_group_name, cluster_name, name # Validate configurationType if configuration_type.lower() != 'sourcecontrolconfiguration': raise CLIError('Invalid configuration_type. Valid value is "sourceControlConfiguration"') - else: - source_control_configuration_name = name.strip() + + source_control_configuration_name = name.strip() # Ensure apiVersion value if api_version is None: api_version = client.api_version config = client.get(resource_group_name, cluster_rp, cluster_type, cluster_name, - source_control_configuration_name, api_version).as_dict() + source_control_configuration_name, api_version).as_dict() updateYes = False @@ -134,38 +134,36 @@ def update_k8sconfiguration(cmd, client, resource_group_name, cluster_name, name config['helm_operator_params'] = helm_operator_params updateYes = True - print ("#DEBUG#: updateYes b4 check", updateYes) - if updateYes is False: raise CLIError('Invalid update. No values to update!') return client.create_or_update(resource_group_name, cluster_rp, cluster_type, cluster_name, source_control_configuration_name, api_version, config) -def list_k8sconfiguration(cmd, client, resource_group_name, cluster_name, cluster_type='connectedClusters', +def list_k8sconfiguration(client, resource_group_name, cluster_name, cluster_type='connectedClusters', api_version='2019-11-01-preview'): - if 'connectedclusters' == cluster_type.lower(): + if cluster_type.lower() == 'connectedclusters': cluster_rp = 'Microsoft.Kubernetes' - elif 'managedclusters' == cluster_type.lower(): + elif cluster_type.lower() == 'managedclusters': cluster_rp = 'Microsoft.ContainerService' else: raise CLIError("Invalid cluster-type. Supported values are 'connectedClusters' and 'managedClusters'.") return client.list(resource_group_name, cluster_rp, cluster_type, cluster_name, api_version) -def delete_k8sconfiguration(cmd, client, resource_group_name, cluster_name, name, cluster_type='connectedClusters', +def delete_k8sconfiguration(client, resource_group_name, cluster_name, name, cluster_type='connectedClusters', configuration_type='sourceControlConfiguration', api_version='2019-11-01-preview'): - if 'connectedclusters' == cluster_type.lower(): + if cluster_type.lower() == 'connectedclusters': cluster_rp = 'Microsoft.Kubernetes' - elif 'managedclusters' == cluster_type.lower(): + elif cluster_type.lower() == 'managedclusters': cluster_rp = 'Microsoft.ContainerService' else: raise CLIError("Invalid cluster-type. Supported values are 'connectedClusters' and 'managedClusters'.") if configuration_type.lower() != 'sourcecontrolconfiguration': raise CLIError('Invalid configuration_type. Valid value is "sourceControlConfiguration"') - else: - source_control_configuration_name = name + + source_control_configuration_name = name custom_headers = {"x-ms-force": "true"} diff --git a/src/k8sconfiguration/azext_k8sconfiguration/tests/__init__.py b/src/k8sconfiguration/azext_k8sconfiguration/tests/__init__.py index 2dcf9bb68b3..99c0f28cd71 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/tests/__init__.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/tests/__init__.py @@ -2,4 +2,4 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. -# ----------------------------------------------------------------------------- \ No newline at end of file +# ----------------------------------------------------------------------------- diff --git a/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/__init__.py b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/__init__.py index 2dcf9bb68b3..99c0f28cd71 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/__init__.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/__init__.py @@ -2,4 +2,4 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. -# ----------------------------------------------------------------------------- \ No newline at end of file +# ----------------------------------------------------------------------------- From 655f5a7dd2851fca8e2d592b415c6076af48c4b5 Mon Sep 17 00:00:00 2001 From: nanthi Date: Thu, 16 Apr 2020 17:44:20 -0700 Subject: [PATCH 03/20] Added Scenario test and addressed review comments --- .../azext_k8sconfiguration/_client_factory.py | 2 + .../azext_k8sconfiguration/_params.py | 2 +- .../azext_k8sconfiguration/commands.py | 3 - .../azext_k8sconfiguration/custom.py | 5 + .../recordings/test_k8sconfiguration.yaml | 360 ++++++++++++++++++ .../test_kubernetesconfiguration_scenario.py | 94 ++--- 6 files changed, 417 insertions(+), 49 deletions(-) create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/tests/latest/recordings/test_k8sconfiguration.yaml diff --git a/src/k8sconfiguration/azext_k8sconfiguration/_client_factory.py b/src/k8sconfiguration/azext_k8sconfiguration/_client_factory.py index 3bd47114316..f853563686b 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/_client_factory.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/_client_factory.py @@ -3,11 +3,13 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- + def cf_k8sconfiguration(cli_ctx, *_): from azure.cli.core.commands.client_factory import get_mgmt_service_client from azext_k8sconfiguration.vendored_sdks import SourceControlConfigurationClient return get_mgmt_service_client(cli_ctx, SourceControlConfigurationClient) + def cf_k8sconfiguration_operation(cli_ctx, _): return cf_k8sconfiguration(cli_ctx).source_control_configurations diff --git a/src/k8sconfiguration/azext_k8sconfiguration/_params.py b/src/k8sconfiguration/azext_k8sconfiguration/_params.py index 5a493de0f51..3c52bd8deb9 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/_params.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/_params.py @@ -14,8 +14,8 @@ from azure.cli.core.commands.validators import get_default_location_from_resource_group -def load_arguments(self, _): +def load_arguments(self, _): #sourcecontrolconfiguration_type = CLIArgumentType(options_list='--sourcecontrolconfiguration-name', # help='Name of the K8sconfiguration.', id_part='name') sourcecontrolconfiguration_type = CLIArgumentType(help='Name of the K8sconfiguration.') diff --git a/src/k8sconfiguration/azext_k8sconfiguration/commands.py b/src/k8sconfiguration/azext_k8sconfiguration/commands.py index 31c615b048a..2486c18477c 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/commands.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/commands.py @@ -14,7 +14,6 @@ def load_command_table(self, _): operations_tmpl='azext_k8sconfiguration.vendored_sdks.operations#SourceControlConfigurationsOperations.{}', client_factory=cf_k8sconfiguration) - with self.command_group('k8sconfiguration', k8sconfiguration_sdk, client_factory=cf_k8sconfiguration_operation) \ as g: g.custom_command('create', 'create_k8sconfiguration') @@ -22,8 +21,6 @@ def load_command_table(self, _): g.custom_command('delete', 'delete_k8sconfiguration') g.custom_command('list', 'list_k8sconfiguration') g.custom_command('show', 'show_k8sconfiguration') - #g.generic_update_command('update', setter_name='update', custom_func_name='update_k8sconfiguration') - with self.command_group('k8sconfiguration', is_preview=True): pass diff --git a/src/k8sconfiguration/azext_k8sconfiguration/custom.py b/src/k8sconfiguration/azext_k8sconfiguration/custom.py index 10995ae9d3c..531dcf33f36 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/custom.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/custom.py @@ -8,6 +8,7 @@ from azext_k8sconfiguration.vendored_sdks.models.source_control_configuration_py3 import SourceControlConfiguration from azext_k8sconfiguration.vendored_sdks.models.helm_operator_properties import HelmOperatorProperties + def show_k8sconfiguration(client, resource_group_name, cluster_name, name, cluster_type='connectedClusters', configuration_type='sourceControlConfiguration', api_version='2019-11-01-preview'): # Determine ClusterRP @@ -31,6 +32,7 @@ def show_k8sconfiguration(client, resource_group_name, cluster_name, name, clust return client.get(resource_group_name, cluster_rp, cluster_type, cluster_name, source_control_configuration_name, api_version) + def create_k8sconfiguration(client, resource_group_name, cluster_name, name, repository_url, operator_instance_name=None, operator_namespace='default', cluster_type='connectedClusters', configuration_type='sourceControlConfiguration', operator_params='', cluster_scoped=None, @@ -86,6 +88,7 @@ def create_k8sconfiguration(client, resource_group_name, cluster_name, name, rep return client.create_or_update(resource_group_name, cluster_rp, cluster_type, cluster_name, source_control_configuration_name, api_version, source_control_configuration) + def update_k8sconfiguration(client, resource_group_name, cluster_name, name, configuration_type='sourceControlConfiguration', cluster_type='connectedClusters', repository_url=None, operator_params=None, enable_helm_operator=None, @@ -140,6 +143,7 @@ def update_k8sconfiguration(client, resource_group_name, cluster_name, name, return client.create_or_update(resource_group_name, cluster_rp, cluster_type, cluster_name, source_control_configuration_name, api_version, config) + def list_k8sconfiguration(client, resource_group_name, cluster_name, cluster_type='connectedClusters', api_version='2019-11-01-preview'): if cluster_type.lower() == 'connectedclusters': @@ -151,6 +155,7 @@ def list_k8sconfiguration(client, resource_group_name, cluster_name, cluster_typ return client.list(resource_group_name, cluster_rp, cluster_type, cluster_name, api_version) + def delete_k8sconfiguration(client, resource_group_name, cluster_name, name, cluster_type='connectedClusters', configuration_type='sourceControlConfiguration', api_version='2019-11-01-preview'): if cluster_type.lower() == 'connectedclusters': diff --git a/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/recordings/test_k8sconfiguration.yaml b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/recordings/test_k8sconfiguration.yaml new file mode 100644 index 00000000000..dc466cb18f4 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/recordings/test_k8sconfiguration.yaml @@ -0,0 +1,360 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - k8sconfiguration list + Connection: + - keep-alive + ParameterSetName: + - -g --cluster-name + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 + azure-mgmt-k8sconfiguration/2019-11-01-preview Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations?api-version=2019-11-01-preview + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0406a","name":"config0406a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0406a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0406a/flux-get-started","operatorInstanceName":"config0406a-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403d","name":"config0403d","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403d-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0403d/flux-get-started","operatorInstanceName":"config0403d-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403c","name":"config0403c","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403c-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0403c/flux-get-started","operatorInstanceName":"config0403c-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403b","name":"config0403b","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403b-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0403b/flux-get-started","operatorInstanceName":"config0403b-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403a","name":"config0403a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/config0403a/flux-get-started","operatorInstanceName":"config0403a-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config323a","name":"config323a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config323-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/testurl","operatorInstanceName":"config323-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config226a","name":"config226a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config226a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"''--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system''"},"repositoryUrl":"git://github.com/config226a/flux-get-started","operatorInstanceName":"config226a-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0220a","name":"cfg0220a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"default","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":""},"repositoryUrl":"git://github.com/slack/cluster-config.git","operatorInstanceName":"cfg0220a","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0219a","name":"cfg0219a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cfg0219a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cfg0219a-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"--git-readonly + ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0207i","name":"cfg0207i","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"default","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cfg0219a-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"--git-readonly + ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0207g","name":"cfg0207g","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cfg0207g-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/cfg0207g/flux-get-started","operatorInstanceName":"cfg0207g-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/testconfig0207c","name":"testconfig0207c","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"testconfig0207c-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"repositoryUrl":"git://github.com/testconfig0207c/flux-get-started","operatorInstanceName":"testconfig0207c-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/testconfig0207b","name":"testconfig0207b","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"testconfig0207b-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"repositoryUrl":"git://github.com/testconfig0207b/flux-get-started","operatorInstanceName":"testconfig0207b-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}}],"nextLink":null}' + headers: + api-supported-versions: + - 2019-11-01-Preview + cache-control: + - no-cache + content-length: + - '13097' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 17 Apr 2020 00:28:12 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - openresty/1.15.8.2 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"repositoryUrl": "git://github.com/anubhav929/flux-get-started", + "operatorNamespace": "cliTestConfig0416A-opns", "operatorInstanceName": "cliTestconfig0416A-opin", + "operatorType": "flux", "operatorParams": "--git-readonly ", "operatorScope": + "namespace", "enableHelmOperator": "True", "helmOperatorProperties": {"chartVersion": + "0.6.0", "chartValues": "--set git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - k8sconfiguration create + Connection: + - keep-alive + Content-Length: + - '447' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -c -u --operator-instance-name --operator-namespace --operator-params + --git-readonly --enable-helm-operator --helm-operator-version --helm-operator-params + --set git.ssh.secretName + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 + azure-mgmt-k8sconfiguration/2019-11-01-preview Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0416A?api-version=2019-11-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0416A","name":"cliTestConfig0416A","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cliTestConfig0416A-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cliTestconfig0416A-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly + ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}}' + headers: + api-supported-versions: + - 2019-11-01-Preview + cache-control: + - no-cache + content-length: + - '1101' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 17 Apr 2020 00:28:14 GMT + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0416A + pragma: + - no-cache + server: + - openresty/1.15.8.2 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - k8sconfiguration list + Connection: + - keep-alive + ParameterSetName: + - -g --cluster-name + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 + azure-mgmt-k8sconfiguration/2019-11-01-preview Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations?api-version=2019-11-01-preview + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/clitestconfig0416a","name":"clitestconfig0416a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cliTestConfig0416A-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cliTestconfig0416A-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly + ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0406a","name":"config0406a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0406a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0406a/flux-get-started","operatorInstanceName":"config0406a-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403d","name":"config0403d","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403d-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0403d/flux-get-started","operatorInstanceName":"config0403d-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403c","name":"config0403c","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403c-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0403c/flux-get-started","operatorInstanceName":"config0403c-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403b","name":"config0403b","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403b-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0403b/flux-get-started","operatorInstanceName":"config0403b-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403a","name":"config0403a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/config0403a/flux-get-started","operatorInstanceName":"config0403a-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config323a","name":"config323a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config323-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/testurl","operatorInstanceName":"config323-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config226a","name":"config226a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config226a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"''--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system''"},"repositoryUrl":"git://github.com/config226a/flux-get-started","operatorInstanceName":"config226a-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0220a","name":"cfg0220a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"default","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":""},"repositoryUrl":"git://github.com/slack/cluster-config.git","operatorInstanceName":"cfg0220a","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0219a","name":"cfg0219a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cfg0219a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cfg0219a-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"--git-readonly + ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0207i","name":"cfg0207i","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"default","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cfg0219a-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"--git-readonly + ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0207g","name":"cfg0207g","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cfg0207g-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/cfg0207g/flux-get-started","operatorInstanceName":"cfg0207g-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/testconfig0207c","name":"testconfig0207c","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"testconfig0207c-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"repositoryUrl":"git://github.com/testconfig0207c/flux-get-started","operatorInstanceName":"testconfig0207c-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/testconfig0207b","name":"testconfig0207b","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"testconfig0207b-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"repositoryUrl":"git://github.com/testconfig0207b/flux-get-started","operatorInstanceName":"testconfig0207b-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}}],"nextLink":null}' + headers: + api-supported-versions: + - 2019-11-01-Preview + cache-control: + - no-cache + content-length: + - '14199' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 17 Apr 2020 00:28:15 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - openresty/1.15.8.2 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - k8sconfiguration show + Connection: + - keep-alive + ParameterSetName: + - -g -c -n + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 + azure-mgmt-k8sconfiguration/2019-11-01-preview Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0416A?api-version=2019-11-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0416A","name":"cliTestConfig0416A","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cliTestConfig0416A-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cliTestconfig0416A-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly + ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}}' + headers: + api-supported-versions: + - 2019-11-01-Preview + cache-control: + - no-cache + content-length: + - '1101' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 17 Apr 2020 00:28:17 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - openresty/1.15.8.2 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - k8sconfiguration delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -c -n + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 + azure-mgmt-k8sconfiguration/2019-11-01-preview Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + x-ms-force: + - 'true' + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0416A?api-version=2019-11-01-preview + response: + body: + string: '{"version":"1.1","content":null,"statusCode":200,"reasonPhrase":"OK","headers":[],"trailingHeaders":[],"requestMessage":null,"isSuccessStatusCode":true}' + headers: + api-supported-versions: + - 2019-11-01-Preview + cache-control: + - no-cache + content-length: + - '152' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 17 Apr 2020 00:28:18 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - openresty/1.15.8.2 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - k8sconfiguration list + Connection: + - keep-alive + ParameterSetName: + - -g --cluster-name + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 + azure-mgmt-k8sconfiguration/2019-11-01-preview Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations?api-version=2019-11-01-preview + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0406a","name":"config0406a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0406a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0406a/flux-get-started","operatorInstanceName":"config0406a-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403d","name":"config0403d","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403d-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0403d/flux-get-started","operatorInstanceName":"config0403d-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403c","name":"config0403c","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403c-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0403c/flux-get-started","operatorInstanceName":"config0403c-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403b","name":"config0403b","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403b-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0403b/flux-get-started","operatorInstanceName":"config0403b-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403a","name":"config0403a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/config0403a/flux-get-started","operatorInstanceName":"config0403a-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config323a","name":"config323a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config323-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/testurl","operatorInstanceName":"config323-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config226a","name":"config226a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config226a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"''--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system''"},"repositoryUrl":"git://github.com/config226a/flux-get-started","operatorInstanceName":"config226a-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0220a","name":"cfg0220a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"default","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":""},"repositoryUrl":"git://github.com/slack/cluster-config.git","operatorInstanceName":"cfg0220a","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0219a","name":"cfg0219a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cfg0219a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cfg0219a-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"--git-readonly + ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0207i","name":"cfg0207i","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"default","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cfg0219a-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"--git-readonly + ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0207g","name":"cfg0207g","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cfg0207g-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/cfg0207g/flux-get-started","operatorInstanceName":"cfg0207g-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/testconfig0207c","name":"testconfig0207c","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"testconfig0207c-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"repositoryUrl":"git://github.com/testconfig0207c/flux-get-started","operatorInstanceName":"testconfig0207c-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/testconfig0207b","name":"testconfig0207b","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"testconfig0207b-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"repositoryUrl":"git://github.com/testconfig0207b/flux-get-started","operatorInstanceName":"testconfig0207b-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}}],"nextLink":null}' + headers: + api-supported-versions: + - 2019-11-01-Preview + cache-control: + - no-cache + content-length: + - '13097' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 17 Apr 2020 00:28:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - openresty/1.15.8.2 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py index d348c5212ab..d8b9f1e81b1 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py @@ -9,7 +9,6 @@ from azure_devtools.scenario_tests import AllowLargeResponse from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer, record_only) - TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) @@ -17,55 +16,60 @@ class K8sconfigurationScenarioTest(ScenarioTest): @ResourceGroupPreparer(name_prefix='cli_test_k8sconfiguration') @record_only() - def test_k8sconfiguration(self, resource_group): - - # self.kwargs.update({ - # 'name': 'azCliTest-testinghelminstallation-0108c', - # 'clusterName': 'testinghelminstallation', - # 'rg': 'haikudevtesting', - # 'repoUrl': 'git://github.com/anubhav929/flux-get-started', - # 'opInstanceName': 'azCliTest-testinghelminstallation-opInst', - # 'opNamespace': 'azCliTest-testinghelminstallation-opNS' - # }) - + def test_k8sconfiguration(self): self.kwargs.update({ - 'name': 'config225a', + 'name': 'cliTestConfig0416A', 'clusterName': 'matrived-tpcomi', 'rg': 'haikudevtesting', 'repoUrl': 'git://github.com/anubhav929/flux-get-started', - 'opInstanceName': 'config225a-opin', - 'opNamespace': 'config225a-opnsnew' + 'opInstanceName': 'cliTestconfig0416A-opin', + 'opNamespace': 'cliTestConfig0416A-opns' }) - count = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {clusterName}').get_output_in_json()) - self.greater_than(count, 7) - self.cmd(''' k8sconfiguration create -g {rg} - -n {name} - -c {clusterName} - -u {repoUrl} - --operator-instance-name {opInstanceName} - --operator-namespace {opNamespace} + # List Configurations and get the count + configCount = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {clusterName}').get_output_in_json()) + self.greater_than(configCount, 10) + + # Create a configuration + self.cmd(''' k8sconfiguration create -g {rg} + -n {name} + -c {clusterName} + -u {repoUrl} + --operator-instance-name {opInstanceName} + --operator-namespace {opNamespace} --operator-params \"--git-readonly \" - --enable-helm-operator - --helm-operator-chart-version 0.2.0 - --helm-operator-chart-values \"--set git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system\" ''', - checks=[ - self.check('name', '{name}'), - self.check('resourceGroup', '{rg}'), - self.check('operatorInstanceName', '{opInstanceName}'), - self.check('operatorNamespace', '{opNamespace}'), - self.check('provisioningState', 'Succeeded'), - self.check('operatorScope', 'cluster'), - self.check('operatorType', 'Flux'), - ]) + --enable-helm-operator + --helm-operator-version 0.6.0 + --helm-operator-params \"--set git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system\" ''', + checks=[ + self.check('name', '{name}'), + self.check('resourceGroup', '{rg}'), + self.check('operatorInstanceName', '{opInstanceName}'), + self.check('operatorNamespace', '{opNamespace}'), + self.check('provisioningState', 'Succeeded'), + self.check('operatorScope', 'namespace'), + self.check('operatorType', 'Flux') + ]) + + # List the configurations again to see if we have one additional + newCount = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {clusterName}').get_output_in_json()) + self.assertEqual(newCount, configCount + 1) + + # Get the configuration created + self.cmd('k8sconfiguration show -g {rg} -c {clusterName} -n {name}', + checks=[ + self.check('name', '{name}'), + self.check('resourceGroup', '{rg}'), + self.check('operatorInstanceName', '{opInstanceName}'), + self.check('operatorNamespace', '{opNamespace}'), + self.check('provisioningState', 'Succeeded'), + self.check('operatorScope', 'namespace'), + self.check('operatorType', 'Flux') + ]) + + # Delete the created configuration + self.cmd('k8sconfiguration delete -g {rg} -c {clusterName} -n {name}') - # count = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {clusterName}').get_output_in_json()) - # self.cmd('k8sconfiguration show -g {rg} --cluster-name {clusterName} --name {name}', checks=[ - # self.check('name', '{name}'), - # self.check('resourceGroup', '{rg}'), - # self.check('tags.foo', 'None') - # ]) - # - # self.cmd('k8sconfiguration delete -g {rg} --cluster-name {clusterName} --name {name}') - # final_count = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {clusterName}').get_output_in_json()) - # self.assertTrue(final_count, count - 1) \ No newline at end of file + # List Configurations and confirm the count is the same as we started + newCount = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {clusterName}').get_output_in_json()) + self.assertEqual(newCount, configCount) From bb88d052f80c448f2e45a134e9a2da9d69d70c45 Mon Sep 17 00:00:00 2001 From: nanthi Date: Thu, 16 Apr 2020 17:52:06 -0700 Subject: [PATCH 04/20] Address review comments --- src/k8sconfiguration/azext_k8sconfiguration/_params.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/_params.py b/src/k8sconfiguration/azext_k8sconfiguration/_params.py index 3c52bd8deb9..c57633a7a3f 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/_params.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/_params.py @@ -16,7 +16,7 @@ def load_arguments(self, _): - #sourcecontrolconfiguration_type = CLIArgumentType(options_list='--sourcecontrolconfiguration-name', + # sourcecontrolconfiguration_type = CLIArgumentType(options_list='--sourcecontrolconfiguration-name', # help='Name of the K8sconfiguration.', id_part='name') sourcecontrolconfiguration_type = CLIArgumentType(help='Name of the K8sconfiguration.') From 2e06439dec54dee47bfa69f23fd44e0f1c58c648 Mon Sep 17 00:00:00 2001 From: nanthi Date: Mon, 20 Apr 2020 08:44:18 -0700 Subject: [PATCH 05/20] Added to CodeOwners and other fixes --- .github/CODEOWNERS | 2 + src/k8sconfiguration/README.rst | 71 +++++++++- .../azext_k8sconfiguration/_help.py | 30 ++++ .../azext_k8sconfiguration/_params.py | 22 ++- .../azext_k8sconfiguration/_validators.py | 14 +- .../azext_k8sconfiguration/commands.py | 6 +- .../azext_k8sconfiguration/custom.py | 132 +++++++----------- .../test_kubernetesconfiguration_scenario.py | 40 +++--- src/k8sconfiguration/setup.py | 4 +- 9 files changed, 194 insertions(+), 127 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 32e84fd2084..462438faaa9 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -97,3 +97,5 @@ /src/databox/ @jsntcy /src/hpc-cache/ @qianwens + +/src/k8sconfiguration/ @NarayanThiru \ No newline at end of file diff --git a/src/k8sconfiguration/README.rst b/src/k8sconfiguration/README.rst index edff60e977e..8bdd3fb3e12 100644 --- a/src/k8sconfiguration/README.rst +++ b/src/k8sconfiguration/README.rst @@ -2,4 +2,73 @@ Microsoft Azure CLI 'k8sconfiguration' Extension ========================================== This package is for the 'k8sconfiguration' extension. -i.e. 'az k8sconfiguration' \ No newline at end of file +i.e. 'az k8sconfiguration' + +### How to use ### +Install this extension using the below CLI command +``` +az extension add --name k8sconfiguration +``` + +### Included Features +#### Kubernetes Configuration: +Kubernetes SourceControl Configuration: [more info](https://docs.microsoft.com/en-us/azure/kubernetessconfiguration/)\ +*Examples:* + +##### Create a KubernetesConfiguration +``` +az k8sconfiguration create \ + --resource-group groupName \ + --cluster-name clusterName \ + --cluster-type clusterType \ + --name configurationName \ + --operator-instance-name operatorInstanceName \ + --operator-namespace operatorNamespace \ + --repository-url githubRepoUrl \ + --operator-params operatorParameters \ + --enable-helm-operator \ + --helm-operator-version chartVersion \ + --helm-operator-params chartParameters +``` + +##### Get a KubernetesConfiguration +``` +az k8sconfiguration show \ + --resource-group groupName \ + --cluster-name clusterName \ + --cluster-type clusterType \ + --name configurationName +``` + +##### Delete a KubernetesConfiguration +``` +az k8sconfiguration delete \ + --resource-group groupName \ + --cluster-name clusterName \ + --cluster-type clusterType \ + --name configurationName +``` + +##### Update a KubernetesConfiguration +``` +az k8sconfiguration create \ + --resource-group groupName \ + --cluster-name clusterName \ + --cluster-type clusterType \ + --name configurationName \ + --repository-url githubRepoUrl \ + --operator-params operatorParameters \ + --enable-helm-operator \ + --helm-operator-version chartVersion \ + --helm-operator-params chartParameters +``` + +##### List all KubernetesConfigurations of a cluster +``` +az k8sconfiguration list \ + --resource-group groupName \ + --cluster-name clusterName \ + --cluster-type clusterType +``` + +If you have issues, please give feedback by opening an issue at https://github.com/Azure/azure-cli-extensions/issues. \ No newline at end of file diff --git a/src/k8sconfiguration/azext_k8sconfiguration/_help.py b/src/k8sconfiguration/azext_k8sconfiguration/_help.py index 20bc0900f63..5526003cfe0 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/_help.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/_help.py @@ -15,24 +15,54 @@ helps['k8sconfiguration create'] = """ type: command short-summary: Create a K8sconfiguration. + examples: + - name: Create a k8sconfiguration + text: |- + az k8sconfiguration create --resource-group MyResourceGroup --cluster-name MyClusterName \\ + --cluster-type 'connectedClusters' --name MyConfigurationName --operator-instance-name OperatorInst01 \\ + --operator-namespace OperatorNamespace01 --repository-url git://github.com/fluxHowTo/flux-get-started \\ + --operator-params "'--git-readonly'" --enable-helm-operator --helm-operator-version 0.6.0 \\ + --helm-operator-params '--set helm.versions=v3' """ helps['k8sconfiguration list'] = """ type: command short-summary: List K8sconfigurations. + examples: + - name: List all k8sconfigurations of a cluster + text: |- + az k8sconfiguration list --resource-group MyResourceGroup --cluster-name MyClusterName \\ + --cluster-type 'connectedClusters' """ helps['k8sconfiguration delete'] = """ type: command short-summary: Delete a K8sconfiguration. + examples: + - name: Delete a k8sconfiguration + text: |- + az k8sconfiguration delete --resource-group MyResourceGroup --cluster-name MyClusterName \\ + --cluster-type 'connectedClusters' --name MyConfigurationName """ helps['k8sconfiguration show'] = """ type: command short-summary: Show details of a K8sconfiguration. + examples: + - name: Show a k8sconfiguration + text: |- + az k8sconfiguration show --resource-group MyResourceGroup --cluster-name MyClusterName \\ + --cluster-type 'connectedClusters' --name MyConfigurationName """ helps['k8sconfiguration update'] = """ type: command short-summary: Update a K8sconfiguration. + examples: + - name: Update an existing k8sconfiguration + text: |- + az k8sconfiguration update --resource-group MyResourceGroup --cluster-name MyClusterName \\ + --cluster-type 'connectedClusters' --name MyConfigurationName --enable-helm-operator \\ + --repository-url git://github.com/fluxHowTo/flux-get-started --operator-params "'--git-readonly'" \\ + --helm-operator-version 0.6.0 --helm-operator-params '--set helm.versions=v3' """ diff --git a/src/k8sconfiguration/azext_k8sconfiguration/_params.py b/src/k8sconfiguration/azext_k8sconfiguration/_params.py index c57633a7a3f..a365845c99b 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/_params.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/_params.py @@ -13,11 +13,10 @@ ) from azure.cli.core.commands.validators import get_default_location_from_resource_group +from ._validators import validate_configuration_type def load_arguments(self, _): - # sourcecontrolconfiguration_type = CLIArgumentType(options_list='--sourcecontrolconfiguration-name', - # help='Name of the K8sconfiguration.', id_part='name') sourcecontrolconfiguration_type = CLIArgumentType(help='Name of the K8sconfiguration.') with self.argument_context('k8sconfiguration') as c: @@ -32,7 +31,24 @@ def load_arguments(self, _): c.argument('enable_helm_operator', arg_type=get_three_state_flag(), help='Enable support for Helm chart deployments') c.argument('cluster_scoped', action='store_true', - help='''Optional switch to set the scope of the operator to be cluster. Default scope is 'namespace' ''') + help='''Optional switch to set scope of the operator to be cluster. Default scope is 'namespace'.''') + c.argument('configuration_type', validator=validate_configuration_type, + arg_type=get_enum_type(['sourceControlConfiguration']), + help='Type of the configuration') + c.argument('helm_operator_params', + help='Optional. Chart values for the Helm Operator (if enabled)') + c.argument('helm_operator_version', + help='''Optional. Chart version of the Helm Operator, if enabled. Default:'0.2.0'.''') + c.argument('operator_params', + help='Optional. Parameters for the Operator.') + c.argument('operator_instance_name', + help='Instance name of the Operator.') + c.argument('operator_namespace', + help='Namespace in which to install the Operator.') + c.argument('operator_type', + help='''Optional. Type of the operator. Valid value is 'flux'.''') + c.argument('', + help='') with self.argument_context('k8sconfiguration list') as c: c.argument('sourcecontrolconfiguration', sourcecontrolconfiguration_type, id_part=None) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/_validators.py b/src/k8sconfiguration/azext_k8sconfiguration/_validators.py index 72c987a3c3a..37ac32bfb01 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/_validators.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/_validators.py @@ -23,16 +23,6 @@ def example_name_or_id_validator(cmd, namespace): ) -def validate_configuration_type(namespace): - if namespace.configuration_type.lower() != 'sourcecontrolconfiguration': +def validate_configuration_type(configuration_type): + if configuration_type.lower() != 'sourcecontrolconfiguration': raise CLIError('Invalid configuration-type. Valid value is "sourceControlConfiguration"') - - -def validate_operator_scope(namespace): - if namespace.cluster_scoped: - namespace.operator_scope = 'cluster' - else: - # Operator Namespace is mandatory if the Operator Scope is 'namespace' - if namespace.operator_namespace.string() is None: - raise CLIError('Invalid operator-namespace. Namespace is mandatory if the scope is "namespace"') - namespace.operator_scope = 'namespace' diff --git a/src/k8sconfiguration/azext_k8sconfiguration/commands.py b/src/k8sconfiguration/azext_k8sconfiguration/commands.py index 2486c18477c..3fe569acd4f 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/commands.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/commands.py @@ -14,13 +14,11 @@ def load_command_table(self, _): operations_tmpl='azext_k8sconfiguration.vendored_sdks.operations#SourceControlConfigurationsOperations.{}', client_factory=cf_k8sconfiguration) - with self.command_group('k8sconfiguration', k8sconfiguration_sdk, client_factory=cf_k8sconfiguration_operation) \ + with self.command_group('k8sconfiguration', k8sconfiguration_sdk, client_factory=cf_k8sconfiguration_operation, + is_preview=True) \ as g: g.custom_command('create', 'create_k8sconfiguration') g.custom_command('update', 'update_k8sconfiguration') g.custom_command('delete', 'delete_k8sconfiguration') g.custom_command('list', 'list_k8sconfiguration') g.custom_command('show', 'show_k8sconfiguration') - - with self.command_group('k8sconfiguration', is_preview=True): - pass diff --git a/src/k8sconfiguration/azext_k8sconfiguration/custom.py b/src/k8sconfiguration/azext_k8sconfiguration/custom.py index 531dcf33f36..23264c7aa3e 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/custom.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/custom.py @@ -9,52 +9,27 @@ from azext_k8sconfiguration.vendored_sdks.models.helm_operator_properties import HelmOperatorProperties -def show_k8sconfiguration(client, resource_group_name, cluster_name, name, cluster_type='connectedClusters', - configuration_type='sourceControlConfiguration', api_version='2019-11-01-preview'): - # Determine ClusterRP - if cluster_type.lower() == 'connectedclusters': - cluster_rp = 'Microsoft.Kubernetes' - elif cluster_type.lower() == 'managedclusters': - cluster_rp = 'Microsoft.ContainerService' - else: - raise CLIError("Invalid cluster-type. Supported values are 'connectedClusters' and 'managedClusters'.") +def show_k8sconfiguration(client, resource_group_name, cluster_name, name, cluster_type='connectedClusters'): + """Get an existing Kubernetes Source Control Configuration. - # Validate ConfigurationType - if configuration_type.lower() != 'sourcecontrolconfiguration': - raise CLIError('Invalid configuration_type. Valid value is "sourceControlConfiguration"') + """ + # Determine ClusterRP + cluster_rp = __get_cluster_type(cluster_type) source_control_configuration_name = name - # Ensure apiVersion value - if api_version is None: - api_version = client.api_version - - return client.get(resource_group_name, cluster_rp, cluster_type, cluster_name, source_control_configuration_name, - api_version) + return client.get(resource_group_name, cluster_rp, cluster_type, cluster_name, source_control_configuration_name) def create_k8sconfiguration(client, resource_group_name, cluster_name, name, repository_url, operator_instance_name=None, operator_namespace='default', cluster_type='connectedClusters', - configuration_type='sourceControlConfiguration', operator_params='', cluster_scoped=None, - operator_type='flux', enable_helm_operator=None, helm_operator_version='0.2.0', - helm_operator_params='', api_version='2019-11-01-preview'): - # Determine ClusterRP - if cluster_type.lower() == 'connectedclusters': - cluster_rp = 'Microsoft.Kubernetes' - elif cluster_type.lower() == 'managedclusters': - cluster_rp = 'Microsoft.ContainerService' - else: - raise CLIError("Invalid cluster-type. Supported values are 'connectedClusters' and 'managedClusters'.") - - # Validate configurationType - if configuration_type.lower() != 'sourcecontrolconfiguration': - raise CLIError('Invalid configuration_type. Valid value is "sourceControlConfiguration"') - - source_control_configuration_name = name.strip() + operator_params='', cluster_scoped=None, operator_type='flux', enable_helm_operator=None, + helm_operator_version='0.2.0', helm_operator_params=''): + """Create a new Kubernetes Source Control Configuration. - # Ensure apiVersion value - if api_version is None: - api_version = client.api_version + """ + # Determine ClusterRP + cluster_rp = __get_cluster_type(cluster_type) # Determine operatorScope operator_scope = '' @@ -63,7 +38,7 @@ def create_k8sconfiguration(client, resource_group_name, cluster_name, name, rep # Determine operatorInstanceName if operator_instance_name is None: - operator_instance_name = source_control_configuration_name + operator_instance_name = name # Create helmOperatorProperties object helm_operator_properties = HelmOperatorProperties() @@ -86,91 +61,78 @@ def create_k8sconfiguration(client, resource_group_name, cluster_name, name, rep # Try to create the resource return client.create_or_update(resource_group_name, cluster_rp, cluster_type, cluster_name, - source_control_configuration_name, api_version, source_control_configuration) + name, source_control_configuration) -def update_k8sconfiguration(client, resource_group_name, cluster_name, name, - configuration_type='sourceControlConfiguration', cluster_type='connectedClusters', +def update_k8sconfiguration(client, resource_group_name, cluster_name, name, cluster_type='connectedClusters', repository_url=None, operator_params=None, enable_helm_operator=None, - helm_operator_version=None, helm_operator_params=None, api_version='2019-11-01-preview'): + helm_operator_version=None, helm_operator_params=None): + """Create a new Kubernetes Source Control Configuration. + + """ # Determine ClusterRP - if cluster_type.lower() == 'connectedclusters': - cluster_rp = 'Microsoft.Kubernetes' - elif cluster_type.lower() == 'managedclusters': - cluster_rp = 'Microsoft.ContainerService' - else: - raise CLIError("Invalid cluster-type. Supported values are 'connectedClusters' and 'managedClusters'.") + cluster_rp = __get_cluster_type(cluster_type) - # Validate configurationType - if configuration_type.lower() != 'sourcecontrolconfiguration': - raise CLIError('Invalid configuration_type. Valid value is "sourceControlConfiguration"') source_control_configuration_name = name.strip() - # Ensure apiVersion value - if api_version is None: - api_version = client.api_version - config = client.get(resource_group_name, cluster_rp, cluster_type, cluster_name, - source_control_configuration_name, api_version).as_dict() + source_control_configuration_name).as_dict() - updateYes = False + update_yes = False # Set input values, if they are supplied if repository_url is not None: config['repository_url'] = repository_url - updateYes = True + update_yes = True if operator_params is not None: config['operator_params'] = operator_params - updateYes = True + update_yes = True if enable_helm_operator is not None: config['enable_helm_operator'] = enable_helm_operator - updateYes = True + update_yes = True if helm_operator_version is not None: config['helm_operator_version'] = helm_operator_version - updateYes = True + update_yes = True if helm_operator_params is not None: config['helm_operator_params'] = helm_operator_params - updateYes = True + update_yes = True - if updateYes is False: + if update_yes is False: raise CLIError('Invalid update. No values to update!') return client.create_or_update(resource_group_name, cluster_rp, cluster_type, cluster_name, - source_control_configuration_name, api_version, config) + source_control_configuration_name, config) -def list_k8sconfiguration(client, resource_group_name, cluster_name, cluster_type='connectedClusters', - api_version='2019-11-01-preview'): - if cluster_type.lower() == 'connectedclusters': - cluster_rp = 'Microsoft.Kubernetes' - elif cluster_type.lower() == 'managedclusters': - cluster_rp = 'Microsoft.ContainerService' - else: - raise CLIError("Invalid cluster-type. Supported values are 'connectedClusters' and 'managedClusters'.") +def list_k8sconfiguration(client, resource_group_name, cluster_name, cluster_type='connectedClusters'): + cluster_rp = __get_cluster_type(cluster_type) + return client.list(resource_group_name, cluster_rp, cluster_type, cluster_name) - return client.list(resource_group_name, cluster_rp, cluster_type, cluster_name, api_version) +def delete_k8sconfiguration(client, resource_group_name, cluster_name, name, cluster_type='connectedClusters'): + """Delete an existing Kubernetes Source Control Configuration. -def delete_k8sconfiguration(client, resource_group_name, cluster_name, name, cluster_type='connectedClusters', - configuration_type='sourceControlConfiguration', api_version='2019-11-01-preview'): - if cluster_type.lower() == 'connectedclusters': - cluster_rp = 'Microsoft.Kubernetes' - elif cluster_type.lower() == 'managedclusters': - cluster_rp = 'Microsoft.ContainerService' - else: - raise CLIError("Invalid cluster-type. Supported values are 'connectedClusters' and 'managedClusters'.") - - if configuration_type.lower() != 'sourcecontrolconfiguration': - raise CLIError('Invalid configuration_type. Valid value is "sourceControlConfiguration"') + """ + # Determine ClusterRP + cluster_rp = __get_cluster_type(cluster_type) source_control_configuration_name = name custom_headers = {"x-ms-force": "true"} return client.delete(resource_group_name, cluster_rp, cluster_type, cluster_name, source_control_configuration_name, - api_version, custom_headers) + custom_headers) + + +def __get_cluster_type(cluster_type): + if cluster_type.lower() == 'connectedclusters': + return 'Microsoft.Kubernetes' + elif cluster_type.lower() == 'managedclusters': + return 'Microsoft.ContainerService' + else: + raise CLIError("Invalid cluster-type. Supported values are 'connectedClusters' and 'managedClusters'.") diff --git a/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py index d8b9f1e81b1..ec756010d62 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py @@ -19,24 +19,24 @@ class K8sconfigurationScenarioTest(ScenarioTest): def test_k8sconfiguration(self): self.kwargs.update({ 'name': 'cliTestConfig0416A', - 'clusterName': 'matrived-tpcomi', + 'cluster_name': 'matrived-tpcomi', 'rg': 'haikudevtesting', - 'repoUrl': 'git://github.com/anubhav929/flux-get-started', - 'opInstanceName': 'cliTestconfig0416A-opin', - 'opNamespace': 'cliTestConfig0416A-opns' + 'repo_url': 'git://github.com/anubhav929/flux-get-started', + 'operator_instance_name': 'cliTestconfig0416A-opin', + 'operator_namespace': 'cliTestConfig0416A-opns' }) # List Configurations and get the count - configCount = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {clusterName}').get_output_in_json()) - self.greater_than(configCount, 10) + config_count = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {cluster_name}').get_output_in_json()) + self.greater_than(config_count, 10) # Create a configuration self.cmd(''' k8sconfiguration create -g {rg} -n {name} - -c {clusterName} - -u {repoUrl} - --operator-instance-name {opInstanceName} - --operator-namespace {opNamespace} + -c {cluster_name} + -u {repo_url} + --operator-instance-name {operator_instance_name} + --operator-namespace {operator_namespace} --operator-params \"--git-readonly \" --enable-helm-operator --helm-operator-version 0.6.0 @@ -44,32 +44,32 @@ def test_k8sconfiguration(self): checks=[ self.check('name', '{name}'), self.check('resourceGroup', '{rg}'), - self.check('operatorInstanceName', '{opInstanceName}'), - self.check('operatorNamespace', '{opNamespace}'), + self.check('operatorInstanceName', '{operator_instance_name}'), + self.check('operatorNamespace', '{operator_namespace}'), self.check('provisioningState', 'Succeeded'), self.check('operatorScope', 'namespace'), self.check('operatorType', 'Flux') ]) # List the configurations again to see if we have one additional - newCount = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {clusterName}').get_output_in_json()) - self.assertEqual(newCount, configCount + 1) + newCount = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {cluster_name}').get_output_in_json()) + self.assertEqual(newCount, config_count + 1) # Get the configuration created - self.cmd('k8sconfiguration show -g {rg} -c {clusterName} -n {name}', + self.cmd('k8sconfiguration show -g {rg} -c {cluster_name} -n {name}', checks=[ self.check('name', '{name}'), self.check('resourceGroup', '{rg}'), - self.check('operatorInstanceName', '{opInstanceName}'), - self.check('operatorNamespace', '{opNamespace}'), + self.check('operatorInstanceName', '{operator_instance_name}'), + self.check('operatorNamespace', '{operator_namespace}'), self.check('provisioningState', 'Succeeded'), self.check('operatorScope', 'namespace'), self.check('operatorType', 'Flux') ]) # Delete the created configuration - self.cmd('k8sconfiguration delete -g {rg} -c {clusterName} -n {name}') + self.cmd('k8sconfiguration delete -g {rg} -c {cluster_name} -n {name}') # List Configurations and confirm the count is the same as we started - newCount = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {clusterName}').get_output_in_json()) - self.assertEqual(newCount, configCount) + newCount = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {cluster_name}').get_output_in_json()) + self.assertEqual(newCount, config_count) diff --git a/src/k8sconfiguration/setup.py b/src/k8sconfiguration/setup.py index 3fb055284f2..e333c06b204 100644 --- a/src/k8sconfiguration/setup.py +++ b/src/k8sconfiguration/setup.py @@ -25,12 +25,12 @@ 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'License :: OSI Approved :: MIT License', ] From 2dc0055b6aaf66cfa97c80b34ffe18357e5173c3 Mon Sep 17 00:00:00 2001 From: nanthi Date: Mon, 20 Apr 2020 09:58:49 -0700 Subject: [PATCH 06/20] Fix more errors reported by static tools --- src/k8sconfiguration/azext_k8sconfiguration/_help.py | 4 ++-- src/k8sconfiguration/azext_k8sconfiguration/custom.py | 7 +++---- .../tests/latest/test_kubernetesconfiguration_scenario.py | 2 -- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/_help.py b/src/k8sconfiguration/azext_k8sconfiguration/_help.py index 5526003cfe0..9d7ae1355ab 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/_help.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/_help.py @@ -62,7 +62,7 @@ - name: Update an existing k8sconfiguration text: |- az k8sconfiguration update --resource-group MyResourceGroup --cluster-name MyClusterName \\ - --cluster-type 'connectedClusters' --name MyConfigurationName --enable-helm-operator \\ - --repository-url git://github.com/fluxHowTo/flux-get-started --operator-params "'--git-readonly'" \\ + --cluster-type 'connectedClusters' --name MyConfigurationName --enable-helm-operator \\ + --repository-url git://github.com/fluxHowTo/flux-get-started --operator-params "'--git-readonly'" \\ --helm-operator-version 0.6.0 --helm-operator-params '--set helm.versions=v3' """ diff --git a/src/k8sconfiguration/azext_k8sconfiguration/custom.py b/src/k8sconfiguration/azext_k8sconfiguration/custom.py index 23264c7aa3e..ca3fc3a4fbe 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/custom.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/custom.py @@ -73,7 +73,6 @@ def update_k8sconfiguration(client, resource_group_name, cluster_name, name, clu # Determine ClusterRP cluster_rp = __get_cluster_type(cluster_type) - source_control_configuration_name = name.strip() config = client.get(resource_group_name, cluster_rp, cluster_type, cluster_name, @@ -132,7 +131,7 @@ def delete_k8sconfiguration(client, resource_group_name, cluster_name, name, clu def __get_cluster_type(cluster_type): if cluster_type.lower() == 'connectedclusters': return 'Microsoft.Kubernetes' - elif cluster_type.lower() == 'managedclusters': - return 'Microsoft.ContainerService' else: - raise CLIError("Invalid cluster-type. Supported values are 'connectedClusters' and 'managedClusters'.") + # Since cluster_type is an enum of only two values, if not connectedClusters, it will be managedClusters. + return 'Microsoft.ContainerService' + diff --git a/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py index ec756010d62..7266acf7519 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py @@ -4,9 +4,7 @@ # -------------------------------------------------------------------------------------------- import os -import unittest -from azure_devtools.scenario_tests import AllowLargeResponse from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer, record_only) TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) From 28c62bdde6e80c8d1460c276f826abf70e4383b0 Mon Sep 17 00:00:00 2001 From: nanthi Date: Mon, 20 Apr 2020 10:06:03 -0700 Subject: [PATCH 07/20] Fix one more error reported by static tool --- src/k8sconfiguration/azext_k8sconfiguration/custom.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/custom.py b/src/k8sconfiguration/azext_k8sconfiguration/custom.py index ca3fc3a4fbe..e03d47309a7 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/custom.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/custom.py @@ -131,7 +131,5 @@ def delete_k8sconfiguration(client, resource_group_name, cluster_name, name, clu def __get_cluster_type(cluster_type): if cluster_type.lower() == 'connectedclusters': return 'Microsoft.Kubernetes' - else: - # Since cluster_type is an enum of only two values, if not connectedClusters, it will be managedClusters. - return 'Microsoft.ContainerService' - + # Since cluster_type is an enum of only two values, if not connectedClusters, it will be managedClusters. + return 'Microsoft.ContainerService' From 5506713c3fb7f424d771c2dacfb49fb71cd93058 Mon Sep 17 00:00:00 2001 From: nanthi Date: Mon, 20 Apr 2020 23:38:27 -0700 Subject: [PATCH 08/20] Updated the SDK with the official version --- .../azext_k8sconfiguration/custom.py | 4 +- .../vendored_sdks/__init__.py | 8 +- .../vendored_sdks/_configuration.py | 49 +++ ...> _source_control_configuration_client.py} | 45 +-- .../vendored_sdks/models/__init__.py | 58 +-- .../vendored_sdks/models/_models.py | 367 ++++++++++++++++++ .../vendored_sdks/models/_models_py3.py | 367 ++++++++++++++++++ ...onfiguration_paged.py => _paged_models.py} | 15 +- ...rce_control_configuration_client_enums.py} | 0 .../vendored_sdks/models/compliance_status.py | 51 --- .../models/compliance_status_py3.py | 51 --- .../vendored_sdks/models/error_definition.py | 47 --- .../models/error_definition_py3.py | 47 --- .../vendored_sdks/models/error_response.py | 41 -- .../models/error_response_py3.py | 41 -- .../models/helm_operator_properties.py | 32 -- .../models/helm_operator_properties_py3.py | 32 -- .../vendored_sdks/models/proxy_resource.py | 42 -- .../models/proxy_resource_py3.py | 42 -- .../vendored_sdks/models/resource.py | 45 --- .../models/resource_provider_operation.py | 34 -- .../resource_provider_operation_display.py | 40 -- ...resource_provider_operation_display_py3.py | 40 -- .../resource_provider_operation_paged.py | 27 -- .../models/resource_provider_operation_py3.py | 34 -- .../vendored_sdks/models/resource_py3.py | 45 --- .../vendored_sdks/models/result.py | 28 -- .../vendored_sdks/models/result_py3.py | 28 -- .../models/source_control_configuration.py | 107 ----- .../source_control_configuration_py3.py | 108 ------ .../vendored_sdks/operations/__init__.py | 4 +- .../{operations.py => _operations.py} | 20 +- ...urce_control_configurations_operations.py} | 55 ++- .../vendored_sdks/version.py | 2 +- 34 files changed, 877 insertions(+), 1079 deletions(-) create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/_configuration.py rename src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/{source_control_configuration_client.py => _source_control_configuration_client.py} (55%) create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_models.py create mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_models_py3.py rename src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/{source_control_configuration_paged.py => _paged_models.py} (60%) rename src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/{source_control_configuration_client_enums.py => _source_control_configuration_client_enums.py} (100%) delete mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/compliance_status.py delete mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/compliance_status_py3.py delete mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_definition.py delete mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_definition_py3.py delete mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_response.py delete mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_response_py3.py delete mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/helm_operator_properties.py delete mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/helm_operator_properties_py3.py delete mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/proxy_resource.py delete mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/proxy_resource_py3.py delete mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource.py delete mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation.py delete mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_display.py delete mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_display_py3.py delete mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_paged.py delete mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_py3.py delete mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_py3.py delete mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/result.py delete mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/result_py3.py delete mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration.py delete mode 100644 src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration_py3.py rename src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/{operations.py => _operations.py} (84%) rename src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/{source_control_configurations_operations.py => _source_control_configurations_operations.py} (91%) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/custom.py b/src/k8sconfiguration/azext_k8sconfiguration/custom.py index e03d47309a7..4c864f45661 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/custom.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/custom.py @@ -5,8 +5,8 @@ from knack.util import CLIError -from azext_k8sconfiguration.vendored_sdks.models.source_control_configuration_py3 import SourceControlConfiguration -from azext_k8sconfiguration.vendored_sdks.models.helm_operator_properties import HelmOperatorProperties +from azext_k8sconfiguration.vendored_sdks.models import SourceControlConfiguration +from azext_k8sconfiguration.vendored_sdks.models import HelmOperatorProperties def show_k8sconfiguration(client, resource_group_name, cluster_name, name, cluster_type='connectedClusters'): diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/__init__.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/__init__.py index 1acad8634cd..874177b4d34 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/__init__.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/__init__.py @@ -9,11 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .source_control_configuration_client import SourceControlConfigurationClient -from .source_control_configuration_client import SourceControlConfigurationClientConfiguration -from .version import VERSION - +from ._configuration import SourceControlConfigurationClientConfiguration +from ._source_control_configuration_client import SourceControlConfigurationClient __all__ = ['SourceControlConfigurationClient', 'SourceControlConfigurationClientConfiguration'] +from .version import VERSION + __version__ = VERSION diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/_configuration.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/_configuration.py new file mode 100644 index 00000000000..5043ed69594 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/_configuration.py @@ -0,0 +1,49 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class SourceControlConfigurationClientConfiguration(AzureConfiguration): + """Configuration for SourceControlConfigurationClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :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 + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(SourceControlConfigurationClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-kubernetesconfiguration/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/source_control_configuration_client.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/_source_control_configuration_client.py similarity index 55% rename from src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/source_control_configuration_client.py rename to src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/_source_control_configuration_client.py index 08afb4a5cee..004f8988387 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/source_control_configuration_client.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/_source_control_configuration_client.py @@ -11,44 +11,11 @@ from msrest.service_client import SDKClient from msrest import Serializer, Deserializer -from msrestazure import AzureConfiguration -from .version import VERSION -from .operations.source_control_configurations_operations import SourceControlConfigurationsOperations -from .operations.operations import Operations -from . import models - - -class SourceControlConfigurationClientConfiguration(AzureConfiguration): - """Configuration for SourceControlConfigurationClient - Note that all parameters used to create this instance are saved as instance - attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :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 - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' - - super(SourceControlConfigurationClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-k8sconfiguration/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id +from ._configuration import SourceControlConfigurationClientConfiguration +from .operations import SourceControlConfigurationsOperations +from .operations import Operations +from . import models class SourceControlConfigurationClient(SDKClient): @@ -58,9 +25,9 @@ class SourceControlConfigurationClient(SDKClient): :vartype config: SourceControlConfigurationClientConfiguration :ivar source_control_configurations: SourceControlConfigurations operations - :vartype source_control_configurations: azure.mgmt.k8sconfiguration.operations.SourceControlConfigurationsOperations + :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.operations.SourceControlConfigurationsOperations :ivar operations: Operations operations - :vartype operations: azure.mgmt.k8sconfiguration.operations.Operations + :vartype operations: azure.mgmt.kubernetesconfiguration.operations.Operations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/__init__.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/__init__.py index 40bf48bccd4..3288aba428d 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/__init__.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/__init__.py @@ -10,30 +10,30 @@ # -------------------------------------------------------------------------- try: - from .resource_py3 import Resource - from .proxy_resource_py3 import ProxyResource - from .result_py3 import Result - from .error_definition_py3 import ErrorDefinition - from .error_response_py3 import ErrorResponse, ErrorResponseException - from .compliance_status_py3 import ComplianceStatus - from .helm_operator_properties_py3 import HelmOperatorProperties - from .source_control_configuration_py3 import SourceControlConfiguration - from .resource_provider_operation_display_py3 import ResourceProviderOperationDisplay - from .resource_provider_operation_py3 import ResourceProviderOperation + from ._models_py3 import ComplianceStatus + from ._models_py3 import ErrorDefinition + from ._models_py3 import ErrorResponse, ErrorResponseException + 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 Result + from ._models_py3 import SourceControlConfiguration except (SyntaxError, ImportError): - from .resource import Resource - from .proxy_resource import ProxyResource - from .result import Result - from .error_definition import ErrorDefinition - from .error_response import ErrorResponse, ErrorResponseException - from .compliance_status import ComplianceStatus - from .helm_operator_properties import HelmOperatorProperties - from .source_control_configuration import SourceControlConfiguration - from .resource_provider_operation_display import ResourceProviderOperationDisplay - from .resource_provider_operation import ResourceProviderOperation -from .source_control_configuration_paged import SourceControlConfigurationPaged -from .resource_provider_operation_paged import ResourceProviderOperationPaged -from .source_control_configuration_client_enums import ( + from ._models import ComplianceStatus + from ._models import ErrorDefinition + from ._models import ErrorResponse, ErrorResponseException + from ._models import HelmOperatorProperties + from ._models import ProxyResource + from ._models import Resource + from ._models import ResourceProviderOperation + from ._models import ResourceProviderOperationDisplay + from ._models import Result + from ._models import SourceControlConfiguration +from ._paged_models import ResourceProviderOperationPaged +from ._paged_models import SourceControlConfigurationPaged +from ._source_control_configuration_client_enums import ( ComplianceState, MessageLevel, OperatorType, @@ -43,16 +43,16 @@ ) __all__ = [ - 'Resource', - 'ProxyResource', - 'Result', + 'ComplianceStatus', 'ErrorDefinition', 'ErrorResponse', 'ErrorResponseException', - 'ComplianceStatus', 'HelmOperatorProperties', - 'SourceControlConfiguration', - 'ResourceProviderOperationDisplay', + 'ProxyResource', + 'Resource', 'ResourceProviderOperation', + 'ResourceProviderOperationDisplay', + 'Result', + 'SourceControlConfiguration', 'SourceControlConfigurationPaged', 'ResourceProviderOperationPaged', 'ComplianceState', diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_models.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_models.py new file mode 100644 index 00000000000..598e347d713 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_models.py @@ -0,0 +1,367 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ComplianceStatus(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' + :vartype compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.models.ComplianceState + :param last_config_applied: Datetime the configuration was last applied. + :type last_config_applied: 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.models.MessageLevel + """ + + _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(Model): + """Error definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Service specific error code which serves as the substatus for + the HTTP error code. + :vartype code: str + :ivar message: Description of the error. + :vartype message: str + :ivar details: Internal error details. + :vartype details: + list[~azure.mgmt.kubernetesconfiguration.models.ErrorDefinition] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDefinition]'}, + } + + def __init__(self, **kwargs): + super(ErrorDefinition, self).__init__(**kwargs) + self.code = None + self.message = None + self.details = None + + +class ErrorResponse(Model): + """Error response. + + :param error: Error definition. + :type error: ~azure.mgmt.kubernetesconfiguration.models.ErrorDefinition + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinition'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class HelmOperatorProperties(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(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 + """ + + _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): + """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 + """ + + _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(Model): + """Supported operation of this resource provider. + + :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.models.ResourceProviderOperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderOperation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + + +class ResourceProviderOperationDisplay(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 Result(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. + + 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 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. Default value: "default" . + :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.models.OperatorType + :param operator_params: Any Parameters for the Operator instance in string + format. + :type operator_params: 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.models.OperatorScope + :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 enable_helm_operator: Option to enable Helm Operator for this git + configuration. Possible values include: 'true', 'false' + :type enable_helm_operator: str or + ~azure.mgmt.kubernetesconfiguration.models.EnableHelmOperator + :param helm_operator_properties: Properties for Helm operator. + :type helm_operator_properties: + ~azure.mgmt.kubernetesconfiguration.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.models.ProvisioningState + :ivar compliance_status: Compliance Status of the Configuration + :vartype compliance_status: + ~azure.mgmt.kubernetesconfiguration.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'}, + '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'}, + 'operator_scope': {'key': 'properties.operatorScope', 'type': 'str'}, + 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, + 'enable_helm_operator': {'key': 'properties.enableHelmOperator', 'type': 'str'}, + '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.operator_scope = kwargs.get('operator_scope', "cluster") + self.repository_public_key = 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 diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_models_py3.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_models_py3.py new file mode 100644 index 00000000000..367929e4828 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_models_py3.py @@ -0,0 +1,367 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ComplianceStatus(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' + :vartype compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.models.ComplianceState + :param last_config_applied: Datetime the configuration was last applied. + :type last_config_applied: 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.models.MessageLevel + """ + + _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=None, message: str=None, message_level=None, **kwargs) -> None: + 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 ErrorDefinition(Model): + """Error definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Service specific error code which serves as the substatus for + the HTTP error code. + :vartype code: str + :ivar message: Description of the error. + :vartype message: str + :ivar details: Internal error details. + :vartype details: + list[~azure.mgmt.kubernetesconfiguration.models.ErrorDefinition] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDefinition]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDefinition, self).__init__(**kwargs) + self.code = None + self.message = None + self.details = None + + +class ErrorResponse(Model): + """Error response. + + :param error: Error definition. + :type error: ~azure.mgmt.kubernetesconfiguration.models.ErrorDefinition + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinition'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class HelmOperatorProperties(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, *, chart_version: str=None, chart_values: str=None, **kwargs) -> None: + super(HelmOperatorProperties, self).__init__(**kwargs) + self.chart_version = chart_version + self.chart_values = chart_values + + +class Resource(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 + """ + + _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) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = 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 + """ + + _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) -> None: + super(ProxyResource, self).__init__(**kwargs) + + +class ResourceProviderOperation(Model): + """Supported operation of this resource provider. + + :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.models.ResourceProviderOperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(ResourceProviderOperation, self).__init__(**kwargs) + self.name = name + self.display = display + + +class ResourceProviderOperationDisplay(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, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class Result(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, *, sample_property: str=None, **kwargs) -> None: + super(Result, self).__init__(**kwargs) + self.sample_property = sample_property + + +class SourceControlConfiguration(ProxyResource): + """The SourceControl Configuration 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 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. Default value: "default" . + :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.models.OperatorType + :param operator_params: Any Parameters for the Operator instance in string + format. + :type operator_params: 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.models.OperatorScope + :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 enable_helm_operator: Option to enable Helm Operator for this git + configuration. Possible values include: 'true', 'false' + :type enable_helm_operator: str or + ~azure.mgmt.kubernetesconfiguration.models.EnableHelmOperator + :param helm_operator_properties: Properties for Helm operator. + :type helm_operator_properties: + ~azure.mgmt.kubernetesconfiguration.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.models.ProvisioningState + :ivar compliance_status: Compliance Status of the Configuration + :vartype compliance_status: + ~azure.mgmt.kubernetesconfiguration.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'}, + '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'}, + 'operator_scope': {'key': 'properties.operatorScope', 'type': 'str'}, + 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, + 'enable_helm_operator': {'key': 'properties.enableHelmOperator', 'type': 'str'}, + '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: str=None, operator_namespace: str="default", operator_instance_name: str=None, operator_type=None, operator_params: str=None, operator_scope="cluster", enable_helm_operator=None, helm_operator_properties=None, **kwargs) -> None: + super(SourceControlConfiguration, self).__init__(**kwargs) + 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.operator_scope = operator_scope + self.repository_public_key = None + self.enable_helm_operator = enable_helm_operator + self.helm_operator_properties = helm_operator_properties + self.provisioning_state = None + self.compliance_status = None diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration_paged.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_paged_models.py similarity index 60% rename from src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration_paged.py rename to src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_paged_models.py index 2f8000af6d2..da03391d8d6 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration_paged.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_paged_models.py @@ -14,7 +14,7 @@ class SourceControlConfigurationPaged(Paged): """ - A paging container for iterating over a list of :class:`SourceControlConfiguration ` object + A paging container for iterating over a list of :class:`SourceControlConfiguration ` object """ _attribute_map = { @@ -25,3 +25,16 @@ class SourceControlConfigurationPaged(Paged): def __init__(self, *args, **kwargs): super(SourceControlConfigurationPaged, self).__init__(*args, **kwargs) +class ResourceProviderOperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`ResourceProviderOperation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ResourceProviderOperation]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourceProviderOperationPaged, self).__init__(*args, **kwargs) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration_client_enums.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_source_control_configuration_client_enums.py similarity index 100% rename from src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration_client_enums.py rename to src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_source_control_configuration_client_enums.py diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/compliance_status.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/compliance_status.py deleted file mode 100644 index c6c27eb4da3..00000000000 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/compliance_status.py +++ /dev/null @@ -1,51 +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 msrest.serialization import Model - - -class ComplianceStatus(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' - :vartype compliance_state: str or - ~azure.mgmt.k8sconfiguration.models.ComplianceState - :param last_config_applied: Datetime the configuration was last applied. - :type last_config_applied: 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.k8sconfiguration.models.MessageLevel - """ - - _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) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/compliance_status_py3.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/compliance_status_py3.py deleted file mode 100644 index a2b738cdfb0..00000000000 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/compliance_status_py3.py +++ /dev/null @@ -1,51 +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 msrest.serialization import Model - - -class ComplianceStatus(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' - :vartype compliance_state: str or - ~azure.mgmt.k8sconfiguration.models.ComplianceState - :param last_config_applied: Datetime the configuration was last applied. - :type last_config_applied: 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.k8sconfiguration.models.MessageLevel - """ - - _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=None, message: str=None, message_level=None, **kwargs) -> None: - super(ComplianceStatus, self).__init__(**kwargs) - self.compliance_state = None - self.last_config_applied = last_config_applied - self.message = message - self.message_level = message_level diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_definition.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_definition.py deleted file mode 100644 index c95b6462ada..00000000000 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_definition.py +++ /dev/null @@ -1,47 +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 msrest.serialization import Model - - -class ErrorDefinition(Model): - """Error definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar code: Service specific error code which serves as the substatus for - the HTTP error code. - :vartype code: str - :ivar message: Description of the error. - :vartype message: str - :ivar details: Internal error details. - :vartype details: - list[~azure.mgmt.k8sconfiguration.models.ErrorDefinition] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'details': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDefinition]'}, - } - - def __init__(self, **kwargs): - super(ErrorDefinition, self).__init__(**kwargs) - self.code = None - self.message = None - self.details = None diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_definition_py3.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_definition_py3.py deleted file mode 100644 index 5c95e7c1b97..00000000000 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_definition_py3.py +++ /dev/null @@ -1,47 +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 msrest.serialization import Model - - -class ErrorDefinition(Model): - """Error definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar code: Service specific error code which serves as the substatus for - the HTTP error code. - :vartype code: str - :ivar message: Description of the error. - :vartype message: str - :ivar details: Internal error details. - :vartype details: - list[~azure.mgmt.k8sconfiguration.models.ErrorDefinition] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'details': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDefinition]'}, - } - - def __init__(self, **kwargs) -> None: - super(ErrorDefinition, self).__init__(**kwargs) - self.code = None - self.message = None - self.details = None diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_response.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_response.py deleted file mode 100644 index e95ade38243..00000000000 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_response.py +++ /dev/null @@ -1,41 +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 msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class ErrorResponse(Model): - """Error response. - - :param error: Error definition. - :type error: ~azure.mgmt.k8sconfiguration.models.ErrorDefinition - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDefinition'}, - } - - def __init__(self, **kwargs): - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_response_py3.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_response_py3.py deleted file mode 100644 index f40d9d92d46..00000000000 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/error_response_py3.py +++ /dev/null @@ -1,41 +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 msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class ErrorResponse(Model): - """Error response. - - :param error: Error definition. - :type error: ~azure.mgmt.k8sconfiguration.models.ErrorDefinition - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDefinition'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(ErrorResponse, self).__init__(**kwargs) - self.error = error - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/helm_operator_properties.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/helm_operator_properties.py deleted file mode 100644 index cdcc4e667f2..00000000000 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/helm_operator_properties.py +++ /dev/null @@ -1,32 +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 msrest.serialization import Model - - -class HelmOperatorProperties(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) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/helm_operator_properties_py3.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/helm_operator_properties_py3.py deleted file mode 100644 index d5aa76fd60d..00000000000 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/helm_operator_properties_py3.py +++ /dev/null @@ -1,32 +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 msrest.serialization import Model - - -class HelmOperatorProperties(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, *, chart_version: str = None, chart_values: str = None, **kwargs) -> None: - super(HelmOperatorProperties, self).__init__(**kwargs) - self.chart_version = chart_version - self.chart_values = chart_values diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/proxy_resource.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/proxy_resource.py deleted file mode 100644 index d1081c4e0fc..00000000000 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/proxy_resource.py +++ /dev/null @@ -1,42 +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 .resource import Resource - - -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 - """ - - _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) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/proxy_resource_py3.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/proxy_resource_py3.py deleted file mode 100644 index 01de2c50909..00000000000 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/proxy_resource_py3.py +++ /dev/null @@ -1,42 +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 .resource_py3 import Resource - - -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 - """ - - _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) -> None: - super(ProxyResource, self).__init__(**kwargs) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource.py deleted file mode 100644 index 9b91722756c..00000000000 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource.py +++ /dev/null @@ -1,45 +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 msrest.serialization import Model - - -class Resource(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 - """ - - _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 diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation.py deleted file mode 100644 index 8f4b8427f19..00000000000 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation.py +++ /dev/null @@ -1,34 +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 msrest.serialization import Model - - -class ResourceProviderOperation(Model): - """Supported operation of this resource provider. - - :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.k8sconfiguration.models.ResourceProviderOperationDisplay - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, - } - - def __init__(self, **kwargs): - super(ResourceProviderOperation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_display.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_display.py deleted file mode 100644 index 32d8a009cdc..00000000000 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_display.py +++ /dev/null @@ -1,40 +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 msrest.serialization import Model - - -class ResourceProviderOperationDisplay(Model): - """Display metadata associated with the operation. - - :param provider: Resource provider: Microsoft K8sConfiguration. - :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) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_display_py3.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_display_py3.py deleted file mode 100644 index 442dcb460f5..00000000000 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_display_py3.py +++ /dev/null @@ -1,40 +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 msrest.serialization import Model - - -class ResourceProviderOperationDisplay(Model): - """Display metadata associated with the operation. - - :param provider: Resource provider: Microsoft K8sConfiguration. - :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, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: - super(ResourceProviderOperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_paged.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_paged.py deleted file mode 100644 index 540410b763d..00000000000 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_paged.py +++ /dev/null @@ -1,27 +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 msrest.paging import Paged - - -class ResourceProviderOperationPaged(Paged): - """ - A paging container for iterating over a list of :class:`ResourceProviderOperation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ResourceProviderOperation]'} - } - - def __init__(self, *args, **kwargs): - - super(ResourceProviderOperationPaged, self).__init__(*args, **kwargs) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_py3.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_py3.py deleted file mode 100644 index ad7b611c335..00000000000 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_provider_operation_py3.py +++ /dev/null @@ -1,34 +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 msrest.serialization import Model - - -class ResourceProviderOperation(Model): - """Supported operation of this resource provider. - - :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.k8sconfiguration.models.ResourceProviderOperationDisplay - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, - } - - def __init__(self, *, name: str=None, display=None, **kwargs) -> None: - super(ResourceProviderOperation, self).__init__(**kwargs) - self.name = name - self.display = display diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_py3.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_py3.py deleted file mode 100644 index 29e573bf29f..00000000000 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/resource_py3.py +++ /dev/null @@ -1,45 +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 msrest.serialization import Model - - -class Resource(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 - """ - - _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) -> None: - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/result.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/result.py deleted file mode 100644 index 4281999aeeb..00000000000 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/result.py +++ /dev/null @@ -1,28 +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 msrest.serialization import Model - - -class Result(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) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/result_py3.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/result_py3.py deleted file mode 100644 index 9da83b057b1..00000000000 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/result_py3.py +++ /dev/null @@ -1,28 +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 msrest.serialization import Model - - -class Result(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, *, sample_property: str=None, **kwargs) -> None: - super(Result, self).__init__(**kwargs) - self.sample_property = sample_property diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration.py deleted file mode 100644 index 83512e22638..00000000000 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration.py +++ /dev/null @@ -1,107 +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 .proxy_resource import ProxyResource -from .helm_operator_properties import HelmOperatorProperties - -class SourceControlConfiguration(ProxyResource): - """The SourceControl Configuration 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 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. Default value: "default" . - :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.k8sconfiguration.models.OperatorType - :param operator_params: Any Parameters for the Operator instance in string - format. - :type operator_params: 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.k8sconfiguration.models.OperatorScope - :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 enable_helm_operator: Option to enable Helm Operator for this git - configuration. Possible values include: 'true', 'false' - :type enable_helm_operator: str or - ~azure.mgmt.k8sconfiguration.models.EnableHelmOperator - :param helm_operator_properties: Properties for Helm operator. - :type helm_operator_properties: - ~azure.mgmt.k8sconfiguration.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.k8sconfiguration.models.ProvisioningState - :ivar compliance_status: Compliance Status of the Configuration - :vartype compliance_status: - ~azure.mgmt.k8sconfiguration.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'}, - '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'}, - 'operator_scope': {'key': 'properties.operatorScope', 'type': 'str'}, - 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, - 'enable_helm_operator': {'key': 'properties.enableHelmOperator', 'type': 'str'}, - '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.operator_scope = kwargs.get('operator_scope', "cluster") - self.repository_public_key = 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 diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration_py3.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration_py3.py deleted file mode 100644 index ff1646a46a7..00000000000 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/source_control_configuration_py3.py +++ /dev/null @@ -1,108 +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 .proxy_resource_py3 import ProxyResource -from .helm_operator_properties import HelmOperatorProperties - - -class SourceControlConfiguration(ProxyResource): - """The SourceControl Configuration 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 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. Default value: "default" . - :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.k8sconfiguration.models.OperatorType - :param operator_params: Any Parameters for the Operator instance in string - format. - :type operator_params: 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.k8sconfiguration.models.OperatorScope - :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 enable_helm_operator: Option to enable Helm Operator for this git - configuration. Possible values include: 'true', 'false' - :type enable_helm_operator: str or - ~azure.mgmt.k8sconfiguration.models.EnableHelmOperator - :param helm_operator_properties: Properties for Helm operator. - :type helm_operator_properties: - ~azure.mgmt.k8sconfiguration.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.k8sconfiguration.models.ProvisioningState - :ivar compliance_status: Compliance Status of the Configuration - :vartype compliance_status: - ~azure.mgmt.k8sconfiguration.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'}, - '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'}, - 'operator_scope': {'key': 'properties.operatorScope', 'type': 'str'}, - 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, - 'enable_helm_operator': {'key': 'properties.enableHelmOperator', 'type': 'str'}, - '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: str=None, operator_namespace: str="default", operator_instance_name: str=None, operator_type=None, operator_params: str=None, operator_scope="cluster", enable_helm_operator: str=None, helm_operator_properties: HelmOperatorProperties=None, **kwargs) -> None: - super(SourceControlConfiguration, self).__init__(**kwargs) - 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.operator_scope = operator_scope - self.repository_public_key = None - self.enable_helm_operator = enable_helm_operator - self.helm_operator_properties = helm_operator_properties - self.provisioning_state = None - self.compliance_status = None diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/__init__.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/__init__.py index 53b6c2e911a..b6c0858d9a7 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/__init__.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/__init__.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .source_control_configurations_operations import SourceControlConfigurationsOperations -from .operations import Operations +from ._source_control_configurations_operations import SourceControlConfigurationsOperations +from ._operations import Operations __all__ = [ 'SourceControlConfigurationsOperations', diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/operations.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/_operations.py similarity index 84% rename from src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/operations.py rename to src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/_operations.py index 2226373d970..dfbd51d9665 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/operations.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/_operations.py @@ -19,6 +19,8 @@ class Operations(object): """Operations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -37,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer): def list( self, api_version, custom_headers=None, raw=False, **operation_config): - """List all the available operations the K8sConfiguration resource + """List all the available operations the KubernetesConfiguration resource provider supports. :param api_version: The API version to be used with the HTTP request. @@ -49,11 +51,10 @@ def list( overrides`. :return: An iterator like instance of ResourceProviderOperation :rtype: - ~azure.mgmt.k8sconfiguration.models.ResourceProviderOperationPaged[~azure.mgmt.k8sconfiguration.models.ResourceProviderOperation] + ~azure.mgmt.kubernetesconfiguration.models.ResourceProviderOperationPaged[~azure.mgmt.kubernetesconfiguration.models.ResourceProviderOperation] :raises: :class:`CloudError` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list.metadata['url'] @@ -78,6 +79,11 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -88,12 +94,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.ResourceProviderOperationPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.ResourceProviderOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.ResourceProviderOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/providers/Microsoft.KubernetesConfiguration/operations'} diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/source_control_configurations_operations.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/_source_control_configurations_operations.py similarity index 91% rename from src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/source_control_configurations_operations.py rename to src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/_source_control_configurations_operations.py index d757d2bcac1..42bff45e7a2 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/source_control_configurations_operations.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/_source_control_configurations_operations.py @@ -13,7 +13,6 @@ from msrest.pipeline import ClientRawResponse from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling -from msrestazure.azure_exceptions import CloudError from .. import models @@ -21,6 +20,8 @@ class SourceControlConfigurationsOperations(object): """SourceControlConfigurationsOperations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -67,10 +68,10 @@ def get( overrides`. :return: SourceControlConfiguration or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.k8sconfiguration.models.SourceControlConfiguration + ~azure.mgmt.kubernetesconfiguration.models.SourceControlConfiguration or ~msrest.pipeline.ClientRawResponse :raises: - :class:`ErrorResponseException` + :class:`ErrorResponseException` """ # Construct URL url = self.get.metadata['url'] @@ -103,12 +104,9 @@ def get( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('SourceControlConfiguration', response) @@ -143,9 +141,9 @@ def create_or_update( :param api_version: The API version to be used with the HTTP request. :type api_version: str :param source_control_configuration: Properties necessary to Create - K8sConfiguration. + KubernetesConfiguration. :type source_control_configuration: - ~azure.mgmt.k8sconfiguration.models.SourceControlConfiguration + ~azure.mgmt.kubernetesconfiguration.models.SourceControlConfiguration :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -153,10 +151,10 @@ def create_or_update( overrides`. :return: SourceControlConfiguration or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.k8sconfiguration.models.SourceControlConfiguration + ~azure.mgmt.kubernetesconfiguration.models.SourceControlConfiguration or ~msrest.pipeline.ClientRawResponse :raises: - :class:`ErrorResponseException` + :class:`ErrorResponseException` """ # Construct URL url = self.create_or_update.metadata['url'] @@ -193,12 +191,9 @@ def create_or_update( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('SourceControlConfiguration', response) if response.status_code == 201: @@ -243,10 +238,8 @@ def _delete_initial( request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -286,7 +279,7 @@ def delete( :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: - :class:`ErrorResponseException` + :class:`ErrorResponseException` """ raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -341,12 +334,11 @@ def list( overrides`. :return: An iterator like instance of SourceControlConfiguration :rtype: - ~azure.mgmt.k8sconfiguration.models.SourceControlConfigurationPaged[~azure.mgmt.k8sconfiguration.models.SourceControlConfiguration] + ~azure.mgmt.kubernetesconfiguration.models.SourceControlConfigurationPaged[~azure.mgmt.kubernetesconfiguration.models.SourceControlConfiguration] :raises: - :class:`ErrorResponseException` + :class:`ErrorResponseException` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list.metadata['url'] @@ -379,22 +371,23 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response # Deserialize response - deserialized = models.SourceControlConfigurationPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.SourceControlConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.SourceControlConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations'} diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/version.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/version.py index acc1a73a8bb..e0ec669828c 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/version.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "2019-11-01-preview" +VERSION = "0.1.0" From 320b52c92ac624a8a1d6381e451afce90822eaf2 Mon Sep 17 00:00:00 2001 From: NarayanThiru Date: Tue, 21 Apr 2020 17:42:59 -0700 Subject: [PATCH 09/20] Update src/k8sconfiguration/azext_k8sconfiguration/commands.py Co-Authored-By: Feiyue Yu --- src/k8sconfiguration/azext_k8sconfiguration/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/commands.py b/src/k8sconfiguration/azext_k8sconfiguration/commands.py index 3fe569acd4f..17525763081 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/commands.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/commands.py @@ -19,6 +19,6 @@ def load_command_table(self, _): as g: g.custom_command('create', 'create_k8sconfiguration') g.custom_command('update', 'update_k8sconfiguration') - g.custom_command('delete', 'delete_k8sconfiguration') + g.custom_command('delete', 'delete_k8sconfiguration', confirmation=True) g.custom_command('list', 'list_k8sconfiguration') g.custom_command('show', 'show_k8sconfiguration') From 5fe5a93a079e17bee49799a34b66c69f1418a753 Mon Sep 17 00:00:00 2001 From: nanthi Date: Tue, 21 Apr 2020 17:50:13 -0700 Subject: [PATCH 10/20] Address PR comments --- src/k8sconfiguration/azext_k8sconfiguration/_params.py | 2 -- src/k8sconfiguration/azext_k8sconfiguration/commands.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/_params.py b/src/k8sconfiguration/azext_k8sconfiguration/_params.py index a365845c99b..27e25045238 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/_params.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/_params.py @@ -47,8 +47,6 @@ def load_arguments(self, _): help='Namespace in which to install the Operator.') c.argument('operator_type', help='''Optional. Type of the operator. Valid value is 'flux'.''') - c.argument('', - help='') with self.argument_context('k8sconfiguration list') as c: c.argument('sourcecontrolconfiguration', sourcecontrolconfiguration_type, id_part=None) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/commands.py b/src/k8sconfiguration/azext_k8sconfiguration/commands.py index 17525763081..a554e47fa43 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/commands.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/commands.py @@ -21,4 +21,4 @@ def load_command_table(self, _): g.custom_command('update', 'update_k8sconfiguration') g.custom_command('delete', 'delete_k8sconfiguration', confirmation=True) g.custom_command('list', 'list_k8sconfiguration') - g.custom_command('show', 'show_k8sconfiguration') + g.custom_show_command('show', 'show_k8sconfiguration') From d485cb3956e9ea1a92fb824ffeda4260cd898924 Mon Sep 17 00:00:00 2001 From: nanthi Date: Wed, 22 Apr 2020 18:28:00 -0700 Subject: [PATCH 11/20] Updated the sdk files to fix api-version parameter issue --- src/k8sconfiguration/HISTORY.rst | 4 +- .../recordings/test_k8sconfiguration.yaml | 60 +++++++++---------- .../test_kubernetesconfiguration_scenario.py | 16 ++--- .../vendored_sdks/operations/_operations.py | 8 +-- ...ource_control_configurations_operations.py | 29 ++++----- 5 files changed, 55 insertions(+), 62 deletions(-) diff --git a/src/k8sconfiguration/HISTORY.rst b/src/k8sconfiguration/HISTORY.rst index 8c34bccfff8..f4ccafdcc4c 100644 --- a/src/k8sconfiguration/HISTORY.rst +++ b/src/k8sconfiguration/HISTORY.rst @@ -3,6 +3,6 @@ Release History =============== -0.1.0 +0.1.7 ++++++ -* Initial release. \ No newline at end of file +* Initial release (for Public Preview) \ No newline at end of file diff --git a/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/recordings/test_k8sconfiguration.yaml b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/recordings/test_k8sconfiguration.yaml index dc466cb18f4..ff6b756ea90 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/recordings/test_k8sconfiguration.yaml +++ b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/recordings/test_k8sconfiguration.yaml @@ -14,7 +14,7 @@ interactions: - -g --cluster-name User-Agent: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 - azure-mgmt-k8sconfiguration/2019-11-01-preview Azure-SDK-For-Python AZURECLI/2.3.1 + azure-mgmt-kubernetesconfiguration/0.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 accept-language: - en-US method: GET @@ -31,18 +31,18 @@ interactions: git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cfg0219a-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"--git-readonly ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0207i","name":"cfg0207i","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"default","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cfg0219a-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"--git-readonly ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0207g","name":"cfg0207g","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cfg0207g-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"--set - git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/cfg0207g/flux-get-started","operatorInstanceName":"cfg0207g-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/testconfig0207c","name":"testconfig0207c","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"testconfig0207c-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"repositoryUrl":"git://github.com/testconfig0207c/flux-get-started","operatorInstanceName":"testconfig0207c-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/testconfig0207b","name":"testconfig0207b","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"testconfig0207b-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"repositoryUrl":"git://github.com/testconfig0207b/flux-get-started","operatorInstanceName":"testconfig0207b-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}}],"nextLink":null}' + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/cfg0207g/flux-get-started","operatorInstanceName":"cfg0207g-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}}],"nextLink":null}' headers: api-supported-versions: - 2019-11-01-Preview cache-control: - no-cache content-length: - - '13097' + - '11187' content-type: - application/json; charset=utf-8 date: - - Fri, 17 Apr 2020 00:28:12 GMT + - Thu, 23 Apr 2020 01:24:54 GMT expires: - '-1' pragma: @@ -62,7 +62,7 @@ interactions: message: OK - request: body: '{"properties": {"repositoryUrl": "git://github.com/anubhav929/flux-get-started", - "operatorNamespace": "cliTestConfig0416A-opns", "operatorInstanceName": "cliTestconfig0416A-opin", + "operatorNamespace": "cliTestConfig0422A-opns", "operatorInstanceName": "cliTestconfig0422A-opin", "operatorType": "flux", "operatorParams": "--git-readonly ", "operatorScope": "namespace", "enableHelmOperator": "True", "helmOperatorProperties": {"chartVersion": "0.6.0", "chartValues": "--set git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"}}}' @@ -85,15 +85,15 @@ interactions: --set git.ssh.secretName User-Agent: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 - azure-mgmt-k8sconfiguration/2019-11-01-preview Azure-SDK-For-Python AZURECLI/2.3.1 + azure-mgmt-kubernetesconfiguration/0.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0416A?api-version=2019-11-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0422A?api-version=2019-11-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0416A","name":"cliTestConfig0416A","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cliTestConfig0416A-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set - git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cliTestconfig0416A-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0422A","name":"cliTestConfig0422A","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cliTestConfig0422A-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cliTestconfig0422A-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}}' headers: api-supported-versions: @@ -105,11 +105,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 17 Apr 2020 00:28:14 GMT + - Thu, 23 Apr 2020 01:24:54 GMT expires: - '-1' location: - - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0416A + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0422A pragma: - no-cache server: @@ -138,15 +138,15 @@ interactions: - -g --cluster-name User-Agent: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 - azure-mgmt-k8sconfiguration/2019-11-01-preview Azure-SDK-For-Python AZURECLI/2.3.1 + azure-mgmt-kubernetesconfiguration/0.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 accept-language: - en-US method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations?api-version=2019-11-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/clitestconfig0416a","name":"clitestconfig0416a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cliTestConfig0416A-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set - git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cliTestconfig0416A-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/clitestconfig0422a","name":"clitestconfig0422a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cliTestConfig0422A-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cliTestconfig0422A-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0406a","name":"config0406a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0406a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set helm.versions=v3"},"repositoryUrl":"git://github.com/config0406a/flux-get-started","operatorInstanceName":"config0406a-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403d","name":"config0403d","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403d-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set helm.versions=v3"},"repositoryUrl":"git://github.com/config0403d/flux-get-started","operatorInstanceName":"config0403d-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403c","name":"config0403c","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403c-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set @@ -157,18 +157,18 @@ interactions: git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cfg0219a-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"--git-readonly ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0207i","name":"cfg0207i","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"default","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cfg0219a-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"--git-readonly ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0207g","name":"cfg0207g","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cfg0207g-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"--set - git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/cfg0207g/flux-get-started","operatorInstanceName":"cfg0207g-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/testconfig0207c","name":"testconfig0207c","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"testconfig0207c-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"repositoryUrl":"git://github.com/testconfig0207c/flux-get-started","operatorInstanceName":"testconfig0207c-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/testconfig0207b","name":"testconfig0207b","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"testconfig0207b-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"repositoryUrl":"git://github.com/testconfig0207b/flux-get-started","operatorInstanceName":"testconfig0207b-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}}],"nextLink":null}' + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/cfg0207g/flux-get-started","operatorInstanceName":"cfg0207g-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}}],"nextLink":null}' headers: api-supported-versions: - 2019-11-01-Preview cache-control: - no-cache content-length: - - '14199' + - '12289' content-type: - application/json; charset=utf-8 date: - - Fri, 17 Apr 2020 00:28:15 GMT + - Thu, 23 Apr 2020 01:24:55 GMT expires: - '-1' pragma: @@ -201,15 +201,15 @@ interactions: - -g -c -n User-Agent: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 - azure-mgmt-k8sconfiguration/2019-11-01-preview Azure-SDK-For-Python AZURECLI/2.3.1 + azure-mgmt-kubernetesconfiguration/0.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 accept-language: - en-US method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0416A?api-version=2019-11-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0422A?api-version=2019-11-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0416A","name":"cliTestConfig0416A","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cliTestConfig0416A-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set - git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cliTestconfig0416A-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0422A","name":"cliTestConfig0422A","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cliTestConfig0422A-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cliTestconfig0422A-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}}' headers: api-supported-versions: @@ -221,7 +221,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 17 Apr 2020 00:28:17 GMT + - Thu, 23 Apr 2020 01:24:56 GMT expires: - '-1' pragma: @@ -253,16 +253,16 @@ interactions: Content-Length: - '0' ParameterSetName: - - -g -c -n + - -g -c -n -y User-Agent: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 - azure-mgmt-k8sconfiguration/2019-11-01-preview Azure-SDK-For-Python AZURECLI/2.3.1 + azure-mgmt-kubernetesconfiguration/0.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 accept-language: - en-US x-ms-force: - 'true' method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0416A?api-version=2019-11-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0422A?api-version=2019-11-01-preview response: body: string: '{"version":"1.1","content":null,"statusCode":200,"reasonPhrase":"OK","headers":[],"trailingHeaders":[],"requestMessage":null,"isSuccessStatusCode":true}' @@ -276,7 +276,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 17 Apr 2020 00:28:18 GMT + - Thu, 23 Apr 2020 01:24:59 GMT expires: - '-1' pragma: @@ -311,7 +311,7 @@ interactions: - -g --cluster-name User-Agent: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 - azure-mgmt-k8sconfiguration/2019-11-01-preview Azure-SDK-For-Python AZURECLI/2.3.1 + azure-mgmt-kubernetesconfiguration/0.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 accept-language: - en-US method: GET @@ -328,18 +328,18 @@ interactions: git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cfg0219a-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"--git-readonly ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0207i","name":"cfg0207i","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"default","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cfg0219a-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"--git-readonly ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0207g","name":"cfg0207g","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cfg0207g-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"--set - git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/cfg0207g/flux-get-started","operatorInstanceName":"cfg0207g-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/testconfig0207c","name":"testconfig0207c","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"testconfig0207c-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"repositoryUrl":"git://github.com/testconfig0207c/flux-get-started","operatorInstanceName":"testconfig0207c-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/testconfig0207b","name":"testconfig0207b","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"testconfig0207b-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"repositoryUrl":"git://github.com/testconfig0207b/flux-get-started","operatorInstanceName":"testconfig0207b-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}}],"nextLink":null}' + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/cfg0207g/flux-get-started","operatorInstanceName":"cfg0207g-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}}],"nextLink":null}' headers: api-supported-versions: - 2019-11-01-Preview cache-control: - no-cache content-length: - - '13097' + - '11187' content-type: - application/json; charset=utf-8 date: - - Fri, 17 Apr 2020 00:28:19 GMT + - Thu, 23 Apr 2020 01:25:00 GMT expires: - '-1' pragma: diff --git a/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py index 7266acf7519..424189dbc10 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py @@ -16,12 +16,12 @@ class K8sconfigurationScenarioTest(ScenarioTest): @record_only() def test_k8sconfiguration(self): self.kwargs.update({ - 'name': 'cliTestConfig0416A', + 'name': 'cliTestConfig0422A', 'cluster_name': 'matrived-tpcomi', 'rg': 'haikudevtesting', 'repo_url': 'git://github.com/anubhav929/flux-get-started', - 'operator_instance_name': 'cliTestconfig0416A-opin', - 'operator_namespace': 'cliTestConfig0416A-opns' + 'operator_instance_name': 'cliTestconfig0422A-opin', + 'operator_namespace': 'cliTestConfig0422A-opns' }) # List Configurations and get the count @@ -50,8 +50,8 @@ def test_k8sconfiguration(self): ]) # List the configurations again to see if we have one additional - newCount = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {cluster_name}').get_output_in_json()) - self.assertEqual(newCount, config_count + 1) + new_count = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {cluster_name}').get_output_in_json()) + self.assertEqual(new_count, config_count + 1) # Get the configuration created self.cmd('k8sconfiguration show -g {rg} -c {cluster_name} -n {name}', @@ -66,8 +66,8 @@ def test_k8sconfiguration(self): ]) # Delete the created configuration - self.cmd('k8sconfiguration delete -g {rg} -c {cluster_name} -n {name}') + self.cmd('k8sconfiguration delete -g {rg} -c {cluster_name} -n {name} -y') # List Configurations and confirm the count is the same as we started - newCount = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {cluster_name}').get_output_in_json()) - self.assertEqual(newCount, config_count) + new_count = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {cluster_name}').get_output_in_json()) + self.assertEqual(new_count, config_count) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/_operations.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/_operations.py index dfbd51d9665..a1ef22cadd8 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/_operations.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/_operations.py @@ -25,6 +25,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2019-11-01-preview". """ models = models @@ -34,16 +35,15 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer + self.api_version = "2019-11-01-preview" self.config = config def list( - self, api_version, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """List all the available operations the KubernetesConfiguration resource provider supports. - :param api_version: The API version to be used with the HTTP request. - :type api_version: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -61,7 +61,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: url = next_link diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/_source_control_configurations_operations.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/_source_control_configurations_operations.py index 42bff45e7a2..290dba8e4ac 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/_source_control_configurations_operations.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/_source_control_configurations_operations.py @@ -26,6 +26,7 @@ class SourceControlConfigurationsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2019-11-01-preview". """ models = models @@ -35,11 +36,12 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer + self.api_version = "2019-11-01-preview" self.config = config def get( - self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, api_version, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers=None, raw=False, **operation_config): """Gets details of the Source Control Configuration. :param resource_group_name: The name of the resource group. @@ -59,8 +61,6 @@ def get( :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str - :param api_version: The API version to be used with the HTTP request. - :type api_version: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -87,7 +87,7 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -118,7 +118,7 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} def create_or_update( - self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, api_version, source_control_configuration, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, source_control_configuration, custom_headers=None, raw=False, **operation_config): """Create a new Kubernetes Source Control Configuration. :param resource_group_name: The name of the resource group. @@ -138,8 +138,6 @@ def create_or_update( :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str - :param api_version: The API version to be used with the HTTP request. - :type api_version: str :param source_control_configuration: Properties necessary to Create KubernetesConfiguration. :type source_control_configuration: @@ -170,7 +168,7 @@ def create_or_update( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -208,7 +206,7 @@ def create_or_update( def _delete_initial( - self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, api_version, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.delete.metadata['url'] path_format_arguments = { @@ -223,7 +221,7 @@ def _delete_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -246,7 +244,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, api_version, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers=None, raw=False, polling=True, **operation_config): """This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from the source repo. @@ -267,8 +265,6 @@ def delete( :param source_control_configuration_name: Name of the Source Control Configuration. :type source_control_configuration_name: str - :param api_version: The API version to be used with the HTTP request. - :type api_version: str :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -287,7 +283,6 @@ def delete( cluster_resource_name=cluster_resource_name, cluster_name=cluster_name, source_control_configuration_name=source_control_configuration_name, - api_version=api_version, custom_headers=custom_headers, raw=True, **operation_config @@ -308,7 +303,7 @@ def get_long_running_output(response): delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} def list( - self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, api_version, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, custom_headers=None, raw=False, **operation_config): """List all Source Control Configurations. :param resource_group_name: The name of the resource group. @@ -325,8 +320,6 @@ def list( :type cluster_resource_name: str :param cluster_name: The name of the kubernetes cluster. :type cluster_name: str - :param api_version: The API version to be used with the HTTP request. - :type api_version: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -353,7 +346,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: url = next_link From aab43754c99cf89a5d6e383fe60c19e8cd20b295 Mon Sep 17 00:00:00 2001 From: NarayanThiru Date: Wed, 22 Apr 2020 19:16:10 -0700 Subject: [PATCH 12/20] Update src/k8sconfiguration/azext_k8sconfiguration/custom.py Co-Authored-By: Xiaojian Xu --- src/k8sconfiguration/azext_k8sconfiguration/custom.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/custom.py b/src/k8sconfiguration/azext_k8sconfiguration/custom.py index 4c864f45661..a0aada1b539 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/custom.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/custom.py @@ -41,13 +41,12 @@ def create_k8sconfiguration(client, resource_group_name, cluster_name, name, rep operator_instance_name = name # Create helmOperatorProperties object - helm_operator_properties = HelmOperatorProperties() + helm_operator_properties = None if enable_helm_operator: + helm_operator_properties = HelmOperatorProperties() helm_operator_properties.chart_version = helm_operator_version.strip() helm_operator_properties.chart_values = helm_operator_params.strip() - else: - helm_operator_properties = None # Create sourceControlConfiguration object source_control_configuration = SourceControlConfiguration(repository_url=repository_url, From 5337e03272b40f1658bb140ba8476200bd00b347 Mon Sep 17 00:00:00 2001 From: nanthi Date: Wed, 22 Apr 2020 19:19:42 -0700 Subject: [PATCH 13/20] addressed more comments --- .../azext_k8sconfiguration/_validators.py | 17 ----------------- src/k8sconfiguration/setup.py | 2 -- 2 files changed, 19 deletions(-) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/_validators.py b/src/k8sconfiguration/azext_k8sconfiguration/_validators.py index 37ac32bfb01..cd8ca4df85e 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/_validators.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/_validators.py @@ -6,23 +6,6 @@ from knack.util import CLIError -def example_name_or_id_validator(cmd, namespace): - # Example of a storage account name or ID validator. - # See: https://github.com/Azure/azure-cli/blob/dev/doc/authoring_command_modules/ - # authoring_commands.md#supporting-name-or-id-parameters - from azure.cli.core.commands.client_factory import get_subscription_id - from msrestazure.tools import is_valid_resource_id, resource_id - if namespace.storage_account: - if not is_valid_resource_id(namespace.RESOURCE): - namespace.storage_account = resource_id( - subscription=get_subscription_id(cmd.cli_ctx), - resource_group=namespace.resource_group_name, - namespace='Microsoft.Storage', - type='storageAccounts', - name=namespace.storage_account - ) - - def validate_configuration_type(configuration_type): if configuration_type.lower() != 'sourcecontrolconfiguration': raise CLIError('Invalid configuration-type. Valid value is "sourceControlConfiguration"') diff --git a/src/k8sconfiguration/setup.py b/src/k8sconfiguration/setup.py index e333c06b204..2b05a5001fc 100644 --- a/src/k8sconfiguration/setup.py +++ b/src/k8sconfiguration/setup.py @@ -26,8 +26,6 @@ 'Intended Audience :: System Administrators', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', From 1756c518cb640c6e0c2f0a07eeb7bf0272add1c7 Mon Sep 17 00:00:00 2001 From: nanthi Date: Thu, 23 Apr 2020 11:04:00 -0700 Subject: [PATCH 14/20] remove Optional from help message --- .../azext_k8sconfiguration/_params.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/_params.py b/src/k8sconfiguration/azext_k8sconfiguration/_params.py index 27e25045238..1e3844bac06 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/_params.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/_params.py @@ -25,28 +25,28 @@ def load_arguments(self, _): c.argument('name', sourcecontrolconfiguration_type, options_list=['--name', '-n']) 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']), - help='Optional parameter to specify Onprem clusters (default) or AKS clusters.') + help='Specify Arc clusters (default) or AKS clusters.') c.argument('repository_url', options_list=['--repository-url', '-u'], help='Url of the sourceControl repository') c.argument('enable_helm_operator', arg_type=get_three_state_flag(), help='Enable support for Helm chart deployments') c.argument('cluster_scoped', action='store_true', - help='''Optional switch to set scope of the operator to be cluster. Default scope is 'namespace'.''') + help='''Switch to set scope of the operator to be cluster. Default scope is 'namespace'.''') c.argument('configuration_type', validator=validate_configuration_type, arg_type=get_enum_type(['sourceControlConfiguration']), help='Type of the configuration') c.argument('helm_operator_params', - help='Optional. Chart values for the Helm Operator (if enabled)') + help='Chart values for the Helm Operator (if enabled)') c.argument('helm_operator_version', - help='''Optional. Chart version of the Helm Operator, if enabled. Default:'0.2.0'.''') + help='''Chart version of the Helm Operator, if enabled. Default:'0.2.0'.''') c.argument('operator_params', - help='Optional. Parameters for the Operator.') + help='Parameters for the Operator.') c.argument('operator_instance_name', help='Instance name of the Operator.') c.argument('operator_namespace', help='Namespace in which to install the Operator.') c.argument('operator_type', - help='''Optional. Type of the operator. Valid value is 'flux'.''') + help='''Type of the operator. Valid value is 'flux'.''') with self.argument_context('k8sconfiguration list') as c: c.argument('sourcecontrolconfiguration', sourcecontrolconfiguration_type, id_part=None) From eea6c6664adb8ed72680795db06be6b189c9130f Mon Sep 17 00:00:00 2001 From: nanthi Date: Thu, 23 Apr 2020 11:44:05 -0700 Subject: [PATCH 15/20] Remove azure-cli-core dependency --- src/k8sconfiguration/setup.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/k8sconfiguration/setup.py b/src/k8sconfiguration/setup.py index 2b05a5001fc..fa2142e0d88 100644 --- a/src/k8sconfiguration/setup.py +++ b/src/k8sconfiguration/setup.py @@ -33,9 +33,7 @@ ] # TODO: Add any additional SDK dependencies here -DEPENDENCIES = [ - 'azure-cli-core' -] +DEPENDENCIES = [] with open('README.rst', 'r', encoding='utf-8') as f: README = f.read() From e542f32229907530774e5fbf1d481832c9c70ce7 Mon Sep 17 00:00:00 2001 From: nanthi Date: Tue, 5 May 2020 18:51:39 -0700 Subject: [PATCH 16/20] Pulled new version of sdk, and help text update --- .../azext_k8sconfiguration/_help.py | 34 ++++----- .../azext_k8sconfiguration/_params.py | 20 +++--- .../azext_k8sconfiguration/custom.py | 71 ++++++++++++------- .../vendored_sdks/models/_models.py | 3 +- .../vendored_sdks/models/_models_py3.py | 3 +- ...urce_control_configuration_client_enums.py | 2 + 6 files changed, 78 insertions(+), 55 deletions(-) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/_help.py b/src/k8sconfiguration/azext_k8sconfiguration/_help.py index 9d7ae1355ab..0ed38a02f2a 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/_help.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/_help.py @@ -9,60 +9,60 @@ helps['k8sconfiguration'] = """ type: group - short-summary: Commands to manage K8sconfigurations. + short-summary: Commands to manage Kubernetes configuration. """ helps['k8sconfiguration create'] = """ type: command - short-summary: Create a K8sconfiguration. + short-summary: Create a Kubernetes configuration. examples: - - name: Create a k8sconfiguration + - name: Create a Kubernetes configuration text: |- az k8sconfiguration create --resource-group MyResourceGroup --cluster-name MyClusterName \\ - --cluster-type 'connectedClusters' --name MyConfigurationName --operator-instance-name OperatorInst01 \\ + --cluster-type connectedClusters --name MyConfigurationName --operator-instance-name OperatorInst01 \\ --operator-namespace OperatorNamespace01 --repository-url git://github.com/fluxHowTo/flux-get-started \\ --operator-params "'--git-readonly'" --enable-helm-operator --helm-operator-version 0.6.0 \\ - --helm-operator-params '--set helm.versions=v3' + --scope namespace --helm-operator-params '--set helm.versions=v3' """ helps['k8sconfiguration list'] = """ type: command - short-summary: List K8sconfigurations. + short-summary: List Kubernetes configurations. examples: - - name: List all k8sconfigurations of a cluster + - name: List all Kubernetes configurations of a cluster text: |- az k8sconfiguration list --resource-group MyResourceGroup --cluster-name MyClusterName \\ - --cluster-type 'connectedClusters' + --cluster-type connectedClusters """ helps['k8sconfiguration delete'] = """ type: command - short-summary: Delete a K8sconfiguration. + short-summary: Delete a Kubernetes configuration. examples: - - name: Delete a k8sconfiguration + - name: Delete a Kubernetes configuration text: |- az k8sconfiguration delete --resource-group MyResourceGroup --cluster-name MyClusterName \\ - --cluster-type 'connectedClusters' --name MyConfigurationName + --cluster-type connectedClusters --name MyConfigurationName """ helps['k8sconfiguration show'] = """ type: command - short-summary: Show details of a K8sconfiguration. + short-summary: Show details of a Kubernetes configuration. examples: - - name: Show a k8sconfiguration + - name: Show a Kubernetes configuration text: |- az k8sconfiguration show --resource-group MyResourceGroup --cluster-name MyClusterName \\ - --cluster-type 'connectedClusters' --name MyConfigurationName + --cluster-type connectedClusters --name MyConfigurationName """ helps['k8sconfiguration update'] = """ type: command - short-summary: Update a K8sconfiguration. + short-summary: Update a Kubernetes configuration. examples: - - name: Update an existing k8sconfiguration + - name: Update an existing Kubernetes configuration text: |- az k8sconfiguration update --resource-group MyResourceGroup --cluster-name MyClusterName \\ - --cluster-type 'connectedClusters' --name MyConfigurationName --enable-helm-operator \\ + --cluster-type connectedClusters --name MyConfigurationName --enable-helm-operator \\ --repository-url git://github.com/fluxHowTo/flux-get-started --operator-params "'--git-readonly'" \\ --helm-operator-version 0.6.0 --helm-operator-params '--set helm.versions=v3' """ diff --git a/src/k8sconfiguration/azext_k8sconfiguration/_params.py b/src/k8sconfiguration/azext_k8sconfiguration/_params.py index 1e3844bac06..088836c434b 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/_params.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/_params.py @@ -17,7 +17,7 @@ def load_arguments(self, _): - sourcecontrolconfiguration_type = CLIArgumentType(help='Name of the K8sconfiguration.') + sourcecontrolconfiguration_type = CLIArgumentType(help='Name of the Kubernetes Configuration') with self.argument_context('k8sconfiguration') as c: c.argument('tags', tags_type) @@ -25,28 +25,28 @@ def load_arguments(self, _): c.argument('name', sourcecontrolconfiguration_type, options_list=['--name', '-n']) 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']), - help='Specify Arc clusters (default) or AKS clusters.') + help='Specify Arc clusters or AKS managed clusters.') c.argument('repository_url', options_list=['--repository-url', '-u'], - help='Url of the sourceControl repository') + help='Url of the source control repository') c.argument('enable_helm_operator', arg_type=get_three_state_flag(), help='Enable support for Helm chart deployments') - c.argument('cluster_scoped', action='store_true', - help='''Switch to set scope of the operator to be cluster. Default scope is 'namespace'.''') + c.argument('scope', arg_type=get_enum_type(['namespace', 'cluster']), + help='''Specify scope of the operator to be 'namespace' or 'cluster' ''') c.argument('configuration_type', validator=validate_configuration_type, arg_type=get_enum_type(['sourceControlConfiguration']), help='Type of the configuration') c.argument('helm_operator_params', help='Chart values for the Helm Operator (if enabled)') c.argument('helm_operator_version', - help='''Chart version of the Helm Operator, if enabled. Default:'0.2.0'.''') + help='Chart version of the Helm Operator (if enabled)') c.argument('operator_params', - help='Parameters for the Operator.') + help='Parameters for the Operator') c.argument('operator_instance_name', - help='Instance name of the Operator.') + help='Instance name of the Operator') c.argument('operator_namespace', - help='Namespace in which to install the Operator.') + help='Namespace in which to install the Operator') c.argument('operator_type', - help='''Type of the operator. Valid value is 'flux'.''') + help='''Type of the operator. Valid value is 'flux' ''') with self.argument_context('k8sconfiguration list') as c: c.argument('sourcecontrolconfiguration', sourcecontrolconfiguration_type, id_part=None) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/custom.py b/src/k8sconfiguration/azext_k8sconfiguration/custom.py index a0aada1b539..10e342ab95a 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/custom.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/custom.py @@ -7,35 +7,44 @@ from azext_k8sconfiguration.vendored_sdks.models import SourceControlConfiguration from azext_k8sconfiguration.vendored_sdks.models import HelmOperatorProperties +from azext_k8sconfiguration.vendored_sdks.models import ErrorResponse, ErrorResponseException - -def show_k8sconfiguration(client, resource_group_name, cluster_name, name, cluster_type='connectedClusters'): +def show_k8sconfiguration(client, resource_group_name, cluster_name, name, cluster_type): """Get an existing Kubernetes Source Control Configuration. """ # Determine ClusterRP cluster_rp = __get_cluster_type(cluster_type) - source_control_configuration_name = name - - return client.get(resource_group_name, cluster_rp, cluster_type, cluster_name, source_control_configuration_name) - - -def create_k8sconfiguration(client, resource_group_name, cluster_name, name, repository_url, - operator_instance_name=None, operator_namespace='default', cluster_type='connectedClusters', - operator_params='', cluster_scoped=None, operator_type='flux', enable_helm_operator=None, - helm_operator_version='0.2.0', helm_operator_params=''): + try: + config = client.get(resource_group_name, cluster_rp, cluster_type, cluster_name, name) + return __fix_compliance_state(config) + except ErrorResponseException 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 = "(ConfigurationNotFound) The Resource {0}/{1}/{2}/Microsoft.KubernetesConfiguration/" \ + "sourcecontrolConfigurations/{3} could not be found!".format(cluster_rp, cluster_type, + cluster_name, name) + else: + message = ex.message + raise CLIError(message) + + +def create_k8sconfiguration(client, resource_group_name, cluster_name, name, repository_url, scope, cluster_type, + operator_instance_name=None, operator_namespace='default', helm_operator_version='0.3.0', + operator_type='flux', operator_params='', enable_helm_operator=None, + helm_operator_params=''): """Create a new Kubernetes Source Control Configuration. """ # Determine ClusterRP cluster_rp = __get_cluster_type(cluster_type) - # Determine operatorScope - operator_scope = '' - if cluster_scoped is None: - operator_scope = 'namespace' - # Determine operatorInstanceName if operator_instance_name is None: operator_instance_name = name @@ -54,16 +63,18 @@ def create_k8sconfiguration(client, resource_group_name, cluster_name, name, rep operator_instance_name=operator_instance_name, operator_type=operator_type, operator_params=operator_params, - operator_scope=operator_scope, + operator_scope=scope, enable_helm_operator=enable_helm_operator, helm_operator_properties=helm_operator_properties) # Try to create the resource - return client.create_or_update(resource_group_name, cluster_rp, cluster_type, cluster_name, + config = client.create_or_update(resource_group_name, cluster_rp, cluster_type, cluster_name, name, source_control_configuration) + return __fix_compliance_state(config) -def update_k8sconfiguration(client, resource_group_name, cluster_name, name, cluster_type='connectedClusters', + +def update_k8sconfiguration(client, resource_group_name, cluster_name, name, cluster_type, repository_url=None, operator_params=None, enable_helm_operator=None, helm_operator_version=None, helm_operator_params=None): """Create a new Kubernetes Source Control Configuration. @@ -103,16 +114,18 @@ def update_k8sconfiguration(client, resource_group_name, cluster_name, name, clu if update_yes is False: raise CLIError('Invalid update. No values to update!') - return client.create_or_update(resource_group_name, cluster_rp, cluster_type, cluster_name, + config = client.create_or_update(resource_group_name, cluster_rp, cluster_type, cluster_name, source_control_configuration_name, config) + return __fix_compliance_state(config) + -def list_k8sconfiguration(client, resource_group_name, cluster_name, cluster_type='connectedClusters'): +def list_k8sconfiguration(client, resource_group_name, cluster_name, cluster_type): cluster_rp = __get_cluster_type(cluster_type) return client.list(resource_group_name, cluster_rp, cluster_type, cluster_name) -def delete_k8sconfiguration(client, resource_group_name, cluster_name, name, cluster_type='connectedClusters'): +def delete_k8sconfiguration(client, resource_group_name, cluster_name, name, cluster_type): """Delete an existing Kubernetes Source Control Configuration. """ @@ -121,10 +134,7 @@ def delete_k8sconfiguration(client, resource_group_name, cluster_name, name, clu source_control_configuration_name = name - custom_headers = {"x-ms-force": "true"} - - return client.delete(resource_group_name, cluster_rp, cluster_type, cluster_name, source_control_configuration_name, - custom_headers) + return client.delete(resource_group_name, cluster_rp, cluster_type, cluster_name, source_control_configuration_name) def __get_cluster_type(cluster_type): @@ -132,3 +142,12 @@ def __get_cluster_type(cluster_type): return 'Microsoft.Kubernetes' # Since cluster_type is an enum of only two values, if not connectedClusters, it will be managedClusters. return 'Microsoft.ContainerService' + +def __fix_compliance_state(config): + # If we get Compliant/NonCompliant as compliance_sate, change them before returning + if config.compliance_status.compliance_state.lower() == 'noncompliant': + config.compliance_status.compliance_state = 'Failed' + elif config.compliance_status.compliance_state.lower() == 'compliant': + config.compliance_status.compliance_state = 'Installed' + + return config \ No newline at end of file diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_models.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_models.py index 598e347d713..390ef245874 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_models.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_models.py @@ -28,7 +28,8 @@ class ComplianceStatus(Model): sending a request. :ivar compliance_state: The compliance state of the configuration. - Possible values include: 'Pending', 'Compliant', 'Noncompliant' + Possible values include: 'Pending', 'Compliant', 'Noncompliant', + 'Installed', 'Failed' :vartype compliance_state: str or ~azure.mgmt.kubernetesconfiguration.models.ComplianceState :param last_config_applied: Datetime the configuration was last applied. diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_models_py3.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_models_py3.py index 367929e4828..67d46fffa37 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_models_py3.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_models_py3.py @@ -28,7 +28,8 @@ class ComplianceStatus(Model): sending a request. :ivar compliance_state: The compliance state of the configuration. - Possible values include: 'Pending', 'Compliant', 'Noncompliant' + Possible values include: 'Pending', 'Compliant', 'Noncompliant', + 'Installed', 'Failed' :vartype compliance_state: str or ~azure.mgmt.kubernetesconfiguration.models.ComplianceState :param last_config_applied: Datetime the configuration was last applied. diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_source_control_configuration_client_enums.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_source_control_configuration_client_enums.py index 08ec38590e2..17114fbca71 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_source_control_configuration_client_enums.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_source_control_configuration_client_enums.py @@ -17,6 +17,8 @@ class ComplianceState(str, Enum): pending = "Pending" compliant = "Compliant" noncompliant = "Noncompliant" + installed = "Installed" + failed = "Failed" class MessageLevel(str, Enum): From 7ae5817ae7991048f39a1626f4562a8e0e219fc7 Mon Sep 17 00:00:00 2001 From: nanthi Date: Tue, 5 May 2020 21:02:06 -0700 Subject: [PATCH 17/20] Updated test and other style fixes --- .../azext_k8sconfiguration/custom.py | 10 +-- .../recordings/test_k8sconfiguration.yaml | 64 +++++++++---------- .../test_kubernetesconfiguration_scenario.py | 23 ++++--- 3 files changed, 52 insertions(+), 45 deletions(-) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/custom.py b/src/k8sconfiguration/azext_k8sconfiguration/custom.py index 10e342ab95a..87abba4c89a 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/custom.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/custom.py @@ -9,6 +9,7 @@ from azext_k8sconfiguration.vendored_sdks.models import HelmOperatorProperties from azext_k8sconfiguration.vendored_sdks.models import ErrorResponse, ErrorResponseException + def show_k8sconfiguration(client, resource_group_name, cluster_name, name, cluster_type): """Get an existing Kubernetes Source Control Configuration. @@ -69,7 +70,7 @@ def create_k8sconfiguration(client, resource_group_name, cluster_name, name, rep # Try to create the resource config = client.create_or_update(resource_group_name, cluster_rp, cluster_type, cluster_name, - name, source_control_configuration) + name, source_control_configuration) return __fix_compliance_state(config) @@ -114,8 +115,8 @@ def update_k8sconfiguration(client, resource_group_name, cluster_name, name, clu if update_yes is False: raise CLIError('Invalid update. No values to update!') - config = client.create_or_update(resource_group_name, cluster_rp, cluster_type, cluster_name, - source_control_configuration_name, config) + config = client.create_or_update(resource_group_name, cluster_rp, cluster_type, cluster_name, + source_control_configuration_name, config) return __fix_compliance_state(config) @@ -143,6 +144,7 @@ def __get_cluster_type(cluster_type): # Since cluster_type is an enum of only two values, if not connectedClusters, it will be managedClusters. return 'Microsoft.ContainerService' + def __fix_compliance_state(config): # If we get Compliant/NonCompliant as compliance_sate, change them before returning if config.compliance_status.compliance_state.lower() == 'noncompliant': @@ -150,4 +152,4 @@ def __fix_compliance_state(config): elif config.compliance_status.compliance_state.lower() == 'compliant': config.compliance_status.compliance_state = 'Installed' - return config \ No newline at end of file + return config diff --git a/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/recordings/test_k8sconfiguration.yaml b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/recordings/test_k8sconfiguration.yaml index ff6b756ea90..fbc3c5f4468 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/recordings/test_k8sconfiguration.yaml +++ b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/recordings/test_k8sconfiguration.yaml @@ -11,7 +11,7 @@ interactions: Connection: - keep-alive ParameterSetName: - - -g --cluster-name + - -g --cluster-name --cluster-type User-Agent: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 azure-mgmt-kubernetesconfiguration/0.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 @@ -21,7 +21,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations?api-version=2019-11-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0406a","name":"config0406a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0406a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0505e","name":"config0505e","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0505e-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/anagg929/ContosoSecurityPolicies","operatorInstanceName":"config0505e-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0505d","name":"config0505d","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0505d-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/anagg929/ContosoSecurityPolicies","operatorInstanceName":"config0505d-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0505c","name":"config0505c","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0505c-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/anagg929/ContosoSecurityPolicies","operatorInstanceName":"config0505c-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-branch=master''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0406a","name":"config0406a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0406a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set helm.versions=v3"},"repositoryUrl":"git://github.com/config0406a/flux-get-started","operatorInstanceName":"config0406a-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403d","name":"config0403d","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403d-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set helm.versions=v3"},"repositoryUrl":"git://github.com/config0403d/flux-get-started","operatorInstanceName":"config0403d-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403c","name":"config0403c","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403c-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set helm.versions=v3"},"repositoryUrl":"git://github.com/config0403c/flux-get-started","operatorInstanceName":"config0403c-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403b","name":"config0403b","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403b-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set @@ -38,11 +38,11 @@ interactions: cache-control: - no-cache content-length: - - '11187' + - '14012' content-type: - application/json; charset=utf-8 date: - - Thu, 23 Apr 2020 01:24:54 GMT + - Wed, 06 May 2020 03:58:56 GMT expires: - '-1' pragma: @@ -62,7 +62,7 @@ interactions: message: OK - request: body: '{"properties": {"repositoryUrl": "git://github.com/anubhav929/flux-get-started", - "operatorNamespace": "cliTestConfig0422A-opns", "operatorInstanceName": "cliTestconfig0422A-opin", + "operatorNamespace": "cliTestConfig0505A-opns", "operatorInstanceName": "cliTestconfig0505A-opin", "operatorType": "flux", "operatorParams": "--git-readonly ", "operatorScope": "namespace", "enableHelmOperator": "True", "helmOperatorProperties": {"chartVersion": "0.6.0", "chartValues": "--set git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"}}}' @@ -80,20 +80,20 @@ interactions: Content-Type: - application/json; charset=utf-8 ParameterSetName: - - -g -n -c -u --operator-instance-name --operator-namespace --operator-params - --git-readonly --enable-helm-operator --helm-operator-version --helm-operator-params - --set git.ssh.secretName + - -g -n -c -u --cluster-type --scope --operator-instance-name --operator-namespace + --operator-params --git-readonly --enable-helm-operator --helm-operator-version + --helm-operator-params --set git.ssh.secretName User-Agent: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 azure-mgmt-kubernetesconfiguration/0.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0422A?api-version=2019-11-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0505A?api-version=2019-11-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0422A","name":"cliTestConfig0422A","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cliTestConfig0422A-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set - git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cliTestconfig0422A-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0505A","name":"cliTestConfig0505A","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cliTestConfig0505A-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cliTestconfig0505A-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}}' headers: api-supported-versions: @@ -105,11 +105,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 23 Apr 2020 01:24:54 GMT + - Wed, 06 May 2020 03:58:58 GMT expires: - '-1' location: - - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0422A + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0505A pragma: - no-cache server: @@ -135,7 +135,7 @@ interactions: Connection: - keep-alive ParameterSetName: - - -g --cluster-name + - -g --cluster-name --cluster-type User-Agent: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 azure-mgmt-kubernetesconfiguration/0.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 @@ -145,9 +145,9 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations?api-version=2019-11-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/clitestconfig0422a","name":"clitestconfig0422a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cliTestConfig0422A-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set - git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cliTestconfig0422A-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly - ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0406a","name":"config0406a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0406a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/clitestconfig0505a","name":"clitestconfig0505a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cliTestConfig0505A-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cliTestconfig0505A-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly + ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0505e","name":"config0505e","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0505e-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/anagg929/ContosoSecurityPolicies","operatorInstanceName":"config0505e-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0505d","name":"config0505d","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0505d-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/anagg929/ContosoSecurityPolicies","operatorInstanceName":"config0505d-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0505c","name":"config0505c","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0505c-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/anagg929/ContosoSecurityPolicies","operatorInstanceName":"config0505c-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-branch=master''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0406a","name":"config0406a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0406a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set helm.versions=v3"},"repositoryUrl":"git://github.com/config0406a/flux-get-started","operatorInstanceName":"config0406a-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403d","name":"config0403d","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403d-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set helm.versions=v3"},"repositoryUrl":"git://github.com/config0403d/flux-get-started","operatorInstanceName":"config0403d-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403c","name":"config0403c","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403c-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set helm.versions=v3"},"repositoryUrl":"git://github.com/config0403c/flux-get-started","operatorInstanceName":"config0403c-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403b","name":"config0403b","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403b-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set @@ -164,11 +164,11 @@ interactions: cache-control: - no-cache content-length: - - '12289' + - '15114' content-type: - application/json; charset=utf-8 date: - - Thu, 23 Apr 2020 01:24:55 GMT + - Wed, 06 May 2020 03:58:59 GMT expires: - '-1' pragma: @@ -198,18 +198,18 @@ interactions: Connection: - keep-alive ParameterSetName: - - -g -c -n + - -g -c -n --cluster-type User-Agent: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 azure-mgmt-kubernetesconfiguration/0.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 accept-language: - en-US method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0422A?api-version=2019-11-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0505A?api-version=2019-11-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0422A","name":"cliTestConfig0422A","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cliTestConfig0422A-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set - git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cliTestconfig0422A-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0505A","name":"cliTestConfig0505A","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cliTestConfig0505A-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cliTestconfig0505A-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}}' headers: api-supported-versions: @@ -221,7 +221,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 23 Apr 2020 01:24:56 GMT + - Wed, 06 May 2020 03:59:00 GMT expires: - '-1' pragma: @@ -253,16 +253,14 @@ interactions: Content-Length: - '0' ParameterSetName: - - -g -c -n -y + - -g -c -n --cluster-type -y User-Agent: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 azure-mgmt-kubernetesconfiguration/0.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 accept-language: - en-US - x-ms-force: - - 'true' method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0422A?api-version=2019-11-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0505A?api-version=2019-11-01-preview response: body: string: '{"version":"1.1","content":null,"statusCode":200,"reasonPhrase":"OK","headers":[],"trailingHeaders":[],"requestMessage":null,"isSuccessStatusCode":true}' @@ -276,7 +274,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 23 Apr 2020 01:24:59 GMT + - Wed, 06 May 2020 03:59:02 GMT expires: - '-1' pragma: @@ -308,7 +306,7 @@ interactions: Connection: - keep-alive ParameterSetName: - - -g --cluster-name + - -g --cluster-name --cluster-type User-Agent: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 azure-mgmt-kubernetesconfiguration/0.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 @@ -318,7 +316,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations?api-version=2019-11-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0406a","name":"config0406a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0406a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0505e","name":"config0505e","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0505e-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/anagg929/ContosoSecurityPolicies","operatorInstanceName":"config0505e-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0505d","name":"config0505d","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0505d-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/anagg929/ContosoSecurityPolicies","operatorInstanceName":"config0505d-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0505c","name":"config0505c","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0505c-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/anagg929/ContosoSecurityPolicies","operatorInstanceName":"config0505c-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-branch=master''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0406a","name":"config0406a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0406a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set helm.versions=v3"},"repositoryUrl":"git://github.com/config0406a/flux-get-started","operatorInstanceName":"config0406a-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403d","name":"config0403d","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403d-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set helm.versions=v3"},"repositoryUrl":"git://github.com/config0403d/flux-get-started","operatorInstanceName":"config0403d-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403c","name":"config0403c","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403c-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set helm.versions=v3"},"repositoryUrl":"git://github.com/config0403c/flux-get-started","operatorInstanceName":"config0403c-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403b","name":"config0403b","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403b-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set @@ -335,11 +333,11 @@ interactions: cache-control: - no-cache content-length: - - '11187' + - '14012' content-type: - application/json; charset=utf-8 date: - - Thu, 23 Apr 2020 01:25:00 GMT + - Wed, 06 May 2020 03:59:02 GMT expires: - '-1' pragma: diff --git a/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py index 424189dbc10..16fce68767e 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py @@ -16,16 +16,19 @@ class K8sconfigurationScenarioTest(ScenarioTest): @record_only() def test_k8sconfiguration(self): self.kwargs.update({ - 'name': 'cliTestConfig0422A', + 'name': 'cliTestConfig0505A', 'cluster_name': 'matrived-tpcomi', 'rg': 'haikudevtesting', 'repo_url': 'git://github.com/anubhav929/flux-get-started', - 'operator_instance_name': 'cliTestconfig0422A-opin', - 'operator_namespace': 'cliTestConfig0422A-opns' + 'operator_instance_name': 'cliTestconfig0505A-opin', + 'operator_namespace': 'cliTestConfig0505A-opns', + 'cluster_type': 'connectedClusters', + 'scope': 'namespace' }) # List Configurations and get the count - config_count = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {cluster_name}').get_output_in_json()) + config_count = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {cluster_name} ' + '--cluster-type {cluster_type}').get_output_in_json()) self.greater_than(config_count, 10) # Create a configuration @@ -33,6 +36,8 @@ def test_k8sconfiguration(self): -n {name} -c {cluster_name} -u {repo_url} + --cluster-type {cluster_type} + --scope {scope} --operator-instance-name {operator_instance_name} --operator-namespace {operator_namespace} --operator-params \"--git-readonly \" @@ -50,11 +55,12 @@ def test_k8sconfiguration(self): ]) # List the configurations again to see if we have one additional - new_count = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {cluster_name}').get_output_in_json()) + new_count = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {cluster_name} ' + '--cluster-type {cluster_type}').get_output_in_json()) self.assertEqual(new_count, config_count + 1) # Get the configuration created - self.cmd('k8sconfiguration show -g {rg} -c {cluster_name} -n {name}', + self.cmd('k8sconfiguration show -g {rg} -c {cluster_name} -n {name} --cluster-type {cluster_type}', checks=[ self.check('name', '{name}'), self.check('resourceGroup', '{rg}'), @@ -66,8 +72,9 @@ def test_k8sconfiguration(self): ]) # Delete the created configuration - self.cmd('k8sconfiguration delete -g {rg} -c {cluster_name} -n {name} -y') + self.cmd('k8sconfiguration delete -g {rg} -c {cluster_name} -n {name} --cluster-type {cluster_type} -y') # List Configurations and confirm the count is the same as we started - new_count = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {cluster_name}').get_output_in_json()) + new_count = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {cluster_name} ' + '--cluster-type {cluster_type}').get_output_in_json()) self.assertEqual(new_count, config_count) From e8f520055746753c9d4ea27e477d95babb38041b Mon Sep 17 00:00:00 2001 From: nanthi Date: Wed, 6 May 2020 09:34:30 -0700 Subject: [PATCH 18/20] Removed unused import --- src/k8sconfiguration/azext_k8sconfiguration/custom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/custom.py b/src/k8sconfiguration/azext_k8sconfiguration/custom.py index 87abba4c89a..60292c05269 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/custom.py +++ b/src/k8sconfiguration/azext_k8sconfiguration/custom.py @@ -7,7 +7,7 @@ from azext_k8sconfiguration.vendored_sdks.models import SourceControlConfiguration from azext_k8sconfiguration.vendored_sdks.models import HelmOperatorProperties -from azext_k8sconfiguration.vendored_sdks.models import ErrorResponse, ErrorResponseException +from azext_k8sconfiguration.vendored_sdks.models import ErrorResponseException def show_k8sconfiguration(client, resource_group_name, cluster_name, name, cluster_type): From 479d2992f7b6b263d396b0816438f23585b90002 Mon Sep 17 00:00:00 2001 From: nanthi Date: Wed, 13 May 2020 22:27:58 -0700 Subject: [PATCH 19/20] Update min Cli core version --- src/k8sconfiguration/azext_k8sconfiguration/azext_metadata.json | 2 +- src/k8sconfiguration/setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/azext_metadata.json b/src/k8sconfiguration/azext_k8sconfiguration/azext_metadata.json index 55c81bf3328..9fe7559499c 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/azext_metadata.json +++ b/src/k8sconfiguration/azext_k8sconfiguration/azext_metadata.json @@ -1,4 +1,4 @@ { "azext.isPreview": true, - "azext.minCliCoreVersion": "2.0.67" + "azext.minCliCoreVersion": "2.3" } \ No newline at end of file diff --git a/src/k8sconfiguration/setup.py b/src/k8sconfiguration/setup.py index fa2142e0d88..17b8070b62c 100644 --- a/src/k8sconfiguration/setup.py +++ b/src/k8sconfiguration/setup.py @@ -16,7 +16,7 @@ # TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. -VERSION = '0.1.7' +VERSION = '0.1.8' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers From ff1f84857b186de14e144c6acbf34dcb3c767f68 Mon Sep 17 00:00:00 2001 From: nanthi Date: Thu, 14 May 2020 07:51:04 -0700 Subject: [PATCH 20/20] Added revision to the updated minCliCoreVersion --- src/k8sconfiguration/azext_k8sconfiguration/azext_metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/azext_metadata.json b/src/k8sconfiguration/azext_k8sconfiguration/azext_metadata.json index 9fe7559499c..8cfc6da9485 100644 --- a/src/k8sconfiguration/azext_k8sconfiguration/azext_metadata.json +++ b/src/k8sconfiguration/azext_k8sconfiguration/azext_metadata.json @@ -1,4 +1,4 @@ { "azext.isPreview": true, - "azext.minCliCoreVersion": "2.3" + "azext.minCliCoreVersion": "2.3.1" } \ No newline at end of file