diff --git a/src/plugins/azgenerator/CodeModelAz.ts b/src/plugins/azgenerator/CodeModelAz.ts index fac62abe..13d1a333 100644 --- a/src/plugins/azgenerator/CodeModelAz.ts +++ b/src/plugins/azgenerator/CodeModelAz.ts @@ -170,6 +170,7 @@ export interface CodeModelAz { PythonMgmtClient: string; PythonOperationsName: string; + GenerateTestInit(): void; SelectFirstExample(): boolean; SelectNextExample(): boolean; FindExampleById(id: string, commandParams: any): string[][]; diff --git a/src/plugins/azgenerator/CodeModelAzImpl.ts b/src/plugins/azgenerator/CodeModelAzImpl.ts index a4368cee..a5f60283 100644 --- a/src/plugins/azgenerator/CodeModelAzImpl.ts +++ b/src/plugins/azgenerator/CodeModelAzImpl.ts @@ -74,21 +74,6 @@ export class CodeModelCliImpl implements CodeModelAz { this.setParamAzUniqueNames(); this.sortOperationByAzCommand(); this.calcOptionRequiredByMethod(); - if (this.codeModel['test-scenario']) { - if ('examples' in this.codeModel['test-scenario']) { - //new style of example configuration - this._testScenario = this.codeModel['test-scenario']['examples']; - } - else { - //old style of example configuration - this._testScenario = this.codeModel['test-scenario'] - } - this._configuredScenario = true; - } - else { - this._testScenario = GenerateDefaultTestScenario(this.GetAllExamples()); - this._configuredScenario = false; - } } @@ -438,6 +423,25 @@ export class CodeModelCliImpl implements CodeModelAz { // //================================================================================================================= + + public GenerateTestInit() { + if (this.codeModel['test-scenario']) { + if ('examples' in this.codeModel['test-scenario']) { + //new style of example configuration + this._testScenario = this.codeModel['test-scenario']['examples']; + } + else { + //old style of example configuration + this._testScenario = this.codeModel['test-scenario'] + } + this._configuredScenario = true; + } + else { + this._testScenario = GenerateDefaultTestScenario(this.GetAllExamples()); + this._configuredScenario = false; + } + } + public SelectFirstExtension(): boolean { // support only one initially return true; @@ -697,7 +701,7 @@ export class CodeModelCliImpl implements CodeModelAz { } public get Command_Help(): string { - return this.Command.language['az'].description.replace(/\n/g, " "); + return this.Command.language['az'].description.replace(/\n/g, " ").replace(/"/g, '\\\\"'); } public get Command_GetOriginalOperation(): any { diff --git a/src/plugins/azgenerator/Generator.ts b/src/plugins/azgenerator/Generator.ts index 1fcc7543..d81776ab 100644 --- a/src/plugins/azgenerator/Generator.ts +++ b/src/plugins/azgenerator/Generator.ts @@ -45,6 +45,7 @@ export async function GenerateAll(model: CodeModelAz, files[path + "generated/action.py"] = GenerateAzureCliActions(model); files[path + "generated/__init__.py"] = GenerateNamespaceInit(model); files[path + "tests/__init__.py"] = GenerateAzureCliTestInit(model); + model.GenerateTestInit(); files[path + "tests/latest/test_" + model.Extension_NameUnderscored + "_scenario.py"] = GenerateAzureCliTestScenario(model); if (NeedPreparer()) files[path + "tests/latest/preparers.py"] = GenerateAzureCliTestPrepare(model); files[path + "generated/_help.py"] = GenerateAzureCliHelp(model, debug); diff --git a/src/plugins/azgenerator/TemplateAzureCliCommands.ts b/src/plugins/azgenerator/TemplateAzureCliCommands.ts index 2f547788..26d9e59a 100644 --- a/src/plugins/azgenerator/TemplateAzureCliCommands.ts +++ b/src/plugins/azgenerator/TemplateAzureCliCommands.ts @@ -75,10 +75,14 @@ function getCommandBody(model: CodeModelAz) { let output: string[] = []; let functionName = model.Command_FunctionName; let methodName = model.Command_MethodName; - let endStr = ")"; + let endStr = ""; if (model.Command_IsLongRun && model.CommandGroup_HasShowCommand) { - endStr = ", supports_no_wait=True" + endStr; + endStr += ", supports_no_wait=True"; } + if (methodName == "delete") { + endStr += ", confirmation=True"; + } + endStr += ")"; if (methodName != "show") { if (model.Command_NeedGeneric) { let argument = ""; diff --git a/src/plugins/azgenerator/TemplateAzureCliCustom.ts b/src/plugins/azgenerator/TemplateAzureCliCustom.ts index d91ce274..dd6487aa 100644 --- a/src/plugins/azgenerator/TemplateAzureCliCustom.ts +++ b/src/plugins/azgenerator/TemplateAzureCliCustom.ts @@ -180,7 +180,7 @@ function ConstructValuation(isGeneric: boolean, prefix: string, classNames: stri str.push(left + " = " + value); } else { - str = str.concat(ConstructValuation(isGeneric, prefix, classNames, paramName, defaultValue) + " if " + value + " == None else " + value); + str = str.concat(ConstructValuation(isGeneric, prefix, classNames, paramName, defaultValue) + " if " + value + " is None else " + value); } return str; @@ -347,7 +347,7 @@ function GetSingleCommandBody(model: CodeModelAz, required, originalOperation: O } else if (model.MethodParameter_DefaultValue !== undefined && model.MethodParameter_Type != SchemaType.Constant) { // model is simple type with default value - output_body.push(" if " + model.MethodParameter_MapsTo + " == None:"); + output_body.push(" if " + model.MethodParameter_MapsTo + " is None:"); output_body.push(" " + model.MethodParameter_MapsTo + " = " + ToPythonString(model.MethodParameter_DefaultValue, model.MethodParameter_Type)); } } diff --git a/src/plugins/azgenerator/TemplateAzureCliHelp.ts b/src/plugins/azgenerator/TemplateAzureCliHelp.ts index 147cde21..f73da288 100644 --- a/src/plugins/azgenerator/TemplateAzureCliHelp.ts +++ b/src/plugins/azgenerator/TemplateAzureCliHelp.ts @@ -138,13 +138,9 @@ function addParameterHelp(output: string[], model: CodeModelAz, debug: boolean) } let parameterAlias: string[] = []; - if (parameterName.endsWith('name') && parameterName.replace(/_name$|_/g, '') == model.CommandGroup_DefaultName.toLowerCase()) { - parameterAlias.push('name'); - parameterAlias.push('n'); - } - if (!isNullOrUndefined(model.MethodParameter?.language?.['cli']?.['alias'])) { - if (!isNullOrUndefined(model.MethodParameter?.language?.['cli']?.['alias'])) { - let alias = model.MethodParameter?.language?.['cli']?.['alias']; + if (!isNullOrUndefined(model.MethodParameter?.language?.['az']?.['alias'])) { + if (!isNullOrUndefined(model.MethodParameter?.language?.['az']?.['alias'])) { + let alias = model.MethodParameter?.language?.['az']?.['alias']; if (typeof alias === "string") { parameterAlias.push(alias); @@ -168,19 +164,19 @@ function addParameterHelp(output: string[], model: CodeModelAz, debug: boolean) ToMultiLine(` - name: ${parameterAlias.join(' ')}`, action_output, 119, true); if (debug) { - let shortSummary = ""; + let shortSummary = '"'; if (model.MethodParameter_Description && model.MethodParameter_Description.trim().length > 0) { - shortSummary += model.MethodParameter_Description.trim(); + shortSummary += model.MethodParameter_Description.trim().replace(/"/g, '\\\\"'); } if (!shortSummary.endsWith(".")) { shortSummary += "."; } - shortSummary += " Swagger name=" + model.MethodParameter_CliKey; + shortSummary += " Swagger name=" + model.MethodParameter_CliKey + '"'; ToMultiLine(` short-summary: ${shortSummary}`.replace(/\r?\n|\r/g, ''), action_output, 119, true); } else { if (model.MethodParameter_Description && model.MethodParameter_Description.trim().length > 0) { - const shortSummary = model.MethodParameter_Description.trim(); - ToMultiLine(` short-summary: ${shortSummary}`.replace(/\r?\n|\r/g, ''), action_output, 119, true); + const shortSummary = model.MethodParameter_Description.trim().replace(/"/g, '\\\\"'); + ToMultiLine(` short-summary: "${shortSummary}"`.replace(/\r?\n|\r/g, ''), action_output, 119, true); } } @@ -271,13 +267,14 @@ function generateCommandHelp(model: CodeModelAz, debug: boolean = false) { // there will be just one method for create, update, delete, show, etc. // there may be a few list methods, so let's just take description from the first one. // as we can't use all of them - let shortSummary = " short-summary: " + model.Command_Help.trim(); + let shortSummary = ' short-summary: "' + model.Command_Help.trim(); if (debug) { if (!shortSummary.trimRight().endsWith(".")) { shortSummary += "."; } shortSummary += " Command group swagger name=" + model.CommandGroup_CliKey + ", Command swagger name=" + model.Method_CliKey; } + shortSummary += '"'; ToMultiLine(shortSummary, output, 119, true); diff --git a/src/plugins/azgenerator/TemplateAzureCliParams.ts b/src/plugins/azgenerator/TemplateAzureCliParams.ts index 3b3306b4..6b3fa444 100644 --- a/src/plugins/azgenerator/TemplateAzureCliParams.ts +++ b/src/plugins/azgenerator/TemplateAzureCliParams.ts @@ -171,10 +171,6 @@ function getCommandBody(model: CodeModelAz, needGeneric: boolean = false, debug: if (allPythonParam.has(parameterName)) { allPythonParam.delete(parameterName); } - if (allParam.has(parameterName)) { - continue; - } - allParam.set(parameterName, true); let argument = " c.argument('" + parameterName + "'"; // this is to handle names like "format", "type", etc @@ -223,7 +219,10 @@ function getCommandBody(model: CodeModelAz, needGeneric: boolean = false, debug: } - + if (allParam.has(parameterName)) { + continue; + } + allParam.set(parameterName, true); if (model.MethodParameter_Type == SchemaType.Boolean) { hasBoolean = true; diff --git a/src/plugins/aznamer.ts b/src/plugins/aznamer.ts index 9cec8da3..3c51e77b 100644 --- a/src/plugins/aznamer.ts +++ b/src/plugins/aznamer.ts @@ -26,7 +26,7 @@ export class AzNamer { } if(operationName.startsWith("create") && httpProtocol == "put") { return subOperationGroupName == ""? "create": subOperationGroupName + " " + "create"; - } else if(operationName.startsWith("update") && (httpProtocol == "put" || httpProtocol == "patch")) { + } else if(operationName == "update" && (httpProtocol == "put" || httpProtocol == "patch")) { return subOperationGroupName == ""? "update": subOperationGroupName + " " + "update"; } else if(operationName == "get" && httpProtocol == "get") { return subOperationGroupName == ""? "show": subOperationGroupName + " " + "show"; diff --git a/src/test/scenarios/attestation/output/src/attestation/azext_attestation/generated/_help.py b/src/test/scenarios/attestation/output/src/attestation/azext_attestation/generated/_help.py index 820c18ed..f2ba6aeb 100644 --- a/src/test/scenarios/attestation/output/src/attestation/azext_attestation/generated/_help.py +++ b/src/test/scenarios/attestation/output/src/attestation/azext_attestation/generated/_help.py @@ -19,12 +19,12 @@ helps['attestation'] = """ helps['attestation create-provider'] = """ type: command - short-summary: Creates or updates the Attestation Provider. + short-summary: "Creates or updates the Attestation Provider." parameters: - name: --policy-signing-certificates-keys - short-summary: The value of the "keys" parameter is an array of JWK values. By default, the order of the JWK \ -values within the array does not imply an order of preference among them, although applications of JWK Sets can choose \ -to assign a meaning to the order for their purposes, if desired. + short-summary: "The value of the \\"keys\\" parameter is an array of JWK values. By default, the order of the \ +JWK values within the array does not imply an order of preference among them, although applications of JWK Sets can \ +choose to assign a meaning to the order for their purposes, if desired." long-summary: | Usage: --policy-signing-certificates-keys alg=XX crv=XX d=XX dp=XX dq=XX e=XX k=XX kid=XX kty=XX n=XX p=XX \ q=XX qi=XX use=XX x=XX x5-c=XX y=XX @@ -72,7 +72,7 @@ value. The PKIX certificate containing the key value MUST be the first certifica helps['attestation list-operation'] = """ type: command - short-summary: Lists all of the available Azure attestation operations. + short-summary: "Lists all of the available Azure attestation operations." examples: - name: Operations_List text: |- @@ -91,7 +91,7 @@ helps['attestation attestation-provider provider'] = """ helps['attestation attestation-provider provider list'] = """ type: command - short-summary: Returns a list of attestation providers in a subscription. + short-summary: "Returns a list of attestation providers in a subscription." examples: - name: AttestationProviders_ListByResourceGroup text: |- @@ -100,7 +100,7 @@ helps['attestation attestation-provider provider list'] = """ helps['attestation attestation-provider show'] = """ type: command - short-summary: Get the status of Attestation Provider. + short-summary: "Get the status of Attestation Provider." examples: - name: AttestationProviders_Get text: |- @@ -110,7 +110,7 @@ helps['attestation attestation-provider show'] = """ helps['attestation attestation-provider update'] = """ type: command - short-summary: Updates the Attestation Provider. + short-summary: "Updates the Attestation Provider." examples: - name: AttestationProviders_Update text: |- @@ -120,7 +120,7 @@ helps['attestation attestation-provider update'] = """ helps['attestation attestation-provider delete'] = """ type: command - short-summary: Delete Attestation Service. + short-summary: "Delete Attestation Service." examples: - name: AttestationProviders_Delete text: |- diff --git a/src/test/scenarios/attestation/output/src/attestation/azext_attestation/generated/commands.py b/src/test/scenarios/attestation/output/src/attestation/azext_attestation/generated/commands.py index 3d2e99bf..3621b99b 100644 --- a/src/test/scenarios/attestation/output/src/attestation/azext_attestation/generated/commands.py +++ b/src/test/scenarios/attestation/output/src/attestation/azext_attestation/generated/commands.py @@ -34,4 +34,4 @@ def load_command_table(self, _): g.custom_command('provider list', 'attestation_attestation_provider_provider_list') g.custom_show_command('show', 'attestation_attestation_provider_show') g.custom_command('update', 'attestation_attestation_provider_update') - g.custom_command('delete', 'attestation_attestation_provider_delete') + g.custom_command('delete', 'attestation_attestation_provider_delete', confirmation=True) diff --git a/src/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/_help.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/_help.py index aa8b6729..ad933757 100644 --- a/src/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/_help.py +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/_help.py @@ -19,30 +19,30 @@ helps['boolean bool'] = """ helps['boolean bool get-false'] = """ type: command - short-summary: Get false Boolean value + short-summary: "Get false Boolean value" """ helps['boolean bool get-invalid'] = """ type: command - short-summary: Get invalid Boolean value + short-summary: "Get invalid Boolean value" """ helps['boolean bool get-null'] = """ type: command - short-summary: Get null Boolean value + short-summary: "Get null Boolean value" """ helps['boolean bool get-true'] = """ type: command - short-summary: Get true Boolean value + short-summary: "Get true Boolean value" """ helps['boolean bool put-false'] = """ type: command - short-summary: Set Boolean value false + short-summary: "Set Boolean value false" """ helps['boolean bool put-true'] = """ type: command - short-summary: Set Boolean value true + short-summary: "Set Boolean value true" """ diff --git a/src/test/scenarios/datafactory/output/src/datafactory/azext_datafactory/generated/_help.py b/src/test/scenarios/datafactory/output/src/datafactory/azext_datafactory/generated/_help.py index be13adb8..0fafc196 100644 --- a/src/test/scenarios/datafactory/output/src/datafactory/azext_datafactory/generated/_help.py +++ b/src/test/scenarios/datafactory/output/src/datafactory/azext_datafactory/generated/_help.py @@ -19,7 +19,7 @@ helps['datafactory'] = """ helps['datafactory list'] = """ type: command - short-summary: Lists factories under the specified subscription. + short-summary: "Lists factories under the specified subscription." examples: - name: Factories_ListByResourceGroup text: |- @@ -28,7 +28,7 @@ helps['datafactory list'] = """ helps['datafactory show'] = """ type: command - short-summary: Gets a factory. + short-summary: "Gets a factory." examples: - name: Factories_Get text: |- @@ -37,10 +37,10 @@ helps['datafactory show'] = """ helps['datafactory create'] = """ type: command - short-summary: Creates or updates a factory. + short-summary: "Creates or updates a factory." parameters: - name: --factory-vsts-configuration - short-summary: Factory's VSTS repo information. + short-summary: "Factory's VSTS repo information." long-summary: | Usage: --factory-vsts-configuration project-name=XX tenant-id=XX type=XX account-name=XX \ repository-name=XX collaboration-branch=XX root-folder=XX last-commit-id=XX @@ -54,7 +54,7 @@ repository-name=XX collaboration-branch=XX root-folder=XX last-commit-id=XX root-folder: Required. Root folder. last-commit-id: Last commit id. - name: --factory-git-hub-configuration - short-summary: Factory's GitHub repo information. + short-summary: "Factory's GitHub repo information." long-summary: | Usage: --factory-git-hub-configuration host-name=XX type=XX account-name=XX repository-name=XX \ collaboration-branch=XX root-folder=XX last-commit-id=XX @@ -67,7 +67,7 @@ collaboration-branch=XX root-folder=XX last-commit-id=XX root-folder: Required. Root folder. last-commit-id: Last commit id. - name: --fake-identity - short-summary: This is only for az test. + short-summary: "This is only for az test." long-summary: | Usage: --fake-identity name=XX zones-inside=XX @@ -82,7 +82,7 @@ collaboration-branch=XX root-folder=XX last-commit-id=XX helps['datafactory update'] = """ type: command - short-summary: Updates a factory. + short-summary: "Updates a factory." examples: - name: Factories_Update text: |- @@ -92,7 +92,7 @@ helps['datafactory update'] = """ helps['datafactory delete'] = """ type: command - short-summary: Deletes a factory. + short-summary: "Deletes a factory." examples: - name: Factories_Delete text: |- @@ -101,10 +101,10 @@ helps['datafactory delete'] = """ helps['datafactory configure-factory-repo'] = """ type: command - short-summary: Updates a factory's repo information. + short-summary: "Updates a factory's repo information." parameters: - name: --factory-vsts-configuration - short-summary: Factory's VSTS repo information. + short-summary: "Factory's VSTS repo information." long-summary: | Usage: --factory-vsts-configuration project-name=XX tenant-id=XX type=XX account-name=XX \ repository-name=XX collaboration-branch=XX root-folder=XX last-commit-id=XX @@ -118,7 +118,7 @@ repository-name=XX collaboration-branch=XX root-folder=XX last-commit-id=XX root-folder: Required. Root folder. last-commit-id: Last commit id. - name: --factory-git-hub-configuration - short-summary: Factory's GitHub repo information. + short-summary: "Factory's GitHub repo information." long-summary: | Usage: --factory-git-hub-configuration host-name=XX type=XX account-name=XX repository-name=XX \ collaboration-branch=XX root-folder=XX last-commit-id=XX @@ -141,7 +141,7 @@ repository-name="repo" root-folder="/" tenant-id="" --location-id "East US" helps['datafactory get-data-plane-access'] = """ type: command - short-summary: Get Data Plane access. + short-summary: "Get Data Plane access." examples: - name: Factories_GetDataPlaneAccess text: |- @@ -152,7 +152,7 @@ helps['datafactory get-data-plane-access'] = """ helps['datafactory get-git-hub-access-token'] = """ type: command - short-summary: Get GitHub Access Token. + short-summary: "Get GitHub Access Token." examples: - name: Factories_GetGitHubAccessToken text: |- @@ -167,7 +167,7 @@ helps['datafactory trigger'] = """ helps['datafactory trigger list'] = """ type: command - short-summary: Lists triggers. + short-summary: "Lists triggers." examples: - name: Triggers_ListByFactory text: |- @@ -176,7 +176,7 @@ helps['datafactory trigger list'] = """ helps['datafactory trigger show'] = """ type: command - short-summary: Gets a trigger. + short-summary: "Gets a trigger." examples: - name: Triggers_Get text: |- @@ -186,7 +186,7 @@ helps['datafactory trigger show'] = """ helps['datafactory trigger create'] = """ type: command - short-summary: Creates or updates a trigger. + short-summary: "Creates or updates a trigger." examples: - name: Triggers_Create text: |- @@ -199,7 +199,7 @@ eoutput.csv\\"]},\\"pipelineReference\\":{\\"type\\":\\"PipelineReference\\",\\" helps['datafactory trigger update'] = """ type: command - short-summary: Creates or updates a trigger. + short-summary: "Creates or updates a trigger." examples: - name: Triggers_Update text: |- @@ -209,7 +209,7 @@ helps['datafactory trigger update'] = """ helps['datafactory trigger delete'] = """ type: command - short-summary: Deletes a trigger. + short-summary: "Deletes a trigger." examples: - name: Triggers_Delete text: |- @@ -219,7 +219,7 @@ helps['datafactory trigger delete'] = """ helps['datafactory trigger get-event-subscription-status'] = """ type: command - short-summary: Get a trigger's event subscription status. + short-summary: "Get a trigger's event subscription status." examples: - name: Triggers_GetEventSubscriptionStatus text: |- @@ -229,7 +229,7 @@ helps['datafactory trigger get-event-subscription-status'] = """ helps['datafactory trigger query-by-factory'] = """ type: command - short-summary: Query triggers. + short-summary: "Query triggers." examples: - name: Triggers_QueryByFactory text: |- @@ -239,7 +239,7 @@ helps['datafactory trigger query-by-factory'] = """ helps['datafactory trigger start'] = """ type: command - short-summary: Starts a trigger. + short-summary: "Starts a trigger." examples: - name: Triggers_Start text: |- @@ -249,7 +249,7 @@ helps['datafactory trigger start'] = """ helps['datafactory trigger stop'] = """ type: command - short-summary: Stops a trigger. + short-summary: "Stops a trigger." examples: - name: Triggers_Stop text: |- @@ -259,7 +259,7 @@ helps['datafactory trigger stop'] = """ helps['datafactory trigger subscribe-to-event'] = """ type: command - short-summary: Subscribe event trigger to events. + short-summary: "Subscribe event trigger to events." examples: - name: Triggers_SubscribeToEvents text: |- @@ -269,7 +269,7 @@ helps['datafactory trigger subscribe-to-event'] = """ helps['datafactory trigger unsubscribe-from-event'] = """ type: command - short-summary: Unsubscribe event trigger from events. + short-summary: "Unsubscribe event trigger from events." examples: - name: Triggers_UnsubscribeFromEvents text: |- @@ -294,7 +294,7 @@ helps['datafactory integration-runtime'] = """ helps['datafactory integration-runtime list'] = """ type: command - short-summary: Lists integration runtimes. + short-summary: "Lists integration runtimes." examples: - name: IntegrationRuntimes_ListByFactory text: |- @@ -303,7 +303,7 @@ helps['datafactory integration-runtime list'] = """ helps['datafactory integration-runtime show'] = """ type: command - short-summary: Gets an integration runtime. + short-summary: "Gets an integration runtime." examples: - name: IntegrationRuntimes_Get text: |- @@ -318,7 +318,7 @@ helps['datafactory integration-runtime linked-integration-runtime'] = """ helps['datafactory integration-runtime linked-integration-runtime create'] = """ type: command - short-summary: Create a linked integration runtime entry in a shared integration runtime. + short-summary: "Create a linked integration runtime entry in a shared integration runtime." examples: - name: IntegrationRuntimes_CreateLinkedIntegrationRuntime text: |- @@ -336,10 +336,10 @@ helps['datafactory integration-runtime managed'] = """ helps['datafactory integration-runtime managed create'] = """ type: command - short-summary: Creates or updates an integration runtime. + short-summary: "Creates or updates an integration runtime." parameters: - name: --factory-vsts-configuration - short-summary: Factory's VSTS repo information. + short-summary: "Factory's VSTS repo information." long-summary: | Usage: --factory-vsts-configuration project-name=XX tenant-id=XX type=XX account-name=XX \ repository-name=XX collaboration-branch=XX root-folder=XX last-commit-id=XX @@ -353,7 +353,7 @@ repository-name=XX collaboration-branch=XX root-folder=XX last-commit-id=XX root-folder: Required. Root folder. last-commit-id: Last commit id. - name: --factory-git-hub-configuration - short-summary: Factory's GitHub repo information. + short-summary: "Factory's GitHub repo information." long-summary: | Usage: --factory-git-hub-configuration host-name=XX type=XX account-name=XX repository-name=XX \ collaboration-branch=XX root-folder=XX last-commit-id=XX @@ -366,7 +366,7 @@ collaboration-branch=XX root-folder=XX last-commit-id=XX root-folder: Required. Root folder. last-commit-id: Last commit id. - name: --fake-identity - short-summary: This is only for az test. + short-summary: "This is only for az test." long-summary: | Usage: --fake-identity name=XX zones-inside=XX @@ -381,7 +381,7 @@ helps['datafactory integration-runtime self-hosted'] = """ helps['datafactory integration-runtime self-hosted create'] = """ type: command - short-summary: Creates or updates an integration runtime. + short-summary: "Creates or updates an integration runtime." examples: - name: IntegrationRuntimes_Create text: |- @@ -391,7 +391,7 @@ selfhosted integration runtime" --name "myIntegrationRuntime" --resource-group " helps['datafactory integration-runtime update'] = """ type: command - short-summary: Updates an integration runtime. + short-summary: "Updates an integration runtime." examples: - name: IntegrationRuntimes_Update text: |- @@ -401,7 +401,7 @@ helps['datafactory integration-runtime update'] = """ helps['datafactory integration-runtime delete'] = """ type: command - short-summary: Deletes an integration runtime. + short-summary: "Deletes an integration runtime." examples: - name: IntegrationRuntimes_Delete text: |- @@ -411,8 +411,8 @@ helps['datafactory integration-runtime delete'] = """ helps['datafactory integration-runtime get-connection-info'] = """ type: command - short-summary: Gets the on-premises integration runtime connection information for encrypting the on-premises data \ -source credentials. + short-summary: "Gets the on-premises integration runtime connection information for encrypting the on-premises \ +data source credentials." examples: - name: IntegrationRuntimes_GetConnectionInfo text: |- @@ -422,8 +422,8 @@ source credentials. helps['datafactory integration-runtime get-monitoring-data'] = """ type: command - short-summary: Get the integration runtime monitoring data, which includes the monitor data for all the nodes \ -under this integration runtime. + short-summary: "Get the integration runtime monitoring data, which includes the monitor data for all the nodes \ +under this integration runtime." examples: - name: IntegrationRuntimes_GetMonitoringData text: |- @@ -433,7 +433,7 @@ under this integration runtime. helps['datafactory integration-runtime get-status'] = """ type: command - short-summary: Gets detailed status information for an integration runtime. + short-summary: "Gets detailed status information for an integration runtime." examples: - name: IntegrationRuntimes_GetStatus text: |- @@ -443,7 +443,7 @@ helps['datafactory integration-runtime get-status'] = """ helps['datafactory integration-runtime list-auth-key'] = """ type: command - short-summary: Retrieves the authentication keys for an integration runtime. + short-summary: "Retrieves the authentication keys for an integration runtime." examples: - name: IntegrationRuntimes_ListAuthKeys text: |- @@ -453,7 +453,7 @@ helps['datafactory integration-runtime list-auth-key'] = """ helps['datafactory integration-runtime regenerate-auth-key'] = """ type: command - short-summary: Regenerates the authentication key for an integration runtime. + short-summary: "Regenerates the authentication key for an integration runtime." examples: - name: IntegrationRuntimes_RegenerateAuthKey text: |- @@ -463,8 +463,8 @@ helps['datafactory integration-runtime regenerate-auth-key'] = """ helps['datafactory integration-runtime remove-link'] = """ type: command - short-summary: Remove all linked integration runtimes under specific data factory in a self-hosted integration \ -runtime. + short-summary: "Remove all linked integration runtimes under specific data factory in a self-hosted integration \ +runtime." examples: - name: IntegrationRuntimes_RemoveLinks text: |- @@ -474,7 +474,7 @@ runtime. helps['datafactory integration-runtime start'] = """ type: command - short-summary: Starts a ManagedReserved type integration runtime. + short-summary: "Starts a ManagedReserved type integration runtime." examples: - name: IntegrationRuntimes_Start text: |- @@ -484,7 +484,7 @@ helps['datafactory integration-runtime start'] = """ helps['datafactory integration-runtime stop'] = """ type: command - short-summary: Stops a ManagedReserved type integration runtime. + short-summary: "Stops a ManagedReserved type integration runtime." examples: - name: IntegrationRuntimes_Stop text: |- @@ -494,10 +494,10 @@ helps['datafactory integration-runtime stop'] = """ helps['datafactory integration-runtime sync-credentials'] = """ type: command - short-summary: Force the integration runtime to synchronize credentials across integration runtime nodes, and this \ -will override the credentials across all worker nodes with those available on the dispatcher node. If you already have \ -the latest credential backup file, you should manually import it (preferred) on any self-hosted integration runtime \ -node than using this API directly. + short-summary: "Force the integration runtime to synchronize credentials across integration runtime nodes, and \ +this will override the credentials across all worker nodes with those available on the dispatcher node. If you already \ +have the latest credential backup file, you should manually import it (preferred) on any self-hosted integration \ +runtime node than using this API directly." examples: - name: IntegrationRuntimes_SyncCredentials text: |- @@ -507,7 +507,7 @@ node than using this API directly. helps['datafactory integration-runtime upgrade'] = """ type: command - short-summary: Upgrade self-hosted integration runtime to latest version if availability. + short-summary: "Upgrade self-hosted integration runtime to latest version if availability." examples: - name: IntegrationRuntimes_Upgrade text: |- diff --git a/src/test/scenarios/datafactory/output/src/datafactory/azext_datafactory/generated/commands.py b/src/test/scenarios/datafactory/output/src/datafactory/azext_datafactory/generated/commands.py index 129de3cb..044f7a60 100644 --- a/src/test/scenarios/datafactory/output/src/datafactory/azext_datafactory/generated/commands.py +++ b/src/test/scenarios/datafactory/output/src/datafactory/azext_datafactory/generated/commands.py @@ -25,7 +25,7 @@ def load_command_table(self, _): g.custom_show_command('show', 'datafactory_show') g.custom_command('create', 'datafactory_create') g.custom_command('update', 'datafactory_update') - g.custom_command('delete', 'datafactory_delete') + g.custom_command('delete', 'datafactory_delete', confirmation=True) g.custom_command('configure-factory-repo', 'datafactory_configure_factory_repo') g.custom_command('get-data-plane-access', 'datafactory_get_data_plane_access') g.custom_command('get-git-hub-access-token', 'datafactory_get_git_hub_access_token') @@ -42,7 +42,7 @@ def load_command_table(self, _): g.custom_command('create', 'datafactory_trigger_create') g.generic_update_command('update', setter_arg_name='properties', custom_func_name='datafactory_trigger_update') - g.custom_command('delete', 'datafactory_trigger_delete') + g.custom_command('delete', 'datafactory_trigger_delete', confirmation=True) g.custom_command('get-event-subscription-status', 'datafactory_trigger_get_event_subscription_status') g.custom_command('query-by-factory', 'datafactory_trigger_query_by_factory') g.custom_command('start', 'datafactory_trigger_start', supports_no_wait=True) @@ -66,7 +66,7 @@ def load_command_table(self, _): g.custom_command('managed create', 'datafactory_integration_runtime_managed_create') g.custom_command('self-hosted create', 'datafactory_integration_runtime_self_hosted_create') g.custom_command('update', 'datafactory_integration_runtime_update') - g.custom_command('delete', 'datafactory_integration_runtime_delete') + g.custom_command('delete', 'datafactory_integration_runtime_delete', confirmation=True) g.custom_command('get-connection-info', 'datafactory_integration_runtime_get_connection_info') g.custom_command('get-monitoring-data', 'datafactory_integration_runtime_get_monitoring_data') g.custom_command('get-status', 'datafactory_integration_runtime_get_status') diff --git a/src/test/scenarios/managed-network/output/src/managed-network/azext_managed_network/generated/_help.py b/src/test/scenarios/managed-network/output/src/managed-network/azext_managed_network/generated/_help.py index e2fd235d..1e3a3c40 100644 --- a/src/test/scenarios/managed-network/output/src/managed-network/azext_managed_network/generated/_help.py +++ b/src/test/scenarios/managed-network/output/src/managed-network/azext_managed_network/generated/_help.py @@ -19,8 +19,8 @@ helps['managed-network mn'] = """ helps['managed-network mn list'] = """ type: command - short-summary: The ListBySubscription ManagedNetwork operation retrieves all the Managed Network Resources in the \ -current subscription in a paginated format. + short-summary: "The ListBySubscription ManagedNetwork operation retrieves all the Managed Network Resources in \ +the current subscription in a paginated format." examples: - name: Get Managed Network text: |- @@ -29,8 +29,8 @@ current subscription in a paginated format. helps['managed-network mn create'] = """ type: command - short-summary: The Put ManagedNetworks operation creates/updates a Managed Network Resource, specified by resource \ -group and Managed Network name + short-summary: "The Put ManagedNetworks operation creates/updates a Managed Network Resource, specified by \ +resource group and Managed Network name" examples: - name: Create/Update Managed Network text: |- @@ -48,7 +48,7 @@ osoft.Network/virtualNetworks/myVirtualNetwork3/subnets/default\\"}]}" --name "m helps['managed-network mn update'] = """ type: command - short-summary: Updates the specified Managed Network resource tags. + short-summary: "Updates the specified Managed Network resource tags." examples: - name: Create/Update Managed Network text: |- @@ -57,8 +57,8 @@ helps['managed-network mn update'] = """ helps['managed-network mn delete'] = """ type: command - short-summary: The Delete ManagedNetworks operation deletes a Managed Network Resource, specified by the resource \ -group and Managed Network name + short-summary: "The Delete ManagedNetworks operation deletes a Managed Network Resource, specified by the \ +resource group and Managed Network name" examples: - name: Delete Managed Network text: |- @@ -67,8 +67,8 @@ group and Managed Network name helps['managed-network mn get-modify'] = """ type: command - short-summary: The Get ManagedNetworks operation gets a Managed Network Resource, specified by the resource group \ -and Managed Network name + short-summary: "The Get ManagedNetworks operation gets a Managed Network Resource, specified by the resource group \ +and Managed Network name" examples: - name: Get Managed Network text: |- @@ -82,7 +82,7 @@ helps['managed-network mn scope-assignment'] = """ helps['managed-network mn scope-assignment list'] = """ type: command - short-summary: Get the specified scope assignment. + short-summary: "Get the specified scope assignment." examples: - name: Create/Update Managed Network text: |- @@ -91,7 +91,7 @@ helps['managed-network mn scope-assignment list'] = """ helps['managed-network mn scope-assignment show'] = """ type: command - short-summary: Get the specified scope assignment. + short-summary: "Get the specified scope assignment." examples: - name: Create/Update Managed Network text: |- @@ -101,7 +101,7 @@ helps['managed-network mn scope-assignment show'] = """ helps['managed-network mn scope-assignment create'] = """ type: command - short-summary: Creates a scope assignment. + short-summary: "Creates a scope assignment." examples: - name: Create/Update Managed Network text: |- @@ -112,7 +112,7 @@ esourceGroups/myResourceGroup/providers/Microsoft.ManagedNetwork/managedNetworks helps['managed-network mn scope-assignment update'] = """ type: command - short-summary: Creates a scope assignment. + short-summary: "Creates a scope assignment." examples: - name: Create/Update Managed Network text: |- @@ -123,7 +123,7 @@ esourceGroups/myResourceGroup/providers/Microsoft.ManagedNetwork/managedNetworks helps['managed-network mn scope-assignment delete'] = """ type: command - short-summary: Deletes a scope assignment. + short-summary: "Deletes a scope assignment." examples: - name: Create/Update Managed Network text: |- @@ -138,8 +138,8 @@ helps['managed-network mn group'] = """ helps['managed-network mn group list'] = """ type: command - short-summary: The ListByManagedNetwork ManagedNetworkGroup operation retrieves all the Managed Network Groups in \ -a specified Managed Networks in a paginated format. + short-summary: "The ListByManagedNetwork ManagedNetworkGroup operation retrieves all the Managed Network Groups in \ +a specified Managed Networks in a paginated format." examples: - name: Get Managed Network Group text: |- @@ -149,8 +149,8 @@ a specified Managed Networks in a paginated format. helps['managed-network mn group show'] = """ type: command - short-summary: The Get ManagedNetworkGroups operation gets a Managed Network Group specified by the resource \ -group, Managed Network name, and group name + short-summary: "The Get ManagedNetworkGroups operation gets a Managed Network Group specified by the resource \ +group, Managed Network name, and group name" examples: - name: Get Managed Network Group text: |- @@ -160,10 +160,10 @@ group, Managed Network name, and group name helps['managed-network mn group create'] = """ type: command - short-summary: The Put ManagedNetworkGroups operation creates or updates a Managed Network Group resource + short-summary: "The Put ManagedNetworkGroups operation creates or updates a Managed Network Group resource" parameters: - name: --subscriptions - short-summary: The collection of subscriptions covered by the Managed Network + short-summary: "The collection of subscriptions covered by the Managed Network" long-summary: | Usage: --subscriptions id=XX @@ -171,7 +171,7 @@ helps['managed-network mn group create'] = """ Multiple actions can be specified by using more than one --subscriptions argument. - name: --virtual-networks - short-summary: The collection of virtual nets covered by the Managed Network + short-summary: "The collection of virtual nets covered by the Managed Network" long-summary: | Usage: --virtual-networks id=XX @@ -179,7 +179,7 @@ helps['managed-network mn group create'] = """ Multiple actions can be specified by using more than one --virtual-networks argument. - name: --subnets - short-summary: The collection of subnets covered by the Managed Network + short-summary: "The collection of subnets covered by the Managed Network" long-summary: | Usage: --subnets id=XX @@ -198,10 +198,10 @@ id="/subscriptionB/resourceGroups/myResourceGroup/providers/Microsoft.Network/vi helps['managed-network mn group update'] = """ type: command - short-summary: The Put ManagedNetworkGroups operation creates or updates a Managed Network Group resource + short-summary: "The Put ManagedNetworkGroups operation creates or updates a Managed Network Group resource" parameters: - name: --subscriptions - short-summary: The collection of subscriptions covered by the Managed Network + short-summary: "The collection of subscriptions covered by the Managed Network" long-summary: | Usage: --subscriptions id=XX @@ -209,7 +209,7 @@ helps['managed-network mn group update'] = """ Multiple actions can be specified by using more than one --subscriptions argument. - name: --virtual-networks - short-summary: The collection of virtual nets covered by the Managed Network + short-summary: "The collection of virtual nets covered by the Managed Network" long-summary: | Usage: --virtual-networks id=XX @@ -217,7 +217,7 @@ helps['managed-network mn group update'] = """ Multiple actions can be specified by using more than one --virtual-networks argument. - name: --subnets - short-summary: The collection of subnets covered by the Managed Network + short-summary: "The collection of subnets covered by the Managed Network" long-summary: | Usage: --subnets id=XX @@ -236,8 +236,8 @@ id="/subscriptionB/resourceGroups/myResourceGroup/providers/Microsoft.Network/vi helps['managed-network mn group delete'] = """ type: command - short-summary: The Delete ManagedNetworkGroups operation deletes a Managed Network Group specified by the resource \ -group, Managed Network name, and group name + short-summary: "The Delete ManagedNetworkGroups operation deletes a Managed Network Group specified by the \ +resource group, Managed Network name, and group name" examples: - name: Delete Managed Network Group text: |- @@ -270,8 +270,8 @@ helps['managed-network managed-network-peering-policy'] = """ helps['managed-network managed-network-peering-policy list'] = """ type: command - short-summary: The ListByManagedNetwork PeeringPolicies operation retrieves all the Managed Network Peering \ -Policies in a specified Managed Network, in a paginated format. + short-summary: "The ListByManagedNetwork PeeringPolicies operation retrieves all the Managed Network Peering \ +Policies in a specified Managed Network, in a paginated format." examples: - name: Get Managed Network Group text: |- @@ -281,8 +281,8 @@ Policies in a specified Managed Network, in a paginated format. helps['managed-network managed-network-peering-policy show'] = """ type: command - short-summary: The Get ManagedNetworkPeeringPolicies operation gets a Managed Network Peering Policy resource, \ -specified by the resource group, Managed Network name, and peering policy name + short-summary: "The Get ManagedNetworkPeeringPolicies operation gets a Managed Network Peering Policy resource, \ +specified by the resource group, Managed Network name, and peering policy name" examples: - name: Get Managed Network Peering Policy text: |- @@ -297,17 +297,17 @@ helps['managed-network managed-network-peering-policy hub-and-spoke-topology'] = helps['managed-network managed-network-peering-policy hub-and-spoke-topology create'] = """ type: command - short-summary: The Put ManagedNetworkPeeringPolicies operation creates/updates a new Managed Network Peering \ -Policy + short-summary: "The Put ManagedNetworkPeeringPolicies operation creates/updates a new Managed Network Peering \ +Policy" parameters: - name: --hub - short-summary: Gets or sets the hub virtual network ID + short-summary: "Gets or sets the hub virtual network ID" long-summary: | Usage: --hub id=XX id: Resource Id - name: --spokes - short-summary: Gets or sets the spokes group IDs + short-summary: "Gets or sets the spokes group IDs" long-summary: | Usage: --spokes id=XX @@ -315,7 +315,7 @@ Policy Multiple actions can be specified by using more than one --spokes argument. - name: --mesh - short-summary: Gets or sets the mesh group IDs + short-summary: "Gets or sets the mesh group IDs" long-summary: | Usage: --mesh id=XX @@ -339,17 +339,17 @@ helps['managed-network managed-network-peering-policy mesh-topology'] = """ helps['managed-network managed-network-peering-policy mesh-topology create'] = """ type: command - short-summary: The Put ManagedNetworkPeeringPolicies operation creates/updates a new Managed Network Peering \ -Policy + short-summary: "The Put ManagedNetworkPeeringPolicies operation creates/updates a new Managed Network Peering \ +Policy" parameters: - name: --hub - short-summary: Gets or sets the hub virtual network ID + short-summary: "Gets or sets the hub virtual network ID" long-summary: | Usage: --hub id=XX id: Resource Id - name: --spokes - short-summary: Gets or sets the spokes group IDs + short-summary: "Gets or sets the spokes group IDs" long-summary: | Usage: --spokes id=XX @@ -357,7 +357,7 @@ Policy Multiple actions can be specified by using more than one --spokes argument. - name: --mesh - short-summary: Gets or sets the mesh group IDs + short-summary: "Gets or sets the mesh group IDs" long-summary: | Usage: --mesh id=XX @@ -368,17 +368,17 @@ Policy helps['managed-network managed-network-peering-policy hub-and-spoke-topology update'] = """ type: command - short-summary: The Put ManagedNetworkPeeringPolicies operation creates/updates a new Managed Network Peering \ -Policy + short-summary: "The Put ManagedNetworkPeeringPolicies operation creates/updates a new Managed Network Peering \ +Policy" parameters: - name: --hub - short-summary: Gets or sets the hub virtual network ID + short-summary: "Gets or sets the hub virtual network ID" long-summary: | Usage: --hub id=XX id: Resource Id - name: --spokes - short-summary: Gets or sets the spokes group IDs + short-summary: "Gets or sets the spokes group IDs" long-summary: | Usage: --spokes id=XX @@ -386,7 +386,7 @@ Policy Multiple actions can be specified by using more than one --spokes argument. - name: --mesh - short-summary: Gets or sets the mesh group IDs + short-summary: "Gets or sets the mesh group IDs" long-summary: | Usage: --mesh id=XX @@ -405,17 +405,17 @@ ps/myManagedNetworkGroup" --resource-group "myResourceGroup" helps['managed-network managed-network-peering-policy mesh-topology update'] = """ type: command - short-summary: The Put ManagedNetworkPeeringPolicies operation creates/updates a new Managed Network Peering \ -Policy + short-summary: "The Put ManagedNetworkPeeringPolicies operation creates/updates a new Managed Network Peering \ +Policy" parameters: - name: --hub - short-summary: Gets or sets the hub virtual network ID + short-summary: "Gets or sets the hub virtual network ID" long-summary: | Usage: --hub id=XX id: Resource Id - name: --spokes - short-summary: Gets or sets the spokes group IDs + short-summary: "Gets or sets the spokes group IDs" long-summary: | Usage: --spokes id=XX @@ -423,7 +423,7 @@ Policy Multiple actions can be specified by using more than one --spokes argument. - name: --mesh - short-summary: Gets or sets the mesh group IDs + short-summary: "Gets or sets the mesh group IDs" long-summary: | Usage: --mesh id=XX @@ -434,8 +434,8 @@ Policy helps['managed-network managed-network-peering-policy delete'] = """ type: command - short-summary: The Delete ManagedNetworkPeeringPolicies operation deletes a Managed Network Peering Policy, \ -specified by the resource group, Managed Network name, and peering policy name + short-summary: "The Delete ManagedNetworkPeeringPolicies operation deletes a Managed Network Peering Policy, \ +specified by the resource group, Managed Network name, and peering policy name" examples: - name: Get Managed Network Peering Policy text: |- diff --git a/src/test/scenarios/managed-network/output/src/managed-network/azext_managed_network/generated/commands.py b/src/test/scenarios/managed-network/output/src/managed-network/azext_managed_network/generated/commands.py index eb15d73e..22f9db8e 100644 --- a/src/test/scenarios/managed-network/output/src/managed-network/azext_managed_network/generated/commands.py +++ b/src/test/scenarios/managed-network/output/src/managed-network/azext_managed_network/generated/commands.py @@ -24,7 +24,7 @@ def load_command_table(self, _): g.custom_command('list', 'managed_network_mn_list') g.custom_command('create', 'managed_network_mn_create') g.custom_command('update', 'managed_network_mn_update') - g.custom_command('delete', 'managed_network_mn_delete') + g.custom_command('delete', 'managed_network_mn_delete', confirmation=True) g.custom_command('get-modify', 'managed_network_mn_get_modify') from azext_managed_network.generated._client_factory import cf_scope_assignment @@ -38,7 +38,7 @@ def load_command_table(self, _): g.custom_show_command('show', 'managed_network_mn_scope_assignment_show') g.custom_command('create', 'managed_network_mn_scope_assignment_create') g.custom_command('update', 'managed_network_mn_scope_assignment_update') - g.custom_command('delete', 'managed_network_mn_scope_assignment_delete') + g.custom_command('delete', 'managed_network_mn_scope_assignment_delete', confirmation=True) from azext_managed_network.generated._client_factory import cf_managed_network_group managed_network_managed_network_group = CliCommandType( @@ -51,7 +51,7 @@ def load_command_table(self, _): g.custom_show_command('show', 'managed_network_mn_group_show') g.custom_command('create', 'managed_network_mn_group_create', supports_no_wait=True) g.custom_command('update', 'managed_network_mn_group_update', supports_no_wait=True) - g.custom_command('delete', 'managed_network_mn_group_delete', supports_no_wait=True) + g.custom_command('delete', 'managed_network_mn_group_delete', supports_no_wait=True, confirmation=True) g.custom_wait_command('wait', 'managed_network_mn_group_show') from azext_managed_network.generated._client_factory import cf_managed_network_peering_policy @@ -74,5 +74,6 @@ def load_command_table(self, _): g.generic_update_command('mesh-topology update', setter_arg_name='properties', setter_name='' 'begin_create_or_update', custom_func_name='managed_network_managed_network_peering_po' 'licy_mesh_topology_update', supports_no_wait=True) - g.custom_command('delete', 'managed_network_managed_network_peering_policy_delete', supports_no_wait=True) + g.custom_command('delete', 'managed_network_managed_network_peering_policy_delete', supports_no_wait=True, + confirmation=True) g.custom_wait_command('wait', 'managed_network_managed_network_peering_policy_show')