From 5e310067532586ac87c67726edd07ed05f0c30f5 Mon Sep 17 00:00:00 2001 From: Anumita Shenoy Date: Fri, 2 Apr 2021 08:58:52 +0530 Subject: [PATCH 1/6] Changed param names for azrbac (#3210) --- src/connectedk8s/azext_connectedk8s/_constants.py | 2 +- src/connectedk8s/azext_connectedk8s/_help.py | 2 +- src/connectedk8s/azext_connectedk8s/_params.py | 4 ++-- src/connectedk8s/azext_connectedk8s/custom.py | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/connectedk8s/azext_connectedk8s/_constants.py b/src/connectedk8s/azext_connectedk8s/_constants.py index b7fb6ac514a..56ae91c6de8 100644 --- a/src/connectedk8s/azext_connectedk8s/_constants.py +++ b/src/connectedk8s/azext_connectedk8s/_constants.py @@ -95,7 +95,7 @@ Operate_RG_Cluster_Name_Conflict = 'The provided cluster name and rg correspond to different cluster being operated on' Custom_Locations_Registration_Check_Fault_Type = "Error while checking resource provider registration of custom locations." Custom_Locations_OID_Fetch_Fault_Type = "Error while fetching oid for custom locations." -Client_Details_Not_Provided_For_Azure_RBAC_Fault = 'Client ID or secret not provided for Azure RBAC' +Application_Details_Not_Provided_For_Azure_RBAC_Fault = 'Application ID or secret not provided for Azure RBAC' Successfully_Enabled_Features = 'Successsfully enabled features: {} for the Connected Cluster {}' Successfully_Disabled_Features = 'Successsfully disabled features: {} for the Connected Cluster {}' Error_enabling_Features = 'Error while updating agents for enabling features. Please run \"kubectl get pods -n azure-arc\" to check the pods in case of timeout error. Error: {}' diff --git a/src/connectedk8s/azext_connectedk8s/_help.py b/src/connectedk8s/azext_connectedk8s/_help.py index 8f41bb82ed6..3aa3e46e5d9 100644 --- a/src/connectedk8s/azext_connectedk8s/_help.py +++ b/src/connectedk8s/azext_connectedk8s/_help.py @@ -103,7 +103,7 @@ - name: Enables the Cluster-Connect feature. text: az connectedk8s enable-features -n clusterName -g resourceGroupName --features cluster-connect - name: Enable Azure RBAC feature. - text: az connectedk8s enable-features -n clusterName -g resourceGroupName --features azure-rbac --client-id clientID --client-secret="clientSecret" --skip-azure-rbac-list "user1@domain.com,spn_oid" + text: az connectedk8s enable-features -n clusterName -g resourceGroupName --features azure-rbac --app-id appID --app-secret="appSecret" --skip-azure-rbac-list "user1@domain.com,spn_oid" - name: Enable multiple features. text: az connectedk8s enable-features -n clusterName -g resourceGroupName --features cluster-connect custom-locations """ diff --git a/src/connectedk8s/azext_connectedk8s/_params.py b/src/connectedk8s/azext_connectedk8s/_params.py index 12e4fc53c84..6c65e12e92f 100644 --- a/src/connectedk8s/azext_connectedk8s/_params.py +++ b/src/connectedk8s/azext_connectedk8s/_params.py @@ -56,8 +56,8 @@ def load_arguments(self, _): c.argument('kube_config', options_list=['--kube-config'], help='Path to the kube config file.') c.argument('kube_context', options_list=['--kube-context'], help='Kubconfig context from current machine.') c.argument('features', features_types, options_list=['--features'], help='Space-separated list of features you want to enable.') - c.argument('azrbac_client_id', options_list=['--client-id'], arg_group='Azure RBAC', help='Client ID for enabling Azure RBAC. Specify when enabling azure-rbac.') - c.argument('azrbac_client_secret', options_list=['--client-secret'], arg_group='Azure RBAC', help='Client secret for enabling Azure RBAC. Specify when enabling azure-rbac.') + c.argument('azrbac_client_id', options_list=['--app-id'], arg_group='Azure RBAC', help='Application ID for enabling Azure RBAC. Specify when enabling azure-rbac.') + c.argument('azrbac_client_secret', options_list=['--app-secret'], arg_group='Azure RBAC', help='Application secret for enabling Azure RBAC. Specify when enabling azure-rbac.') c.argument('azrbac_skip_authz_check', options_list=['--skip-azure-rbac-list'], arg_group='Azure RBAC', help='Comma separated list of names of usernames/email/oid. Azure RBAC will be skipped for these users. Specify when enabling azure-rbac.') with self.argument_context('connectedk8s disable-features') as c: diff --git a/src/connectedk8s/azext_connectedk8s/custom.py b/src/connectedk8s/azext_connectedk8s/custom.py index 47ee5efbd21..3f9ff6f9d9b 100644 --- a/src/connectedk8s/azext_connectedk8s/custom.py +++ b/src/connectedk8s/azext_connectedk8s/custom.py @@ -1163,9 +1163,9 @@ def enable_features(cmd, client, resource_group_name, cluster_name, features, ku if enable_azure_rbac: if (azrbac_client_id is None) or (azrbac_client_secret is None): telemetry.set_user_fault() - telemetry.set_exception(exception='Client ID or secret is not provided for Azure RBAC', fault_type=consts.Client_Details_Not_Provided_For_Azure_RBAC_Fault, - summary='Client id, client secret is required to enable/update Azure RBAC feature') - raise CLIError("Please provide client id, client secret to enable/update Azure RBAC feature") + telemetry.set_exception(exception='Application ID or secret is not provided for Azure RBAC', fault_type=consts.Application_Details_Not_Provided_For_Azure_RBAC_Fault, + summary='Application id, application secret is required to enable/update Azure RBAC feature') + raise CLIError("Please provide Application id, application secret to enable/update Azure RBAC feature") if azrbac_skip_authz_check is None: azrbac_skip_authz_check = "" azrbac_skip_authz_check = escape_proxy_settings(azrbac_skip_authz_check) From dc7b8ff0423fc18ec45c4f079b853ccb979936f3 Mon Sep 17 00:00:00 2001 From: Azure CLI Bot Date: Fri, 2 Apr 2021 13:04:18 +0800 Subject: [PATCH 2/6] [Release] Update index.json for extension [ connectedk8s ] (#3219) --- src/index.json | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/index.json b/src/index.json index 1b779c90ec3..a86dba23385 100644 --- a/src/index.json +++ b/src/index.json @@ -6036,6 +6036,58 @@ "version": "1.0.0" }, "sha256Digest": "9eb34e10523ee5bbd9a4be03915532da7acc3be11631fb646807085c09380c59" + }, + { + "downloadUrl": "https://azcliprod.blob.core.windows.net/cli-extensions/connectedk8s-1.1.0-py2.py3-none-any.whl", + "filename": "connectedk8s-1.1.0-py2.py3-none-any.whl", + "metadata": { + "azext.minCliCoreVersion": "2.16.0", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "License :: OSI Approved :: MIT License" + ], + "description_content_type": "text/markdown", + "extensions": { + "python.details": { + "contacts": [ + { + "email": "k8connect@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions/tree/master/src/connectedk8s" + } + } + }, + "extras": [], + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "connectedk8s", + "run_requires": [ + { + "requires": [ + "kubernetes (==11.0.0)", + "pycryptodome (==3.9.8)" + ] + } + ], + "summary": "Microsoft Azure Command-Line Tools Connectedk8s Extension", + "version": "1.1.0" + }, + "sha256Digest": "47b871998ac7c3b90689c8cfef18d1d1c9a77d04fabd64a0071504dd434af5c8" } ], "connectedmachine": [ From ee901d9a72770bbcb8f7d1eec65cffd949df03ab Mon Sep 17 00:00:00 2001 From: Feiyue Yu Date: Fri, 2 Apr 2021 19:47:23 +0800 Subject: [PATCH 3/6] New extension cloudservice (#3142) * cloudservice * help, test * test * rename, test * help * --role, --load-balancer-configurations * secrets * extensions * help * help&test * style, linter, test * style * codeowners * Fix a None bug * Update help and example * style * help * update * help --- .github/CODEOWNERS | 2 + src/cloudservice/HISTORY.rst | 8 + src/cloudservice/README.md | 38 ++ .../azext_cloudservice/__init__.py | 50 +++ src/cloudservice/azext_cloudservice/action.py | 17 + .../azext_cloudservice/azext_metadata.json | 4 + src/cloudservice/azext_cloudservice/custom.py | 17 + .../azext_cloudservice/generated/__init__.py | 12 + .../generated/_client_factory.py | 32 ++ .../azext_cloudservice/generated/_help.py | 236 ++++++++++++ .../azext_cloudservice/generated/_params.py | 204 +++++++++++ .../generated/_validators.py | 9 + .../azext_cloudservice/generated/action.py | 10 + .../azext_cloudservice/generated/commands.py | 90 +++++ .../azext_cloudservice/generated/custom.py | 302 ++++++++++++++++ .../azext_cloudservice/manual/__init__.py | 12 + .../azext_cloudservice/manual/_help.py | 187 ++++++++++ .../azext_cloudservice/manual/_params.py | 56 +++ .../azext_cloudservice/manual/custom.py | 145 ++++++++ .../azext_cloudservice/tests/__init__.py | 116 ++++++ .../tests/latest/__init__.py | 12 + .../test_cloud_service_Scenario.yaml | 60 ++++ .../latest/test_cloud_service_scenario.py | 74 ++++ src/cloudservice/gen.zip | Bin 0 -> 14106 bytes src/cloudservice/report.md | 340 ++++++++++++++++++ src/cloudservice/setup.cfg | 1 + src/cloudservice/setup.py | 60 ++++ 27 files changed, 2094 insertions(+) create mode 100644 src/cloudservice/HISTORY.rst create mode 100644 src/cloudservice/README.md create mode 100644 src/cloudservice/azext_cloudservice/__init__.py create mode 100644 src/cloudservice/azext_cloudservice/action.py create mode 100644 src/cloudservice/azext_cloudservice/azext_metadata.json create mode 100644 src/cloudservice/azext_cloudservice/custom.py create mode 100644 src/cloudservice/azext_cloudservice/generated/__init__.py create mode 100644 src/cloudservice/azext_cloudservice/generated/_client_factory.py create mode 100644 src/cloudservice/azext_cloudservice/generated/_help.py create mode 100644 src/cloudservice/azext_cloudservice/generated/_params.py create mode 100644 src/cloudservice/azext_cloudservice/generated/_validators.py create mode 100644 src/cloudservice/azext_cloudservice/generated/action.py create mode 100644 src/cloudservice/azext_cloudservice/generated/commands.py create mode 100644 src/cloudservice/azext_cloudservice/generated/custom.py create mode 100644 src/cloudservice/azext_cloudservice/manual/__init__.py create mode 100644 src/cloudservice/azext_cloudservice/manual/_help.py create mode 100644 src/cloudservice/azext_cloudservice/manual/_params.py create mode 100644 src/cloudservice/azext_cloudservice/manual/custom.py create mode 100644 src/cloudservice/azext_cloudservice/tests/__init__.py create mode 100644 src/cloudservice/azext_cloudservice/tests/latest/__init__.py create mode 100644 src/cloudservice/azext_cloudservice/tests/latest/recordings/test_cloud_service_Scenario.yaml create mode 100644 src/cloudservice/azext_cloudservice/tests/latest/test_cloud_service_scenario.py create mode 100644 src/cloudservice/gen.zip create mode 100644 src/cloudservice/report.md create mode 100644 src/cloudservice/setup.cfg create mode 100644 src/cloudservice/setup.py diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 435dbbae79f..ce1c386cc84 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -189,3 +189,5 @@ /src/next/ @zhoxing-ms /src/redisenterprise/ @greenms + +/src/cloudservice/ @qwordy diff --git a/src/cloudservice/HISTORY.rst b/src/cloudservice/HISTORY.rst new file mode 100644 index 00000000000..1c139576ba0 --- /dev/null +++ b/src/cloudservice/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. diff --git a/src/cloudservice/README.md b/src/cloudservice/README.md new file mode 100644 index 00000000000..7c681b31d27 --- /dev/null +++ b/src/cloudservice/README.md @@ -0,0 +1,38 @@ +# Azure CLI cloud-service Extension # +This is the extension for cloud-service. Refer to https://azure.microsoft.com/en-us/services/cloud-services/. + +### How to use ### +Install this extension using the below CLI command +``` +az extension add --name cloud-service +``` + +Get help of commands and subgroups. +``` +az cloud-service -h +az cloud-service role -h +az cloud-service role-instance -h +az cloud-service update-domain -h +``` + +Create a cloud service. +``` +az cloud-service create -g rg -n cs --roles ContosoFrontend:Standard_D1_v2:1:Standard ContosoBackend:Standard_D1_v2:1:Standard --package-url packageurl --configuration config --load-balancer-configurations myLoadBalancer:myfe:publicip:subnetid: myLoadBalancer2:myfe2:::privateip --secrets vault0:cert0:cert1 vault1:cert2:cert3:cert4 --extensions "@extensions.json" +``` + +`extensions.json` is a file that has the following content. Please replace values with your real values. +``` +[ + { + "properties": { + "type": "RDP", + "autoUpgradeMinorVersion": false, + "protectedSettings": "settings", + "publisher": "Microsoft.Windows.Azure.Extensions", + "settings": "settings", + "typeHandlerVersion": "1.2.1" + }, + "name": "RDPExtension" + } +] +``` diff --git a/src/cloudservice/azext_cloudservice/__init__.py b/src/cloudservice/azext_cloudservice/__init__.py new file mode 100644 index 00000000000..ca700c0298a --- /dev/null +++ b/src/cloudservice/azext_cloudservice/__init__.py @@ -0,0 +1,50 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader +from azext_cloudservice.generated._help import helps # pylint: disable=unused-import +try: + from azext_cloudservice.manual._help import helps # pylint: disable=reimported +except ImportError: + pass + + +class ComputeManagementClientCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_cloudservice.generated._client_factory import cf_cloud_service_cl + cloud_service_custom = CliCommandType( + operations_tmpl='azext_cloudservice.custom#{}', + client_factory=cf_cloud_service_cl) + parent = super(ComputeManagementClientCommandsLoader, self) + parent.__init__(cli_ctx=cli_ctx, custom_command_type=cloud_service_custom) + + def load_command_table(self, args): + from azext_cloudservice.generated.commands import load_command_table + load_command_table(self, args) + try: + from azext_cloudservice.manual.commands import load_command_table as load_command_table_manual + load_command_table_manual(self, args) + except ImportError: + pass + return self.command_table + + def load_arguments(self, command): + from azext_cloudservice.generated._params import load_arguments + load_arguments(self, command) + try: + from azext_cloudservice.manual._params import load_arguments as load_arguments_manual + load_arguments_manual(self, command) + except ImportError: + pass + + +COMMAND_LOADER_CLS = ComputeManagementClientCommandsLoader diff --git a/src/cloudservice/azext_cloudservice/action.py b/src/cloudservice/azext_cloudservice/action.py new file mode 100644 index 00000000000..d95d53bf711 --- /dev/null +++ b/src/cloudservice/azext_cloudservice/action.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.action import * # noqa: F403 +try: + from .manual.action import * # noqa: F403 +except ImportError: + pass diff --git a/src/cloudservice/azext_cloudservice/azext_metadata.json b/src/cloudservice/azext_cloudservice/azext_metadata.json new file mode 100644 index 00000000000..cfc30c747c7 --- /dev/null +++ b/src/cloudservice/azext_cloudservice/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.15.0" +} \ No newline at end of file diff --git a/src/cloudservice/azext_cloudservice/custom.py b/src/cloudservice/azext_cloudservice/custom.py new file mode 100644 index 00000000000..dbe9d5f9742 --- /dev/null +++ b/src/cloudservice/azext_cloudservice/custom.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.custom import * # noqa: F403 +try: + from .manual.custom import * # noqa: F403 +except ImportError: + pass diff --git a/src/cloudservice/azext_cloudservice/generated/__init__.py b/src/cloudservice/azext_cloudservice/generated/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/cloudservice/azext_cloudservice/generated/__init__.py @@ -0,0 +1,12 @@ +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/cloudservice/azext_cloudservice/generated/_client_factory.py b/src/cloudservice/azext_cloudservice/generated/_client_factory.py new file mode 100644 index 00000000000..afcbd537633 --- /dev/null +++ b/src/cloudservice/azext_cloudservice/generated/_client_factory.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. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + + +def cf_cloud_service_cl(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from azure.mgmt.compute import ComputeManagementClient + return get_mgmt_service_client(cli_ctx, + ComputeManagementClient) + + +def cf_cloud_service_role_instance(cli_ctx, *_): + return cf_cloud_service_cl(cli_ctx).cloud_service_role_instances + + +def cf_cloud_service_role(cli_ctx, *_): + return cf_cloud_service_cl(cli_ctx).cloud_service_roles + + +def cf_cloud_service(cli_ctx, *_): + return cf_cloud_service_cl(cli_ctx).cloud_services + + +def cf_cloud_service_update_domain(cli_ctx, *_): + return cf_cloud_service_cl(cli_ctx).cloud_services_update_domain diff --git a/src/cloudservice/azext_cloudservice/generated/_help.py b/src/cloudservice/azext_cloudservice/generated/_help.py new file mode 100644 index 00000000000..aedc028d496 --- /dev/null +++ b/src/cloudservice/azext_cloudservice/generated/_help.py @@ -0,0 +1,236 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from knack.help_files import helps + + +helps['cloud-service role-instance'] = """ + type: group + short-summary: Manage cloud service role instance with cloud service +""" + +helps['cloud-service role-instance list'] = """ + type: command + short-summary: "Gets the list of all role instances in a cloud service. Use nextLink property in the response to \ +get the next page of role instances. Do this till nextLink is null to fetch all the role instances." +""" + +helps['cloud-service role-instance show'] = """ + type: command + short-summary: "Gets a role instance from a cloud service." +""" + +helps['cloud-service role-instance delete'] = """ + type: command + short-summary: "Deletes a role instance from a cloud service." +""" + +helps['cloud-service role-instance rebuild'] = """ + type: command + short-summary: "The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of \ +web roles or worker roles and initializes the storage resources that are used by them. If you do not want to \ +initialize storage resources, you can use Reimage Role Instance." +""" + +helps['cloud-service role-instance reimage'] = """ + type: command + short-summary: "The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of \ +web roles or worker roles." +""" + +helps['cloud-service role-instance restart'] = """ + type: command + short-summary: "The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud \ +service." +""" + +helps['cloud-service role-instance show-instance-view'] = """ + type: command + short-summary: "Retrieves information about the run-time state of a role instance in a cloud service." +""" + +helps['cloud-service role-instance show-remote-desktop-file'] = """ + type: command + short-summary: "Gets a remote desktop file for a role instance in a cloud service." +""" + +helps['cloud-service role-instance wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the cloud-service role-instance is met. + examples: + - name: Pause executing next line of CLI script until the cloud-service role-instance is successfully deleted. + - name: Pause executing next line of CLI script until the cloud-service role-instance is successfully created. +""" + +helps['cloud-service role'] = """ + type: group + short-summary: Manage cloud service role with cloud service +""" + +helps['cloud-service role list'] = """ + type: command + short-summary: "Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next \ +page of roles. Do this till nextLink is null to fetch all the roles." +""" + +helps['cloud-service role show'] = """ + type: command + short-summary: "Gets a role from a cloud service." +""" + +helps['cloud-service'] = """ + type: group + short-summary: Manage cloud service +""" + +helps['cloud-service list'] = """ + type: command + short-summary: "Gets a list of all cloud services under a resource group. Use nextLink property in the response to \ +get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services." +""" + +helps['cloud-service show'] = """ + type: command + short-summary: "Display information about a cloud service." +""" + +helps['cloud-service create'] = """ + type: command + short-summary: "Create a cloud service. Please note some properties can be set only during cloud service \ +creation." + examples: + - name: Create New Cloud Service with Multiple Roles + text: |- + az cloud-service create --name "{cs-name}" --location "westus" --configuration "{ServiceConfiguration}" \ +--load-balancer-configurations "[{\\"name\\":\\"contosolb\\",\\"properties\\":{\\"frontendIPConfigurations\\":[{\\"name\ +\\":\\"contosofe\\",\\"properties\\":{\\"publicIPAddress\\":{\\"id\\":\\"/subscriptions/{subscription-id}/resourceGroup\ +s/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip\\"}}}]}}]" --package-url "{PackageUrl}" \ +--roles "[{\\"name\\":\\"ContosoFrontend\\",\\"sku\\":{\\"name\\":\\"Standard_D1_v2\\",\\"capacity\\":1,\\"tier\\":\\"S\ +tandard\\"}},{\\"name\\":\\"ContosoBackend\\",\\"sku\\":{\\"name\\":\\"Standard_D1_v2\\",\\"capacity\\":1,\\"tier\\":\\\ +"Standard\\"}}]" --upgrade-mode "Auto" --resource-group "ConstosoRG" + - name: Create New Cloud Service with Single Role + text: |- + az cloud-service create --name "{cs-name}" --location "westus" --configuration "{ServiceConfiguration}" \ +--load-balancer-configurations "[{\\"name\\":\\"myLoadBalancer\\",\\"properties\\":{\\"frontendIPConfigurations\\":[{\\\ +"name\\":\\"myfe\\",\\"properties\\":{\\"publicIPAddress\\":{\\"id\\":\\"/subscriptions/{subscription-id}/resourceGroup\ +s/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP\\"}}}]}}]" --package-url "{PackageUrl}" --roles \ +"[{\\"name\\":\\"ContosoFrontend\\",\\"sku\\":{\\"name\\":\\"Standard_D1_v2\\",\\"capacity\\":1,\\"tier\\":\\"Standard\ +\\"}}]" --upgrade-mode "Auto" --resource-group "ConstosoRG" + - name: Create New Cloud Service with Single Role and Certificate from Key Vault + text: |- + az cloud-service create --name "{cs-name}" --location "westus" --configuration "{ServiceConfiguration}" \ +--load-balancer-configurations "[{\\"name\\":\\"contosolb\\",\\"properties\\":{\\"frontendIPConfigurations\\":[{\\"name\ +\\":\\"contosofe\\",\\"properties\\":{\\"publicIPAddress\\":{\\"id\\":\\"/subscriptions/{subscription-id}/resourceGroup\ +s/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip\\"}}}]}}]" --secrets \ +"[{\\"sourceVault\\":{\\"id\\":\\"/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVau\ +lt/vaults/{keyvault-name}\\"},\\"vaultCertificates\\":[{\\"certificateUrl\\":\\"https://{keyvault-name}.vault.azure.net\ +:443/secrets/ContosoCertificate/{secret-id}\\"}]}]" --package-url "{PackageUrl}" --roles \ +"[{\\"name\\":\\"ContosoFrontend\\",\\"sku\\":{\\"name\\":\\"Standard_D1_v2\\",\\"capacity\\":1,\\"tier\\":\\"Standard\ +\\"}}]" --upgrade-mode "Auto" --resource-group "ConstosoRG" + - name: Create New Cloud Service with Single Role and RDP Extension + text: |- + az cloud-service create --name "{cs-name}" --location "westus" --configuration "{ServiceConfiguration}" \ +--extensions "[{\\"name\\":\\"RDPExtension\\",\\"properties\\":{\\"type\\":\\"RDP\\",\\"autoUpgradeMinorVersion\\":fals\ +e,\\"protectedSettings\\":\\"{password}\\",\\"publisher\\":\\"Micro\ +soft.Windows.Azure.Extensions\\",\\"settings\\":\\"UserAzure10/22/2021 \ +15:05:45\\",\\"typeHandlerVersion\\":\\"1.2.1\\"}}]" --load-balancer-configurations \ +"[{\\"name\\":\\"contosolb\\",\\"properties\\":{\\"frontendIPConfigurations\\":[{\\"name\\":\\"contosofe\\",\\"properti\ +es\\":{\\"publicIPAddress\\":{\\"id\\":\\"/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsof\ +t.Network/publicIPAddresses/contosopublicip\\"}}}]}}]" --package-url "{PackageUrl}" --roles \ +"[{\\"name\\":\\"ContosoFrontend\\",\\"sku\\":{\\"name\\":\\"Standard_D1_v2\\",\\"capacity\\":1,\\"tier\\":\\"Standard\ +\\"}}]" --upgrade-mode "Auto" --resource-group "ConstosoRG" +""" + +helps['cloud-service update'] = """ + type: command + short-summary: "Update a cloud service." +""" + +helps['cloud-service delete'] = """ + type: command + short-summary: "Deletes a cloud service." +""" + +helps['cloud-service delete-instance'] = """ + type: command + short-summary: "Deletes role instances in a cloud service." +""" + +helps['cloud-service list-all'] = """ + type: command + short-summary: "Gets a list of all cloud services in the subscription, regardless of the associated resource \ +group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to \ +fetch all the Cloud Services." +""" + +helps['cloud-service power-off'] = """ + type: command + short-summary: "Power off the cloud service. Note that resources are still attached and you are getting charged \ +for the resources." +""" + +helps['cloud-service rebuild'] = """ + type: command + short-summary: "Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles \ +and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you \ +can use Reimage Role Instances." +""" + +helps['cloud-service reimage'] = """ + type: command + short-summary: "Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker \ +roles." +""" + +helps['cloud-service restart'] = """ + type: command + short-summary: "Restarts one or more role instances in a cloud service." +""" + +helps['cloud-service show-instance-view'] = """ + type: command + short-summary: "Gets the status of a cloud service." +""" + +helps['cloud-service start'] = """ + type: command + short-summary: "Starts the cloud service." +""" + +helps['cloud-service wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the cloud-service is met. + examples: + - name: Pause executing next line of CLI script until the cloud-service is successfully created. + - name: Pause executing next line of CLI script until the cloud-service is successfully updated. + - name: Pause executing next line of CLI script until the cloud-service is successfully deleted. +""" + +helps['cloud-service update-domain'] = """ + type: group + short-summary: Manage cloud service update domain with cloud service +""" + +helps['cloud-service update-domain list-update-domain'] = """ + type: command + short-summary: "Gets a list of all update domains in a cloud service." +""" + +helps['cloud-service update-domain show-update-domain'] = """ + type: command + short-summary: "Gets the specified update domain of a cloud service. Use nextLink property in the response to get \ +the next page of update domains. Do this till nextLink is null to fetch all the update domains." +""" + +helps['cloud-service update-domain walk-update-domain'] = """ + type: command + short-summary: "Updates the role instances in the specified update domain." +""" diff --git a/src/cloudservice/azext_cloudservice/generated/_params.py b/src/cloudservice/azext_cloudservice/generated/_params.py new file mode 100644 index 00000000000..9c63faa5f3d --- /dev/null +++ b/src/cloudservice/azext_cloudservice/generated/_params.py @@ -0,0 +1,204 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from azure.cli.core.commands.parameters import ( + tags_type, + get_three_state_flag, + get_enum_type, + resource_group_name_type, + get_location_type +) +from azure.cli.core.commands.validators import ( + get_default_location_from_resource_group, + validate_file_or_dict +) + + +def load_arguments(self, _): + + # All "cloud_service_name" miss help + with self.argument_context('cloud-service role-instance list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', type=str, help='Cloud service name.') + + with self.argument_context('cloud-service role-instance show') as c: + c.argument('role_instance_name', type=str, help='Name of the role instance.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', type=str, help='Cloud service name.', id_part='name') + + with self.argument_context('cloud-service role-instance delete') as c: + c.argument('role_instance_name', type=str, help='Name of the role instance.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', type=str, help='Cloud service name.', id_part='name') + + with self.argument_context('cloud-service role-instance rebuild') as c: + c.argument('role_instance_name', type=str, help='Name of the role instance.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', type=str, help='Cloud service name.', id_part='name') + + with self.argument_context('cloud-service role-instance reimage') as c: + c.argument('role_instance_name', type=str, help='Name of the role instance.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', type=str, help='Cloud service name.', id_part='name') + + with self.argument_context('cloud-service role-instance restart') as c: + c.argument('role_instance_name', type=str, help='Name of the role instance.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', type=str, help='Cloud service name.', id_part='name') + + with self.argument_context('cloud-service role-instance show-instance-view') as c: + c.argument('role_instance_name', type=str, help='Name of the role instance.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', type=str, help='Cloud service name.', id_part='name') + + with self.argument_context('cloud-service role-instance show-remote-desktop-file') as c: + c.argument('role_instance_name', type=str, help='Name of the role instance.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', type=str, help='Cloud service name.', id_part='name') + + with self.argument_context('cloud-service role-instance wait') as c: + c.argument('role_instance_name', type=str, help='Name of the role instance.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', type=str, help='Cloud service name.', id_part='name') + + with self.argument_context('cloud-service role list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', type=str, help='Cloud service name.') + + with self.argument_context('cloud-service role show') as c: + c.argument('role_name', type=str, help='Name of the role.', id_part='child_name_1') + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', type=str, help='Cloud service name.', id_part='name') + + with self.argument_context('cloud-service list') as c: + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('cloud-service show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', options_list=['--name', '-n', '--cloud-service-name'], type=str, help='Name ' + 'of the cloud service.', id_part='name') + + with self.argument_context('cloud-service create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', options_list=['--name', '-n', '--cloud-service-name'], type=str, help='Name ' + 'of the cloud service.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('package_url', type=str, help='Specifies a URL that refers to the location of the service package ' + 'in the Blob service. The service package URL can be Shared Access Signature (SAS) URI from any ' + 'storage account. This is a write-only property and is not returned in GET calls.') + c.argument('configuration', type=str, help='Specifies the XML service configuration (.cscfg) for the cloud ' + 'service.') + c.argument('configuration_url', type=str, help='Specifies a URL that refers to the location of the service ' + 'configuration in the Blob service. The service package URL can be Shared Access Signature (SAS) ' + 'URI from any storage account. This is a write-only property and is not returned in GET calls.') + c.argument('start_cloud_service', arg_type=get_three_state_flag(), help='(Optional) Indicates whether to start ' + 'the cloud service immediately after it is created. The default value is `true`. If false, the ' + 'service model is still deployed, but the code is not run immediately. Instead, the service is ' + 'PoweredOff until you call Start, at which time the service will be started. A deployed service ' + 'still incurs charges, even if it is poweredoff.') + c.argument('upgrade_mode', arg_type=get_enum_type(['Auto', 'Manual', 'Simultaneous']), help='Update mode for ' + 'the cloud service. Role instances are allocated to update domains when the service is deployed. ' + 'Updates can be initiated manually in each update domain or initiated automatically in all update ' + 'domains. Possible Values are

**Auto**

**Manual**

**Simultaneous**

If not specified, the default value is Auto. If set to Manual, PUT ' + 'UpdateDomain must be called to apply the update. If set to Auto, the update is automatically ' + 'applied to each update domain in sequence.') + c.argument('extensions', type=validate_file_or_dict, help='List of extensions for the cloud service. Expected ' + 'value: json-string/@json-file.', arg_group='Extension Profile') + c.argument('load_balancer_configurations', type=validate_file_or_dict, help='The list of load balancer ' + 'configurations for the cloud service. Expected value: json-string/@json-file.', arg_group='Network ' + 'Profile') + c.argument('id_', options_list=['--id'], type=str, help='Resource Id', arg_group='Network Profile Swappable ' + 'Cloud Service') + c.argument('secrets', type=validate_file_or_dict, help='Specifies set of certificates that should be installed ' + 'onto the role instances. Expected value: json-string/@json-file.', arg_group='Os Profile') + c.argument('roles', type=validate_file_or_dict, help='List of roles for the cloud service. Expected value: ' + 'json-string/@json-file.', arg_group='Role Profile') + + with self.argument_context('cloud-service update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', options_list=['--name', '-n', '--cloud-service-name'], type=str, help='Name ' + 'of the cloud service.', id_part='name') + c.argument('tags', tags_type) + + with self.argument_context('cloud-service delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', options_list=['--name', '-n', '--cloud-service-name'], type=str, help='Name ' + 'of the cloud service.', id_part='name') + + with self.argument_context('cloud-service delete-instance') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', options_list=['--name', '-n', '--cloud-service-name'], type=str, help='Name ' + 'of the cloud service.', id_part='name') + c.argument('role_instances', nargs='+', help='List of cloud service role instance names. Value of \'*\' will ' + 'signify all role instances of the cloud service.') + + with self.argument_context('cloud-service power-off') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', options_list=['--name', '-n', '--cloud-service-name'], type=str, help='Name ' + 'of the cloud service.', id_part='name') + + with self.argument_context('cloud-service rebuild') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', options_list=['--name', '-n', '--cloud-service-name'], type=str, help='Name ' + 'of the cloud service.', id_part='name') + c.argument('role_instances', nargs='+', help='List of cloud service role instance names. Value of \'*\' will ' + 'signify all role instances of the cloud service.') + + with self.argument_context('cloud-service reimage') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', options_list=['--name', '-n', '--cloud-service-name'], type=str, help='Name ' + 'of the cloud service.', id_part='name') + c.argument('role_instances', nargs='+', help='List of cloud service role instance names. Value of \'*\' will ' + 'signify all role instances of the cloud service.') + + with self.argument_context('cloud-service restart') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', options_list=['--name', '-n', '--cloud-service-name'], type=str, help='Name ' + 'of the cloud service.', id_part='name') + c.argument('role_instances', nargs='+', help='List of cloud service role instance names. Value of \'*\' will ' + 'signify all role instances of the cloud service.') + + with self.argument_context('cloud-service show-instance-view') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', options_list=['--name', '-n', '--cloud-service-name'], type=str, help='Name ' + 'of the cloud service.', id_part='name') + + with self.argument_context('cloud-service start') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', options_list=['--name', '-n', '--cloud-service-name'], type=str, help='Name ' + 'of the cloud service.', id_part='name') + + with self.argument_context('cloud-service wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', options_list=['--name', '-n', '--cloud-service-name'], type=str, help='Name ' + 'of the cloud service.', id_part='name') + + with self.argument_context('cloud-service update-domain list-update-domain') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', type=str, help='Name of the cloud service.') + + with self.argument_context('cloud-service update-domain show-update-domain') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', type=str, help='Name of the cloud service.', id_part='name') + c.argument('update_domain', type=int, help='Specifies an integer value that identifies the update domain. ' + 'Update domains are identified with a zero-based index: the first update domain has an ID of 0, the ' + 'second has an ID of 1, and so on.', id_part='child_name_1') + + with self.argument_context('cloud-service update-domain walk-update-domain') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cloud_service_name', type=str, help='Name of the cloud service.', id_part='name') + c.argument('update_domain', type=int, help='Specifies an integer value that identifies the update domain. ' + 'Update domains are identified with a zero-based index: the first update domain has an ID of 0, the ' + 'second has an ID of 1, and so on.', id_part='child_name_1') diff --git a/src/cloudservice/azext_cloudservice/generated/_validators.py b/src/cloudservice/azext_cloudservice/generated/_validators.py new file mode 100644 index 00000000000..b33a44c1ebf --- /dev/null +++ b/src/cloudservice/azext_cloudservice/generated/_validators.py @@ -0,0 +1,9 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- diff --git a/src/cloudservice/azext_cloudservice/generated/action.py b/src/cloudservice/azext_cloudservice/generated/action.py new file mode 100644 index 00000000000..b49bfaeeefe --- /dev/null +++ b/src/cloudservice/azext_cloudservice/generated/action.py @@ -0,0 +1,10 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access diff --git a/src/cloudservice/azext_cloudservice/generated/commands.py b/src/cloudservice/azext_cloudservice/generated/commands.py new file mode 100644 index 00000000000..0e233379382 --- /dev/null +++ b/src/cloudservice/azext_cloudservice/generated/commands.py @@ -0,0 +1,90 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-statements +# pylint: disable=too-many-locals +# pylint: disable=line-too-long + +from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): + + from azext_cloudservice.generated._client_factory import cf_cloud_service_role_instance + + cloud_service_cloud_service_role_instance = CliCommandType( + operations_tmpl='azure.mgmt.compute.operations._cloud_service_role_instances_operations#CloudServiceRoleInstancesOperations.{}', + client_factory=cf_cloud_service_role_instance, + ) + # Generated code has indent error + with self.command_group( + 'cloud-service role-instance', + cloud_service_cloud_service_role_instance, + client_factory=cf_cloud_service_role_instance, + ) as g: + g.custom_command('list', 'cloud_service_role_instance_list') + g.custom_show_command('show', 'cloud_service_role_instance_show') + g.custom_command('delete', 'cloud_service_role_instance_delete', supports_no_wait=True, confirmation=True) + g.custom_command('rebuild', 'cloud_service_role_instance_rebuild', supports_no_wait=True) + g.custom_command('reimage', 'cloud_service_role_instance_reimage', supports_no_wait=True) + g.custom_command('restart', 'cloud_service_role_instance_restart', supports_no_wait=True) + g.custom_command('show-instance-view', 'cloud_service_role_instance_show_instance_view') + g.custom_command('show-remote-desktop-file', 'cloud_service_role_instance_show_remote_desktop_file') + g.custom_wait_command('wait', 'cloud_service_role_instance_show') + + from azext_cloudservice.generated._client_factory import cf_cloud_service_role + + cloud_service_cloud_service_role = CliCommandType( + operations_tmpl='azure.mgmt.compute.operations._cloud_service_roles_operations#CloudServiceRolesOperations.{}', + client_factory=cf_cloud_service_role, + ) + with self.command_group( + 'cloud-service role', cloud_service_cloud_service_role, client_factory=cf_cloud_service_role + ) as g: + g.custom_command('list', 'cloud_service_role_list') + g.custom_show_command('show', 'cloud_service_role_show') + + from azext_cloudservice.generated._client_factory import cf_cloud_service + + cloud_service_cloud_service = CliCommandType( + operations_tmpl='azure.mgmt.compute.operations._cloud_services_operations#CloudServicesOperations.{}', + client_factory=cf_cloud_service, + ) + with self.command_group( + 'cloud-service', cloud_service_cloud_service, client_factory=cf_cloud_service, is_experimental=True + ) as g: + g.custom_command('list', 'cloud_service_list') + g.custom_show_command('show', 'cloud_service_show') + g.custom_command('create', 'cloud_service_create', supports_no_wait=True) + g.custom_command('update', 'cloud_service_update', supports_no_wait=True) + g.custom_command('delete', 'cloud_service_delete', supports_no_wait=True, confirmation=True) + g.custom_command('delete-instance', 'cloud_service_delete_instance', supports_no_wait=True) + g.custom_command('list-all', 'cloud_service_list_all') + g.custom_command('power-off', 'cloud_service_power_off', supports_no_wait=True) + g.custom_command('rebuild', 'cloud_service_rebuild', supports_no_wait=True) + g.custom_command('reimage', 'cloud_service_reimage', supports_no_wait=True) + g.custom_command('restart', 'cloud_service_restart', supports_no_wait=True) + g.custom_command('show-instance-view', 'cloud_service_show_instance_view') + g.custom_command('start', 'cloud_service_start', supports_no_wait=True) + g.custom_wait_command('wait', 'cloud_service_show') + + from azext_cloudservice.generated._client_factory import cf_cloud_service_update_domain + + cloud_service_cloud_service_update_domain = CliCommandType( + operations_tmpl='azure.mgmt.compute.operations._cloud_services_update_domain_operations#CloudServicesUpdateDomainOperations.{}', + client_factory=cf_cloud_service_update_domain, + ) + with self.command_group( + 'cloud-service update-domain', + cloud_service_cloud_service_update_domain, + client_factory=cf_cloud_service_update_domain, + ) as g: + g.custom_command('list-update-domain', 'cloud_service_update_domain_list_update_domain') + g.custom_command('show-update-domain', 'cloud_service_update_domain_show_update_domain') + g.custom_command('walk-update-domain', 'cloud_service_update_domain_walk_update_domain') diff --git a/src/cloudservice/azext_cloudservice/generated/custom.py b/src/cloudservice/azext_cloudservice/generated/custom.py new file mode 100644 index 00000000000..7dfe8fcdea5 --- /dev/null +++ b/src/cloudservice/azext_cloudservice/generated/custom.py @@ -0,0 +1,302 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from azure.cli.core.util import sdk_no_wait + + +def cloud_service_role_instance_list(client, + resource_group_name, + cloud_service_name): + return client.list(resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name) + + +def cloud_service_role_instance_show(client, + role_instance_name, + resource_group_name, + cloud_service_name): + return client.get(role_instance_name=role_instance_name, + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name) + + +def cloud_service_role_instance_delete(client, + role_instance_name, + resource_group_name, + cloud_service_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + role_instance_name=role_instance_name, + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name) + + +def cloud_service_role_instance_rebuild(client, + role_instance_name, + resource_group_name, + cloud_service_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_rebuild, + role_instance_name=role_instance_name, + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name) + + +def cloud_service_role_instance_reimage(client, + role_instance_name, + resource_group_name, + cloud_service_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_reimage, + role_instance_name=role_instance_name, + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name) + + +def cloud_service_role_instance_restart(client, + role_instance_name, + resource_group_name, + cloud_service_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_restart, + role_instance_name=role_instance_name, + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name) + + +def cloud_service_role_instance_show_instance_view(client, + role_instance_name, + resource_group_name, + cloud_service_name): + return client.get_instance_view(role_instance_name=role_instance_name, + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name) + + +def cloud_service_role_instance_show_remote_desktop_file(client, + role_instance_name, + resource_group_name, + cloud_service_name): + return client.get_remote_desktop_file(role_instance_name=role_instance_name, + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name) + + +def cloud_service_role_list(client, + resource_group_name, + cloud_service_name): + return client.list(resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name) + + +def cloud_service_role_show(client, + role_name, + resource_group_name, + cloud_service_name): + return client.get(role_name=role_name, + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name) + + +def cloud_service_list(client, + resource_group_name): + return client.list(resource_group_name=resource_group_name) + + +def cloud_service_show(client, + resource_group_name, + cloud_service_name): + return client.get(resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name) + + +def cloud_service_create(client, + resource_group_name, + cloud_service_name, + location=None, + tags=None, + package_url=None, + configuration=None, + configuration_url=None, + start_cloud_service=None, + upgrade_mode=None, + extensions=None, + load_balancer_configurations=None, + id_=None, + secrets=None, + roles=None, + no_wait=False): + parameters = {} + parameters['location'] = location + parameters['tags'] = tags + parameters['properties'] = {} + parameters['properties']['package_url'] = package_url + parameters['properties']['configuration'] = configuration + parameters['properties']['configuration_url'] = configuration_url + parameters['properties']['start_cloud_service'] = start_cloud_service + parameters['properties']['upgrade_mode'] = upgrade_mode + parameters['properties']['extension_profile'] = {} + parameters['properties']['extension_profile']['extensions'] = extensions + parameters['properties']['network_profile'] = {} + parameters['properties']['network_profile']['load_balancer_configurations'] = load_balancer_configurations + parameters['properties']['network_profile']['swappable_cloud_service'] = {} + parameters['properties']['network_profile']['swappable_cloud_service']['id'] = id_ + parameters['properties']['os_profile'] = {} + parameters['properties']['os_profile']['secrets'] = secrets + parameters['properties']['role_profile'] = {} + parameters['properties']['role_profile']['roles'] = roles + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + parameters=parameters) + + +def cloud_service_update(client, + resource_group_name, + cloud_service_name, + tags=None, + no_wait=False): + parameters = {} + parameters['tags'] = tags + return sdk_no_wait(no_wait, + client.begin_update, + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + parameters=parameters) + + +def cloud_service_delete(client, + resource_group_name, + cloud_service_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name) + + +def cloud_service_delete_instance(client, + resource_group_name, + cloud_service_name, + role_instances=None, + no_wait=False): + parameters = {} + parameters['role_instances'] = role_instances + return sdk_no_wait(no_wait, + client.begin_delete_instances, + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + parameters=parameters) + + +def cloud_service_list_all(client): + return client.list_all() + + +def cloud_service_power_off(client, + resource_group_name, + cloud_service_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_power_off, + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name) + + +def cloud_service_rebuild(client, + resource_group_name, + cloud_service_name, + role_instances=None, + no_wait=False): + parameters = {} + parameters['role_instances'] = role_instances + return sdk_no_wait(no_wait, + client.begin_rebuild, + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + parameters=parameters) + + +def cloud_service_reimage(client, + resource_group_name, + cloud_service_name, + role_instances=None, + no_wait=False): + parameters = {} + parameters['role_instances'] = role_instances + return sdk_no_wait(no_wait, + client.begin_reimage, + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + parameters=parameters) + + +def cloud_service_restart(client, + resource_group_name, + cloud_service_name, + role_instances=None, + no_wait=False): + parameters = {} + parameters['role_instances'] = role_instances + return sdk_no_wait(no_wait, + client.begin_restart, + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + parameters=parameters) + + +def cloud_service_show_instance_view(client, + resource_group_name, + cloud_service_name): + return client.get_instance_view(resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name) + + +def cloud_service_start(client, + resource_group_name, + cloud_service_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_start, + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name) + + +def cloud_service_update_domain_list_update_domain(client, + resource_group_name, + cloud_service_name): + return client.list_update_domains(resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name) + + +def cloud_service_update_domain_show_update_domain(client, + resource_group_name, + cloud_service_name, + update_domain): + return client.get_update_domain(resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + update_domain=update_domain) + + +def cloud_service_update_domain_walk_update_domain(client, + resource_group_name, + cloud_service_name, + update_domain): + parameters = {} + return client.begin_walk_update_domain(resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + update_domain=update_domain, + parameters=parameters) diff --git a/src/cloudservice/azext_cloudservice/manual/__init__.py b/src/cloudservice/azext_cloudservice/manual/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/cloudservice/azext_cloudservice/manual/__init__.py @@ -0,0 +1,12 @@ +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/cloudservice/azext_cloudservice/manual/_help.py b/src/cloudservice/azext_cloudservice/manual/_help.py new file mode 100644 index 00000000000..1deab5c8040 --- /dev/null +++ b/src/cloudservice/azext_cloudservice/manual/_help.py @@ -0,0 +1,187 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from knack.help_files import helps + + +helps['cloud-service role-instance'] = """ + type: group + short-summary: Manage cloud service role instance with cloud service +""" + +helps['cloud-service role-instance list'] = """ + type: command + short-summary: "Get the list of all role instances in a cloud service." +""" + +helps['cloud-service role-instance show'] = """ + type: command + short-summary: "Get a role instance from a cloud service." +""" + +helps['cloud-service role-instance delete'] = """ + type: command + short-summary: "Delete a role instance from a cloud service." +""" + +helps['cloud-service role-instance rebuild'] = """ + type: command + short-summary: "The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of \ +web roles or worker roles and initializes the storage resources that are used by them. If you do not want to \ +initialize storage resources, you can use Reimage Role Instance." +""" + +helps['cloud-service role-instance reimage'] = """ + type: command + short-summary: "The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of \ +web roles or worker roles." +""" + +helps['cloud-service role-instance restart'] = """ + type: command + short-summary: "The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud \ +service." +""" + +helps['cloud-service role-instance show-instance-view'] = """ + type: command + short-summary: "Retrieve information about the run-time state of a role instance in a cloud service." +""" + +helps['cloud-service role-instance show-remote-desktop-file'] = """ + type: command + short-summary: "Get a remote desktop file for a role instance in a cloud service." +""" + +helps['cloud-service role-instance wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the cloud-service role-instance \ +is met. +""" + +helps['cloud-service role'] = """ + type: group + short-summary: Manage cloud service role with cloud service +""" + +helps['cloud-service role list'] = """ + type: command + short-summary: "Get a list of all roles in a cloud service." +""" + +helps['cloud-service role show'] = """ + type: command + short-summary: "Get a role from a cloud service." +""" + +helps['cloud-service'] = """ + type: group + short-summary: Manage cloud service +""" + +helps['cloud-service list'] = """ + type: command + short-summary: "Get a list of all cloud services under a resource group." +""" + +helps['cloud-service show'] = """ + type: command + short-summary: "Display information about a cloud service." +""" + +helps['cloud-service create'] = """ + type: command + short-summary: "Create a cloud service (extended support). Please note some properties can be set only during cloud service creation." + examples: + - name: Create a cloud service with 2 roles, 2 load balancers (one has a public IP and another has a private IP), secrets and extensions. + text: |- + az cloud-service create -g ResourceGroup -n CloudService --roles ContosoFrontend:Standard_D1_v2:1:Standard ContosoBackend:Standard_D1_v2:1:Standard --package-url PackageURL --configuration Config --load-balancer-configurations MyLoadBalancer:MyFe:PublicIP:: MyLoadBalancer2:MyFe2::SubnetIDd:PrivateIPID --secrets Vault0:Cert0:Cert1 Vault1:Cert2:Cert3:Cert4 --extensions "@extensions.json" +""" + +helps['cloud-service update'] = """ + type: command + short-summary: "Update a cloud service." +""" + +helps['cloud-service delete'] = """ + type: command + short-summary: "Delete a cloud service." +""" + +helps['cloud-service delete-instance'] = """ + type: command + short-summary: "Delete role instances in a cloud service." +""" + +helps['cloud-service list-all'] = """ + type: command + short-summary: "Get a list of all cloud services in the subscription, regardless of the associated resource \ +group." +""" + +helps['cloud-service power-off'] = """ + type: command + short-summary: "Power off the cloud service. Note that resources are still attached and you are getting charged \ +for the resources." +""" + +helps['cloud-service rebuild'] = """ + type: command + short-summary: "Rebuild Role Instances. Reinstall the operating system on instances of web roles or worker roles \ +and initialize the storage resources that are used by them. If you do not want to initialize storage resources, you \ +can use Reimage Role Instances." +""" + +helps['cloud-service reimage'] = """ + type: command + short-summary: "Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker \ +roles." +""" + +helps['cloud-service restart'] = """ + type: command + short-summary: "Restart one or more role instances in a cloud service." +""" + +helps['cloud-service show-instance-view'] = """ + type: command + short-summary: "Get the status of a cloud service." +""" + +helps['cloud-service start'] = """ + type: command + short-summary: "Start the cloud service." +""" + +helps['cloud-service wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the cloud-service is met. +""" + +helps['cloud-service update-domain'] = """ + type: group + short-summary: Manage cloud service update domain with cloud service +""" + +helps['cloud-service update-domain list-update-domain'] = """ + type: command + short-summary: "Get a list of all update domains in a cloud service." +""" + +helps['cloud-service update-domain show-update-domain'] = """ + type: command + short-summary: "Get the specified update domain of a cloud service." +""" + +helps['cloud-service update-domain walk-update-domain'] = """ + type: command + short-summary: "Update the role instances in the specified update domain." +""" diff --git a/src/cloudservice/azext_cloudservice/manual/_params.py b/src/cloudservice/azext_cloudservice/manual/_params.py new file mode 100644 index 00000000000..c0d8aac8070 --- /dev/null +++ b/src/cloudservice/azext_cloudservice/manual/_params.py @@ -0,0 +1,56 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from azure.cli.core.commands.parameters import ( + get_enum_type, get_three_state_flag, file_type) +from azure.cli.core.commands.validators import validate_file_or_dict + + +def load_arguments(self, _): + + with self.argument_context('cloud-service create') as c: + c.argument('upgrade_mode', arg_type=get_enum_type(['Auto', 'Manual', 'Simultaneous']), help='Update mode for ' + 'the cloud service. Role instances are allocated to update domains when the service is deployed. ' + 'Updates can be initiated manually in each update domain or initiated automatically in all update ' + 'domains. Possible Values are Auto, Manual, Simultaneous. ' + 'If not specified, the default value is Auto. If set to Manual, PUT ' + 'UpdateDomain must be called to apply the update. If set to Auto, the update is automatically ' + 'applied to each update domain in sequence.') + c.argument('roles', nargs='+', help='List of roles separated by space for the cloud service. Format: ' + 'RoleName:SkuName:SkuCapacity:SkuTier.', + arg_group='Role Profile') + c.argument('load_balancer_configurations', nargs='+', arg_group='Network Profile', + options_list=['--load-balancer-configurations', '--lb'], + help='The list of load balancer configurations separated by space for the cloud service. ' + 'The public IP is a mandatory field. Format: ' + 'LBName:FrontendIPConfiguration:PublicIPAddress:Subnet:PrivateIP.') + c.argument('secrets', nargs='+', arg_group='Os Profile', + help='Specify certificates separated by space that should be installed onto the role instances. ' + 'Format: KeyVaultName:CertificateUrl:CertificateUrl2:...:CertificateUrlN') + c.argument('configuration', type=file_type, help='Specify the XML service configuration (.cscfg) ' + 'for the cloud service. Expected value: json-string/@json-file.') + c.argument('configuration_url', type=str, help='Specify a URL that refers to the location of the service ' + 'configuration in the Blob service. The service package URL can be Shared Access Signature (SAS) ' + 'URI from any storage account. This is a write-only property and is not returned in GET calls.') + c.argument('package_url', type=str, help='Specify a URL that refers to the location of the service package ' + 'in the Blob service. The service package URL can be Shared Access Signature (SAS) URI from any ' + 'storage account. This is a write-only property and is not returned in GET calls.') + c.argument('start_cloud_service', arg_type=get_three_state_flag(), help='Indicate whether to start ' + 'the cloud service immediately after it is created. The default value is `true`. If false, the ' + 'service model is still deployed, but the code is not run immediately. Instead, the service is ' + 'PoweredOff until you call Start, at which time the service will be started. A deployed service ' + 'still incurs charges, even if it is poweredoff.') + c.argument('extensions', type=validate_file_or_dict, arg_group='Extension Profile', + help='List of extensions for the cloud service. Expected value: json-string/@json-file. Example: ' + '[{"properties": {"type": "RDP", "autoUpgradeMinorVersion": false, "protectedSettings": "settings",' + '"publisher": "Microsoft.Windows.Azure.Extensions", "settings": "settings", ' + '"typeHandlerVersion": "1.2.1"}, "name": "RDPExtension"}]') diff --git a/src/cloudservice/azext_cloudservice/manual/custom.py b/src/cloudservice/azext_cloudservice/manual/custom.py new file mode 100644 index 00000000000..e56f51fca33 --- /dev/null +++ b/src/cloudservice/azext_cloudservice/manual/custom.py @@ -0,0 +1,145 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from azure.cli.core.util import sdk_no_wait + + +def cloud_service_create(cmd, + client, + resource_group_name, + cloud_service_name, + location=None, + tags=None, + package_url=None, + configuration=None, + configuration_url=None, + start_cloud_service=None, + upgrade_mode=None, + extensions=None, + load_balancer_configurations=None, + id_=None, + secrets=None, + roles=None, + no_wait=False): + parameters = {} + parameters['location'] = location + parameters['tags'] = tags + parameters['properties'] = {} + parameters['properties']['package_url'] = package_url + parameters['properties']['configuration'] = configuration + parameters['properties']['configuration_url'] = configuration_url + parameters['properties']['start_cloud_service'] = start_cloud_service + parameters['properties']['upgrade_mode'] = upgrade_mode + if extensions: + parameters['properties']['extension_profile'] = {} + parameters['properties']['extension_profile']['extensions'] = extensions + else: + parameters['properties']['extension_profile'] = None + parameters['properties']['network_profile'] = {} + parameters['properties']['network_profile']['load_balancer_configurations'] = _parse_lbs( + load_balancer_configurations, cmd, resource_group_name) + if id_: + parameters['properties']['network_profile']['swappable_cloud_service'] = {} + parameters['properties']['network_profile']['swappable_cloud_service']['id'] = id_ + else: + parameters['properties']['network_profile']['swappable_cloud_service'] = None + parameters['properties']['os_profile'] = {} + parameters['properties']['os_profile']['secrets'] = _parse_secrets( + secrets, cmd, resource_group_name) + parameters['properties']['role_profile'] = {} + parameters['properties']['role_profile']['roles'] = _parse_roles(roles) + return sdk_no_wait(no_wait, + client.begin_create_or_update, + resource_group_name=resource_group_name, + cloud_service_name=cloud_service_name, + parameters=parameters) + + +def _parse_roles(roles): + """ + Example, ContosoFrontend:Standard_D1_v2:1:Standard + :param roles: + :return: + """ + if not roles: + return None + roles_json = [] + for role in roles: + terms = role.split(':') + roles_json.append({ + 'sku': { + 'name': terms[1], + 'capacity': terms[2], + 'tier': terms[3] + }, + 'name': terms[0] + }) + return roles_json + + +def _parse_lbs(lbs, cmd, resource_group_name): + from msrestazure.tools import resource_id, is_valid_resource_id + from azure.cli.core.commands.client_factory import get_subscription_id + + if not lbs: + return None + lbs_json = [] + for lb in lbs: + terms = lb.split(':') + ip = terms[2] + subnet = terms[3] + private_ip = terms[4] + if ip and not is_valid_resource_id(ip): + ip = resource_id( + subscription=get_subscription_id(cmd.cli_ctx), resource_group=resource_group_name, + namespace='Microsoft.Network', type='publicIPAddresses', name=ip) + lbs_json.append({ + 'properties': { + 'frontendIPConfigurations': [ + { + 'properties': { + 'publicIPAddress': {'id': ip} if ip else None, + 'subnet': {'id': subnet} if subnet else None, + 'privateIPAddress': private_ip if private_ip else None + }, + 'name': terms[1] + } + ] + }, + 'name': terms[0] + }) + return lbs_json + + +def _parse_secrets(secrets, cmd, resource_group_name): + from msrestazure.tools import resource_id, is_valid_resource_id + from azure.cli.core.commands.client_factory import get_subscription_id + + if not secrets: + return None + secrets_json = [] + for secret in secrets: + terms = secret.split(':') + vault = terms[0] + certs = terms[1:] + if vault and not is_valid_resource_id(vault): + vault = resource_id( + subscription=get_subscription_id(cmd.cli_ctx), resource_group=resource_group_name, + namespace='Microsoft.KeyVault', type='vaults', name=vault) + secrets_json.append({ + 'sourceVault': { + 'id': vault + }, + 'vaultCertificates': [ + {'certificateUrl': cert} for cert in certs + ] + }) + return secrets_json diff --git a/src/cloudservice/azext_cloudservice/tests/__init__.py b/src/cloudservice/azext_cloudservice/tests/__init__.py new file mode 100644 index 00000000000..70488e93851 --- /dev/null +++ b/src/cloudservice/azext_cloudservice/tests/__init__.py @@ -0,0 +1,116 @@ +# 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 inspect +import logging +import os +import sys +import traceback +import datetime as dt + +from azure.core.exceptions import AzureError +from azure.cli.testsdk.exceptions import CliTestError, CliExecutionError, JMESPathCheckAssertionError + + +logger = logging.getLogger('azure.cli.testsdk') +logger.addHandler(logging.StreamHandler()) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) +exceptions = [] +test_map = dict() +SUCCESSED = "successed" +FAILED = "failed" + + +def try_manual(func): + def import_manual_function(origin_func): + from importlib import import_module + decorated_path = inspect.getfile(origin_func).lower() + module_path = __path__[0].lower() + if not decorated_path.startswith(module_path): + raise Exception("Decorator can only be used in submodules!") + manual_path = os.path.join( + decorated_path[module_path.rfind(os.path.sep) + 1:]) + manual_file_path, manual_file_name = os.path.split(manual_path) + module_name, _ = os.path.splitext(manual_file_name) + manual_module = "..manual." + \ + ".".join(manual_file_path.split(os.path.sep) + [module_name, ]) + return getattr(import_module(manual_module, package=__name__), origin_func.__name__) + + def get_func_to_call(): + func_to_call = func + try: + func_to_call = import_manual_function(func) + logger.info("Found manual override for %s(...)", func.__name__) + except (ImportError, AttributeError): + pass + return func_to_call + + def wrapper(*args, **kwargs): + func_to_call = get_func_to_call() + logger.info("running %s()...", func.__name__) + try: + test_map[func.__name__] = dict() + test_map[func.__name__]["result"] = SUCCESSED + test_map[func.__name__]["error_message"] = "" + test_map[func.__name__]["error_stack"] = "" + test_map[func.__name__]["error_normalized"] = "" + test_map[func.__name__]["start_dt"] = dt.datetime.utcnow() + ret = func_to_call(*args, **kwargs) + except (AssertionError, AzureError, CliTestError, CliExecutionError, SystemExit, + JMESPathCheckAssertionError) as e: + use_exception_cache = os.getenv("TEST_EXCEPTION_CACHE") + if use_exception_cache is None or use_exception_cache.lower() != "true": + raise + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + test_map[func.__name__]["result"] = FAILED + test_map[func.__name__]["error_message"] = str(e).replace("\r\n", " ").replace("\n", " ")[:500] + test_map[func.__name__]["error_stack"] = traceback.format_exc().replace( + "\r\n", " ").replace("\n", " ")[:500] + logger.info("--------------------------------------") + logger.info("step exception: %s", e) + logger.error("--------------------------------------") + logger.error("step exception in %s: %s", func.__name__, e) + logger.info(traceback.format_exc()) + exceptions.append((func.__name__, sys.exc_info())) + else: + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + return ret + + if inspect.isclass(func): + return get_func_to_call() + return wrapper + + +def calc_coverage(filename): + filename = filename.split(".")[0] + coverage_name = filename + "_coverage.md" + with open(coverage_name, "w") as f: + f.write("|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt|\n") + total = len(test_map) + covered = 0 + for k, v in test_map.items(): + if not k.startswith("step_"): + total -= 1 + continue + if v["result"] == SUCCESSED: + covered += 1 + f.write("|{step_name}|{result}|{error_message}|{error_stack}|{error_normalized}|{start_dt}|" + "{end_dt}|\n".format(step_name=k, **v)) + f.write("Coverage: {}/{}\n".format(covered, total)) + print("Create coverage\n", file=sys.stderr) + + +def raise_if(): + if exceptions: + if len(exceptions) <= 1: + raise exceptions[0][1][1] + message = "{}\nFollowed with exceptions in other steps:\n".format(str(exceptions[0][1][1])) + message += "\n".join(["{}: {}".format(h[0], h[1][1]) for h in exceptions[1:]]) + raise exceptions[0][1][0](message).with_traceback(exceptions[0][1][2]) diff --git a/src/cloudservice/azext_cloudservice/tests/latest/__init__.py b/src/cloudservice/azext_cloudservice/tests/latest/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/cloudservice/azext_cloudservice/tests/latest/__init__.py @@ -0,0 +1,12 @@ +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/cloudservice/azext_cloudservice/tests/latest/recordings/test_cloud_service_Scenario.yaml b/src/cloudservice/azext_cloudservice/tests/latest/recordings/test_cloud_service_Scenario.yaml new file mode 100644 index 00000000000..fcc1b2b86e5 --- /dev/null +++ b/src/cloudservice/azext_cloudservice/tests/latest/recordings/test_cloud_service_Scenario.yaml @@ -0,0 +1,60 @@ +interactions: +- request: + body: '{"location": "westus", "properties": {"packageUrl": "{PackageUrl}", "configuration": + "{ServiceConfiguration}", "upgradeMode": "Auto", "roleProfile": {"roles": [{"name": + "ContosoFrontend", "sku": {"name": "Standard_D1_v2", "tier": "Standard", "capacity": + 1}}, {"name": "ContosoBackend", "sku": {"name": "Standard_D1_v2", "tier": "Standard", + "capacity": 1}}]}, "osProfile": {}, "networkProfile": {"loadBalancerConfigurations": + [{"name": "contosolb", "properties": {"frontendIPConfigurations": [{"name": + "contosofe", "properties": {"publicIPAddress": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Network/publicIPAddresses/contosopublicip"}}}]}}], + "swappableCloudService": {}}, "extensionProfile": {}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - cloud-service create + Connection: + - keep-alive + Content-Length: + - '824' + Content-Type: + - application/json + ParameterSetName: + - --name --location --configuration --load-balancer-configurations --package-url + --roles --upgrade-mode --resource-group + User-Agent: + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-compute/19.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Compute/cloudServices/cs1?api-version=2020-10-01-preview + response: + body: + string: "{\r\n \"error\": {\r\n \"code\": \"InvalidParameter\",\r\n \"message\": + \"The value of parameter packageUrl is invalid.\"\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '120' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 11 Mar 2021 07:53:07 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1196' + status: + code: 400 + message: Bad Request +version: 1 diff --git a/src/cloudservice/azext_cloudservice/tests/latest/test_cloud_service_scenario.py b/src/cloudservice/azext_cloudservice/tests/latest/test_cloud_service_scenario.py new file mode 100644 index 00000000000..3440b1eb8f9 --- /dev/null +++ b/src/cloudservice/azext_cloudservice/tests/latest/test_cloud_service_scenario.py @@ -0,0 +1,74 @@ +# -------------------------------------------------------------------------- +# 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 os +import unittest + +from azext_cloudservice.tests import try_manual +from azure.cli.testsdk import ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +# Test class for Scenario +@try_manual +class CloudServiceScenarioTest(ScenarioTest): + + @unittest.skip('skip') + @ResourceGroupPreparer(name_prefix='cli_test_cloud_service_create_') + def test_cloud_service_create(self, resource_group): + self.cmd('cloud-service create -g {rg} -n cs ' + '--roles ContosoFrontend:Standard_D1_v2:1:Standard ContosoBackend:Standard_D1_v2:1:Standard ' + '--package-url packageurl ' + '--configuration config ' + '--load-balancer-configurations myLoadBalancer:myfe:publicip:: ' + 'myLoadBalancer2:myfe2::subnetid:privateip ' + '--secrets vault0:cert0:cert1 vault1:cert2:cert3:cert4 ' + '--extensions "@extensions.json"') + + @unittest.skip('skip') + @ResourceGroupPreparer(name_prefix='cli_test_cloud_service_') + def test_cloud_service(self, rg): + self.cmd('cloud-service show -g {rg} -n cs') + self.cmd('cloud-service show-instance-view -g {rg} -n cs') + self.cmd('cloud-service list -g {rg}') + self.cmd('cloud-service list-all') + self.cmd('cloud-service power-off -g {rg} -n cs') + self.cmd('cloud-service rebuild -g {rg} -n cs') + self.cmd('cloud-service reimage -g {rg} -n cs') + self.cmd('cloud-service start -g {rg} -n cs') + self.cmd('cloud-service restart -g {rg} -n cs') + self.cmd('cloud-service delete -g {rg} -n cs') + + @unittest.skip('skip') + @ResourceGroupPreparer(name_prefix='cli_test_cloud_service_role_') + def test_cloud_service_role(self, rg): + self.cmd('cloud-service role list') + self.cmd('cloud-service role show -g {rg} --cloud-service-name cs --role-name role') + + @unittest.skip('skip') + @ResourceGroupPreparer(name_prefix='cli_test_cloud_service_role_instance_') + def test_cloud_service_role_instance(self, rg): + self.cmd('cloud-service role-instance list') + self.cmd('cloud-service role-instance show -g {rg}') + self.cmd('cloud-service role-instance show-instance-view -g {rg}') + self.cmd('cloud-service role-instance show-remote-desktop-file') + self.cmd('cloud-service role-instance delete -g {rg}') + self.cmd('cloud-service role-instance rebuild -g {rg}') + self.cmd('cloud-service role-instance reimage -g {rg}') + self.cmd('cloud-service role-instance restart -g {rg}') + + @unittest.skip('skip') + @ResourceGroupPreparer(name_prefix='cli_test_cloud_service_update_domain_') + def test_cloud_service_update_domain(self, rg): + self.cmd('cloud-service update-domain list-update-domain') + self.cmd('cloud-service update-domain show-update-domain') + self.cmd('cloud-service update-domain walk-update-domain') diff --git a/src/cloudservice/gen.zip b/src/cloudservice/gen.zip new file mode 100644 index 0000000000000000000000000000000000000000..495bb4fd81e681e4e17b9a722af103f682d873c3 GIT binary patch literal 14106 zcmeHO;cnx&5zgISi^9L}&jI~Gcz@VA*iw?swt$-im&@k1i`^`YWcOMiNd-otZC+$a zM^Z_=f#0BSak%@@m*_+E3Hm0Tp(t5WWUqzhaOhPE6j|hOI2@A0;e6Ea^^?z98+g6^ zQ+Ue${g1!dUu>xZ!?nYiIDyHHFjdErxhUa&hljeO=v#Ug1%v!|s0 zXjkhgISQkh;NyuRU3Zh5a94yf94SZ_Q7EY5VPKI%-zS<#62VYP=2=ko4G0@Z=8-t? zm>_Dx$jPgBX|hGm7|UMNogzHYG?56uW3D113>6uL0yy~zC!m1$X;N$JsTR*;WXu8v zqCiDgvz&*o5BjP!Jk; z*2}p&GCTPM>smplF=dUC|357V4x84mfaGa3A)x}2O6U$Aifi99n&;-HsBpI_z`aU_o)TGG9a;ILm zLq8BbnEPfllcXZj(R5f=U!8tGpi@TL_tROvdGmG!r60O_Opx|1)Dz1p8aE6^d>ki3 z7TDe!jU46E=S$dAuYW~-8n{gK3ydUbpWokKT(nVGcnshM0tJ)Azk=UAxM4g;OeoGI z5@>4Z*g&zsdo|2eU)Dev=mN|5kFdTa{G<2^rp&A1q36MbT-3`w6aj8q##ho6Ji-ZF zu2|al`D}-Ka~s%%v2fW-5ylY^i1FNphTU+O+0xGJg7ucE+fZD?AS_70q;1raWbg=t zn3pS_<8`V3Rdr!R-D^5#{aET#`)#u$Be)&JGyYKHCgvQ~M{yG+12;lto?qg(>M;zqGI8*#{os0j zZ+V3&`oS=7bd~lEP9ES4*EO5zH@&k#>#S`zx@bB%H}`VO6l^)t83~>)wxC=wq)n8H zCq zTuxsM$?+ZRdnIf-SFI&pRb{3u7i0ikW~u}OfJUUkD^{~8jY>cPLq}mt z_deO=o$w$mn-lRZSTg7!pdO53wr%a5PI#3`d*+zO1WB3aXyzo|9huWfLYCxG#R#_HN zd&;SV?8Q~WOT5-W$*0RJ6k*3Wc&GG>-k{!`JSE2 zhi2s~GQwaF{24+BJ_Efzs5sR#5N}&M);2s*S(VOh&5cvzUNljtrBSHL0rr2ndm0wN zm!p6F^uwnBy5RjgxTj1}3!sVnd6DjW>+k=1^81Yqybsm@X)yeqU^tEmdpi=a5h{4t zKsLW7$i^Twp-ixw#OHQ>Zs7=!-gOG)oSEK#2gx5HJ?O@~oDl~^)YbOsQ8x7+x}b&Z%n3Dc z7rHY^q!>84J_96f1+Ox}Qf@c|Tq@asq=VvtT%a01le)~P*rr9UR(WnLWH}j>cb-M- zadcWb7~a)LR=ZaLyg@k-6AT#m?~32B{cq4a++4)`^ITF$4mlZ6u2y+)Ulwqk7H1h? zSBoude-WML9MzL&bw6!4gwgs5Gm`o z6fK2kD&+`8{)MH?H3q%-cBQkk4`WXC6lek- z5S+m_lwiqPU11!s69C?jm4@C{GBCJWZjx7EOwBA`Z)gki;CLb-U3&ECgoQ~bZCHQu#}ewvSjibq5oBvvdJG{s$M8tZ z)1wB!ZhMIzuv9QSA_3*H^AYt#dIVEh0a`Vtay?VoI7AR1)&5w{(^=)V<;WU`X#Gt@ zrSV9;^2T1)SpRF=OLQ~x`?*l23ztC-ap}rItB>HqSFhuR(}fRF)e@#!ZxyL*)B`LQ zTUtb6aot)#t|bwQaBFp=)&XI25bWw!J=_IU;AhR!)+}x9pJSWSENx?!96?^WRWIAq zW@%&Efx3&!rqD_ z4-otAeU^zebxJ4xI|I$z8Z+gTvbxD>ZY(v2&^kWx`gj$^FFBxw&b=#>!%(@C*Ez+geA1ObkSU}9Xmm4BBFj(V571|8`1+GiKi^pX z6&PTQxvTCsVP)=Rm~+8;4qu(6pl7*M8T4F~`VmTfOr{Fu$^`^EeEpl>BEKi_xADow K#%F)PxBmb*)`p@0 literal 0 HcmV?d00001 diff --git a/src/cloudservice/report.md b/src/cloudservice/report.md new file mode 100644 index 00000000000..d8a7bda14f7 --- /dev/null +++ b/src/cloudservice/report.md @@ -0,0 +1,340 @@ +# Azure CLI Module Creation Report + +## EXTENSION +|CLI Extension|Command Groups| +|---------|------------| +|az cloud-service|[groups](#CommandGroups) + +## GROUPS +### Command groups in `az cloud-service` extension +|CLI Command Group|Group Swagger name|Commands| +|---------|------------|--------| +|az cloud-service role-instance|CloudServiceRoleInstances|[commands](#CommandsInCloudServiceRoleInstances)| +|az cloud-service role|CloudServiceRoles|[commands](#CommandsInCloudServiceRoles)| +|az cloud-service|CloudServices|[commands](#CommandsInCloudServices)| +|az cloud-service update-domain|CloudServicesUpdateDomain|[commands](#CommandsInCloudServicesUpdateDomain)| + +## COMMANDS +### Commands in `az cloud-service` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az cloud-service list](#CloudServicesList)|List|[Parameters](#ParametersCloudServicesList)|Not Found| +|[az cloud-service show](#CloudServicesGet)|Get|[Parameters](#ParametersCloudServicesGet)|Not Found| +|[az cloud-service create](#CloudServicesCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersCloudServicesCreateOrUpdate#Create)|[Example](#ExamplesCloudServicesCreateOrUpdate#Create)| +|[az cloud-service update](#CloudServicesUpdate)|Update|[Parameters](#ParametersCloudServicesUpdate)|Not Found| +|[az cloud-service delete](#CloudServicesDelete)|Delete|[Parameters](#ParametersCloudServicesDelete)|Not Found| +|[az cloud-service delete-instance](#CloudServicesDeleteInstances)|DeleteInstances|[Parameters](#ParametersCloudServicesDeleteInstances)|Not Found| +|[az cloud-service list-all](#CloudServicesListAll)|ListAll|[Parameters](#ParametersCloudServicesListAll)|Not Found| +|[az cloud-service power-off](#CloudServicesPowerOff)|PowerOff|[Parameters](#ParametersCloudServicesPowerOff)|Not Found| +|[az cloud-service rebuild](#CloudServicesRebuild)|Rebuild|[Parameters](#ParametersCloudServicesRebuild)|Not Found| +|[az cloud-service reimage](#CloudServicesReimage)|Reimage|[Parameters](#ParametersCloudServicesReimage)|Not Found| +|[az cloud-service restart](#CloudServicesRestart)|Restart|[Parameters](#ParametersCloudServicesRestart)|Not Found| +|[az cloud-service show-instance-view](#CloudServicesGetInstanceView)|GetInstanceView|[Parameters](#ParametersCloudServicesGetInstanceView)|Not Found| +|[az cloud-service start](#CloudServicesStart)|Start|[Parameters](#ParametersCloudServicesStart)|Not Found| + +### Commands in `az cloud-service role` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az cloud-service role list](#CloudServiceRolesList)|List|[Parameters](#ParametersCloudServiceRolesList)|Not Found| +|[az cloud-service role show](#CloudServiceRolesGet)|Get|[Parameters](#ParametersCloudServiceRolesGet)|Not Found| + +### Commands in `az cloud-service role-instance` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az cloud-service role-instance list](#CloudServiceRoleInstancesList)|List|[Parameters](#ParametersCloudServiceRoleInstancesList)|Not Found| +|[az cloud-service role-instance show](#CloudServiceRoleInstancesGet)|Get|[Parameters](#ParametersCloudServiceRoleInstancesGet)|Not Found| +|[az cloud-service role-instance delete](#CloudServiceRoleInstancesDelete)|Delete|[Parameters](#ParametersCloudServiceRoleInstancesDelete)|Not Found| +|[az cloud-service role-instance rebuild](#CloudServiceRoleInstancesRebuild)|Rebuild|[Parameters](#ParametersCloudServiceRoleInstancesRebuild)|Not Found| +|[az cloud-service role-instance reimage](#CloudServiceRoleInstancesReimage)|Reimage|[Parameters](#ParametersCloudServiceRoleInstancesReimage)|Not Found| +|[az cloud-service role-instance restart](#CloudServiceRoleInstancesRestart)|Restart|[Parameters](#ParametersCloudServiceRoleInstancesRestart)|Not Found| +|[az cloud-service role-instance show-instance-view](#CloudServiceRoleInstancesGetInstanceView)|GetInstanceView|[Parameters](#ParametersCloudServiceRoleInstancesGetInstanceView)|Not Found| +|[az cloud-service role-instance show-remote-desktop-file](#CloudServiceRoleInstancesGetRemoteDesktopFile)|GetRemoteDesktopFile|[Parameters](#ParametersCloudServiceRoleInstancesGetRemoteDesktopFile)|Not Found| + +### Commands in `az cloud-service update-domain` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az cloud-service update-domain list-update-domain](#CloudServicesUpdateDomainListUpdateDomains)|ListUpdateDomains|[Parameters](#ParametersCloudServicesUpdateDomainListUpdateDomains)|Not Found| +|[az cloud-service update-domain show-update-domain](#CloudServicesUpdateDomainGetUpdateDomain)|GetUpdateDomain|[Parameters](#ParametersCloudServicesUpdateDomainGetUpdateDomain)|Not Found| +|[az cloud-service update-domain walk-update-domain](#CloudServicesUpdateDomainWalkUpdateDomain)|WalkUpdateDomain|[Parameters](#ParametersCloudServicesUpdateDomainWalkUpdateDomain)|Not Found| + + +## COMMAND DETAILS + +### group `az cloud-service` +#### Command `az cloud-service list` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|Name of the resource group.|resource_group_name|resourceGroupName| + +#### Command `az cloud-service show` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|Name of the resource group.|resource_group_name|resourceGroupName| +|**--cloud-service-name**|string|Name of the cloud service.|cloud_service_name|cloudServiceName| + +#### Command `az cloud-service create` + +##### Example +``` +az cloud-service create --name "{cs-name}" --location "westus" --configuration "{ServiceConfiguration}" \ +--load-balancer-configurations "[{\\"name\\":\\"contosolb\\",\\"properties\\":{\\"frontendIPConfigurations\\":[{\\"name\ +\\":\\"contosofe\\",\\"properties\\":{\\"publicIPAddress\\":{\\"id\\":\\"/subscriptions/{subscription-id}/resourceGroup\ +s/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip\\"}}}]}}]" --package-url "{PackageUrl}" \ +--roles "[{\\"name\\":\\"ContosoFrontend\\",\\"sku\\":{\\"name\\":\\"Standard_D1_v2\\",\\"capacity\\":1,\\"tier\\":\\"S\ +tandard\\"}},{\\"name\\":\\"ContosoBackend\\",\\"sku\\":{\\"name\\":\\"Standard_D1_v2\\",\\"capacity\\":1,\\"tier\\":\\\ +"Standard\\"}}]" --upgrade-mode "Auto" --resource-group "ConstosoRG" +``` +##### Example +``` +az cloud-service create --name "{cs-name}" --location "westus" --configuration "{ServiceConfiguration}" \ +--load-balancer-configurations "[{\\"name\\":\\"myLoadBalancer\\",\\"properties\\":{\\"frontendIPConfigurations\\":[{\\\ +"name\\":\\"myfe\\",\\"properties\\":{\\"publicIPAddress\\":{\\"id\\":\\"/subscriptions/{subscription-id}/resourceGroup\ +s/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP\\"}}}]}}]" --package-url "{PackageUrl}" --roles \ +"[{\\"name\\":\\"ContosoFrontend\\",\\"sku\\":{\\"name\\":\\"Standard_D1_v2\\",\\"capacity\\":1,\\"tier\\":\\"Standard\ +\\"}}]" --upgrade-mode "Auto" --resource-group "ConstosoRG" +``` +##### Example +``` +az cloud-service create --name "{cs-name}" --location "westus" --configuration "{ServiceConfiguration}" \ +--load-balancer-configurations "[{\\"name\\":\\"contosolb\\",\\"properties\\":{\\"frontendIPConfigurations\\":[{\\"name\ +\\":\\"contosofe\\",\\"properties\\":{\\"publicIPAddress\\":{\\"id\\":\\"/subscriptions/{subscription-id}/resourceGroup\ +s/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip\\"}}}]}}]" --secrets \ +"[{\\"sourceVault\\":{\\"id\\":\\"/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVau\ +lt/vaults/{keyvault-name}\\"},\\"vaultCertificates\\":[{\\"certificateUrl\\":\\"https://{keyvault-name}.vault.azure.net\ +:443/secrets/ContosoCertificate/{secret-id}\\"}]}]" --package-url "{PackageUrl}" --roles \ +"[{\\"name\\":\\"ContosoFrontend\\",\\"sku\\":{\\"name\\":\\"Standard_D1_v2\\",\\"capacity\\":1,\\"tier\\":\\"Standard\ +\\"}}]" --upgrade-mode "Auto" --resource-group "ConstosoRG" +``` +##### Example +``` +az cloud-service create --name "{cs-name}" --location "westus" --configuration "{ServiceConfiguration}" --extensions \ +"[{\\"name\\":\\"RDPExtension\\",\\"properties\\":{\\"type\\":\\"RDP\\",\\"autoUpgradeMinorVersion\\":false,\\"protecte\ +dSettings\\":\\"{password}\\",\\"publisher\\":\\"Microsoft.Windows.\ +Azure.Extensions\\",\\"settings\\":\\"UserAzure10/22/2021 \ +15:05:45\\",\\"typeHandlerVersion\\":\\"1.2.1\\"}}]" --load-balancer-configurations \ +"[{\\"name\\":\\"contosolb\\",\\"properties\\":{\\"frontendIPConfigurations\\":[{\\"name\\":\\"contosofe\\",\\"properti\ +es\\":{\\"publicIPAddress\\":{\\"id\\":\\"/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsof\ +t.Network/publicIPAddresses/contosopublicip\\"}}}]}}]" --package-url "{PackageUrl}" --roles \ +"[{\\"name\\":\\"ContosoFrontend\\",\\"sku\\":{\\"name\\":\\"Standard_D1_v2\\",\\"capacity\\":1,\\"tier\\":\\"Standard\ +\\"}}]" --upgrade-mode "Auto" --resource-group "ConstosoRG" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|Name of the resource group.|resource_group_name|resourceGroupName| +|**--cloud-service-name**|string|Name of the cloud service.|cloud_service_name|cloudServiceName| +|**--location**|string|Resource location.|location|location| +|**--tags**|dictionary|Resource tags.|tags|tags| +|**--package-url**|string|Specifies a URL that refers to the location of the service package in the Blob service. The service package URL can be Shared Access Signature (SAS) URI from any storage account. This is a write-only property and is not returned in GET calls.|package_url|packageUrl| +|**--configuration**|string|Specifies the XML service configuration (.cscfg) for the cloud service.|configuration|configuration| +|**--configuration-url**|string|Specifies a URL that refers to the location of the service configuration in the Blob service. The service package URL can be Shared Access Signature (SAS) URI from any storage account. This is a write-only property and is not returned in GET calls.|configuration_url|configurationUrl| +|**--start-cloud-service**|boolean|(Optional) Indicates whether to start the cloud service immediately after it is created. The default value is `true`. If false, the service model is still deployed, but the code is not run immediately. Instead, the service is PoweredOff until you call Start, at which time the service will be started. A deployed service still incurs charges, even if it is poweredoff.|start_cloud_service|startCloudService| +|**--upgrade-mode**|choice|Update mode for the cloud service. Role instances are allocated to update domains when the service is deployed. Updates can be initiated manually in each update domain or initiated automatically in all update domains. Possible Values are

**Auto**

**Manual**

**Simultaneous**

If not specified, the default value is Auto. If set to Manual, PUT UpdateDomain must be called to apply the update. If set to Auto, the update is automatically applied to each update domain in sequence.|upgrade_mode|upgradeMode| +|**--extensions**|array|List of extensions for the cloud service.|extensions|extensions| +|**--load-balancer-configurations**|array|The list of load balancer configurations for the cloud service.|load_balancer_configurations|loadBalancerConfigurations| +|**--id**|string|Resource Id|id|id| +|**--secrets**|array|Specifies set of certificates that should be installed onto the role instances.|secrets|secrets| +|**--roles**|array|List of roles for the cloud service.|roles|roles| + +#### Command `az cloud-service update` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|Name of the resource group.|resource_group_name|resourceGroupName| +|**--cloud-service-name**|string|Name of the cloud service.|cloud_service_name|cloudServiceName| +|**--tags**|dictionary|Resource tags|tags|tags| + +#### Command `az cloud-service delete` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|Name of the resource group.|resource_group_name|resourceGroupName| +|**--cloud-service-name**|string|Name of the cloud service.|cloud_service_name|cloudServiceName| + +#### Command `az cloud-service delete-instance` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|Name of the resource group.|resource_group_name|resourceGroupName| +|**--cloud-service-name**|string|Name of the cloud service.|cloud_service_name|cloudServiceName| +|**--role-instances**|array|List of cloud service role instance names. Value of '*' will signify all role instances of the cloud service.|role_instances|roleInstances| + +#### Command `az cloud-service list-all` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +#### Command `az cloud-service power-off` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|Name of the resource group.|resource_group_name|resourceGroupName| +|**--cloud-service-name**|string|Name of the cloud service.|cloud_service_name|cloudServiceName| + +#### Command `az cloud-service rebuild` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|Name of the resource group.|resource_group_name|resourceGroupName| +|**--cloud-service-name**|string|Name of the cloud service.|cloud_service_name|cloudServiceName| +|**--role-instances**|array|List of cloud service role instance names. Value of '*' will signify all role instances of the cloud service.|role_instances|roleInstances| + +#### Command `az cloud-service reimage` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|Name of the resource group.|resource_group_name|resourceGroupName| +|**--cloud-service-name**|string|Name of the cloud service.|cloud_service_name|cloudServiceName| +|**--role-instances**|array|List of cloud service role instance names. Value of '*' will signify all role instances of the cloud service.|role_instances|roleInstances| + +#### Command `az cloud-service restart` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|Name of the resource group.|resource_group_name|resourceGroupName| +|**--cloud-service-name**|string|Name of the cloud service.|cloud_service_name|cloudServiceName| +|**--role-instances**|array|List of cloud service role instance names. Value of '*' will signify all role instances of the cloud service.|role_instances|roleInstances| + +#### Command `az cloud-service show-instance-view` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|Name of the resource group.|resource_group_name|resourceGroupName| +|**--cloud-service-name**|string|Name of the cloud service.|cloud_service_name|cloudServiceName| + +#### Command `az cloud-service start` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|Name of the resource group.|resource_group_name|resourceGroupName| +|**--cloud-service-name**|string|Name of the cloud service.|cloud_service_name|cloudServiceName| + +### group `az cloud-service role` +#### Command `az cloud-service role list` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string||resource_group_name|resourceGroupName| +|**--cloud-service-name**|string||cloud_service_name|cloudServiceName| + +#### Command `az cloud-service role show` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--role-name**|string|Name of the role.|role_name|roleName| +|**--resource-group-name**|string||resource_group_name|resourceGroupName| +|**--cloud-service-name**|string||cloud_service_name|cloudServiceName| + +### group `az cloud-service role-instance` +#### Command `az cloud-service role-instance list` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string||resource_group_name|resourceGroupName| +|**--cloud-service-name**|string||cloud_service_name|cloudServiceName| + +#### Command `az cloud-service role-instance show` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--role-instance-name**|string|Name of the role instance.|role_instance_name|roleInstanceName| +|**--resource-group-name**|string||resource_group_name|resourceGroupName| +|**--cloud-service-name**|string||cloud_service_name|cloudServiceName| + +#### Command `az cloud-service role-instance delete` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--role-instance-name**|string|Name of the role instance.|role_instance_name|roleInstanceName| +|**--resource-group-name**|string||resource_group_name|resourceGroupName| +|**--cloud-service-name**|string||cloud_service_name|cloudServiceName| + +#### Command `az cloud-service role-instance rebuild` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--role-instance-name**|string|Name of the role instance.|role_instance_name|roleInstanceName| +|**--resource-group-name**|string||resource_group_name|resourceGroupName| +|**--cloud-service-name**|string||cloud_service_name|cloudServiceName| + +#### Command `az cloud-service role-instance reimage` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--role-instance-name**|string|Name of the role instance.|role_instance_name|roleInstanceName| +|**--resource-group-name**|string||resource_group_name|resourceGroupName| +|**--cloud-service-name**|string||cloud_service_name|cloudServiceName| + +#### Command `az cloud-service role-instance restart` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--role-instance-name**|string|Name of the role instance.|role_instance_name|roleInstanceName| +|**--resource-group-name**|string||resource_group_name|resourceGroupName| +|**--cloud-service-name**|string||cloud_service_name|cloudServiceName| + +#### Command `az cloud-service role-instance show-instance-view` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--role-instance-name**|string|Name of the role instance.|role_instance_name|roleInstanceName| +|**--resource-group-name**|string||resource_group_name|resourceGroupName| +|**--cloud-service-name**|string||cloud_service_name|cloudServiceName| + +#### Command `az cloud-service role-instance show-remote-desktop-file` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--role-instance-name**|string|Name of the role instance.|role_instance_name|roleInstanceName| +|**--resource-group-name**|string||resource_group_name|resourceGroupName| +|**--cloud-service-name**|string||cloud_service_name|cloudServiceName| + +### group `az cloud-service update-domain` +#### Command `az cloud-service update-domain list-update-domain` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|Name of the resource group.|resource_group_name|resourceGroupName| +|**--cloud-service-name**|string|Name of the cloud service.|cloud_service_name|cloudServiceName| + +#### Command `az cloud-service update-domain show-update-domain` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|Name of the resource group.|resource_group_name|resourceGroupName| +|**--cloud-service-name**|string|Name of the cloud service.|cloud_service_name|cloudServiceName| +|**--update-domain**|integer|Specifies an integer value that identifies the update domain. Update domains are identified with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on.|update_domain|updateDomain| + +#### Command `az cloud-service update-domain walk-update-domain` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|Name of the resource group.|resource_group_name|resourceGroupName| +|**--cloud-service-name**|string|Name of the cloud service.|cloud_service_name|cloudServiceName| +|**--update-domain**|integer|Specifies an integer value that identifies the update domain. Update domains are identified with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on.|update_domain|updateDomain| diff --git a/src/cloudservice/setup.cfg b/src/cloudservice/setup.cfg new file mode 100644 index 00000000000..2fdd96e5d39 --- /dev/null +++ b/src/cloudservice/setup.cfg @@ -0,0 +1 @@ +#setup.cfg \ No newline at end of file diff --git a/src/cloudservice/setup.py b/src/cloudservice/setup.py new file mode 100644 index 00000000000..35adeef6311 --- /dev/null +++ b/src/cloudservice/setup.py @@ -0,0 +1,60 @@ +#!/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 + +# HISTORY.rst entry. +VERSION = '0.1.0' +try: + from azext_cloudservice.manual.version import VERSION +except ImportError: + pass + +# 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 :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', +] + +DEPENDENCIES = [ + 'azure-mgmt-compute~=19.0.0' +] + +try: + from azext_cloudservice.manual.dependency import DEPENDENCIES +except ImportError: + pass + +with open('README.md', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='cloud_service', + version=VERSION, + description='Microsoft Azure Command-Line Tools ComputeManagementClient Extension', + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions/tree/master/src/cloudservice', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_cloudservice': ['azext_metadata.json']}, +) From be47cfa763c1322452c87cf9b08699a977ebe938 Mon Sep 17 00:00:00 2001 From: Azure CLI Bot Date: Fri, 2 Apr 2021 20:11:46 +0800 Subject: [PATCH 4/6] [Release] Update index.json for extension [ cloudservice ] (#3221) Triggered by Azure CLI Extensions Release Pipeline - ADO_BUILD_ID=819994 Last commit: https://github.com/Azure/azure-cli-extensions/commit/ee901d9a72770bbcb8f7d1eec65cffd949df03ab --- src/index.json | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/src/index.json b/src/index.json index a86dba23385..f9f9fa219b2 100644 --- a/src/index.json +++ b/src/index.json @@ -5201,6 +5201,59 @@ "sha256Digest": "9ea6162d37fc3390be4dce64cb05c5c588070104f3e92a701ab475473565a8a9" } ], + "cloud-service": [ + { + "downloadUrl": "https://azcliprod.blob.core.windows.net/cli-extensions/cloud_service-0.1.0-py3-none-any.whl", + "filename": "cloud_service-0.1.0-py3-none-any.whl", + "metadata": { + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.15.0", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "License :: OSI Approved :: MIT License" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "azpycli@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions/tree/master/src/cloudservice" + } + } + }, + "extras": [], + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "cloud-service", + "run_requires": [ + { + "requires": [ + "azure-mgmt-compute (~=19.0.0)" + ] + } + ], + "summary": "Microsoft Azure Command-Line Tools ComputeManagementClient Extension", + "version": "0.1.0" + }, + "sha256Digest": "22c640991a5e98e42ddcb4303813cd63b75d4b3d392ad9eab955a5af1b87c45b" + } + ], "codespaces": [ { "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/codespaces-0.1.0-py2.py3-none-any.whl", From 3290f6e32cdd61b370f475055eb07d77d09753fe Mon Sep 17 00:00:00 2001 From: jonathan-innis Date: Fri, 2 Apr 2021 13:35:49 -0700 Subject: [PATCH 5/6] Disable refs docs --- k8s-custom-pipelines.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/k8s-custom-pipelines.yml b/k8s-custom-pipelines.yml index a603608b138..a3304668086 100644 --- a/k8s-custom-pipelines.yml +++ b/k8s-custom-pipelines.yml @@ -337,20 +337,3 @@ stages: env: ADO_PULL_REQUEST_LATEST_COMMIT: $(System.PullRequest.SourceCommitId) ADO_PULL_REQUEST_TARGET_BRANCH: $(System.PullRequest.TargetBranch) - - - job: IndexRefDocVerify - displayName: "Verify Ref Docs" - pool: - vmImage: 'ubuntu-16.04' - steps: - - task: UsePythonVersion@0 - displayName: 'Use Python 3.7' - inputs: - versionSpec: 3.7 - - bash: pip install wheel==0.30.0 - displayName: 'Install wheel==0.30.0' - - task: Bash@3 - displayName: "Verify Extension Ref Docs" - inputs: - targetType: 'filePath' - filePath: scripts/ci/test_index_ref_doc.sh From 22c8e9247ed5ae5fa3cb0f273e69dd9e2053fe34 Mon Sep 17 00:00:00 2001 From: Jonathan Innis Date: Fri, 2 Apr 2021 16:15:58 -0700 Subject: [PATCH 6/6] Update to include better create warning logs and remove update context (#20) * Update to include better create warning logs and remove update context * Remove help text for update * Fix spelling error * Update message --- src/k8s-extension/HISTORY.rst | 6 ++++++ src/k8s-extension/azext_k8s_extension/_consts.py | 2 +- src/k8s-extension/azext_k8s_extension/_help.py | 5 ----- src/k8s-extension/azext_k8s_extension/commands.py | 1 - .../azext_k8s_extension/partner_extensions/AzureDefender.py | 3 ++- .../partner_extensions/ContainerInsights.py | 3 ++- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/k8s-extension/HISTORY.rst b/src/k8s-extension/HISTORY.rst index 54c1e375f6f..d20160a2199 100644 --- a/src/k8s-extension/HISTORY.rst +++ b/src/k8s-extension/HISTORY.rst @@ -3,6 +3,12 @@ Release History =============== +0.2.1 +++++++++++++++++++ + +* Remove `k8s-extension update` until PATCH is supported +* Improved logging for overwriting extension name with default + 0.2.0 ++++++++++++++++++ diff --git a/src/k8s-extension/azext_k8s_extension/_consts.py b/src/k8s-extension/azext_k8s_extension/_consts.py index d0fdaf7775f..144e9450012 100644 --- a/src/k8s-extension/azext_k8s_extension/_consts.py +++ b/src/k8s-extension/azext_k8s_extension/_consts.py @@ -5,4 +5,4 @@ # -------------------------------------------------------------------------------------------- EXTENSION_NAME = 'k8s-extension' -VERSION = "0.2.0" +VERSION = "0.2.1" diff --git a/src/k8s-extension/azext_k8s_extension/_help.py b/src/k8s-extension/azext_k8s_extension/_help.py index 64e4be612ea..562f0af58aa 100644 --- a/src/k8s-extension/azext_k8s_extension/_help.py +++ b/src/k8s-extension/azext_k8s_extension/_help.py @@ -32,8 +32,3 @@ type: command short-summary: Show details of a K8s-extension. """ - -helps[f'{consts.EXTENSION_NAME} update'] = """ - type: command - short-summary: Update a K8s-extension. -""" diff --git a/src/k8s-extension/azext_k8s_extension/commands.py b/src/k8s-extension/azext_k8s_extension/commands.py index 931662814c0..3a823177d1c 100644 --- a/src/k8s-extension/azext_k8s_extension/commands.py +++ b/src/k8s-extension/azext_k8s_extension/commands.py @@ -20,7 +20,6 @@ def load_command_table(self, _): is_preview=True) \ as g: g.custom_command('create', 'create_k8s_extension') - g.custom_command('update', 'update_k8s_extension') g.custom_command('delete', 'delete_k8s_extension', confirmation=True) g.custom_command('list', 'list_k8s_extension', table_transformer=k8s_extension_list_table_format) g.custom_show_command('show', 'show_k8s_extension', table_transformer=k8s_extension_show_table_format) diff --git a/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureDefender.py b/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureDefender.py index dcd2853affc..3124faec4c1 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureDefender.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureDefender.py @@ -41,7 +41,8 @@ def Create(self, cmd, client, resource_group_name, cluster_name, name, cluster_t is_ci_extension_type = False logger.warning('Ignoring name, release-namespace and scope parameters since %s ' - 'only supports cluster scope and single instance of this extension', extension_type) + 'only supports cluster scope and single instance of this extension.', extension_type) + logger.warning("Defaulting to extension name '%s' and release-namespace '%s'", name, release_namespace) _get_container_insights_settings(cmd, resource_group_name, cluster_name, configuration_settings, configuration_protected_settings, is_ci_extension_type) diff --git a/src/k8s-extension/azext_k8s_extension/partner_extensions/ContainerInsights.py b/src/k8s-extension/azext_k8s_extension/partner_extensions/ContainerInsights.py index 8c678b34915..eade4256205 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/ContainerInsights.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/ContainerInsights.py @@ -53,7 +53,8 @@ def Create(self, cmd, client, resource_group_name, cluster_name, name, cluster_t is_ci_extension_type = True logger.warning('Ignoring name, release-namespace and scope parameters since %s ' - 'only supports cluster scope and single instance of this extension', extension_type) + 'only supports cluster scope and single instance of this extension.', extension_type) + logger.warning("Defaulting to extension name '%s' and release-namespace '%s'", name, release_namespace) _get_container_insights_settings(cmd, resource_group_name, cluster_name, configuration_settings, configuration_protected_settings, is_ci_extension_type)