From 00ea1cdee06eb16e8befcbb8ffa8abf35ba99f4d Mon Sep 17 00:00:00 2001 From: sushil490023 Date: Thu, 3 Nov 2022 13:12:31 +0530 Subject: [PATCH] Added Response Schema for Runbook Operation (#21128) * Added Response Schema for Runbook Operation * Update resopnse of Runbook Operation * Updated example to fix Avacado errors * Update resopnse of Runbook Operation * Updated example to fix Avacado errors * Fix Lint diff errors * Fix Avacado errors * Fix Avacado errors Co-authored-by: Sushil Upadhyay --- .../examples/replaceRunbookDraftContent.json | 7 +- ...ndoDraftEditToLastKnownPublishedState.json | 4 +- .../2018-06-30/examples/updateRunbook.json | 3 +- .../examples/replaceRunbookDraftContent.json | 4 +- ...ndoDraftEditToLastKnownPublishedState.json | 4 +- .../stable/2022-08-08/runbook.json | 80 ++++++++++++++----- .../automation/resource-manager/readme.md | 6 +- 7 files changed, 78 insertions(+), 30 deletions(-) diff --git a/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/replaceRunbookDraftContent.json b/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/replaceRunbookDraftContent.json index e46d7b30ddf8..289ce4e33b72 100644 --- a/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/replaceRunbookDraftContent.json +++ b/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/replaceRunbookDraftContent.json @@ -11,9 +11,10 @@ "202": { "headers": { "Location": "https://management.azure.com/subscriptions/subid/resourcegroups/rg/providers/Microsoft.Automation/automationAccounts/ContoseAutomationAccount/runbooks/Get-AzureVMTutorial/draft/content/operationResults/9bd70be2-cf73-49b4-9467-5261d48c2b3d?api-version=2015-10-31" - }, - "body": {} + } }, - "200": {} + "200": { + "body": {} + } } } diff --git a/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/undoDraftEditToLastKnownPublishedState.json b/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/undoDraftEditToLastKnownPublishedState.json index 25db3cea3728..c493a2b56bd9 100644 --- a/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/undoDraftEditToLastKnownPublishedState.json +++ b/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/undoDraftEditToLastKnownPublishedState.json @@ -7,6 +7,8 @@ "api-version": "2018-06-30" }, "responses": { - "200": {} + "200": { + "body": {} + } } } diff --git a/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/updateRunbook.json b/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/updateRunbook.json index b07209624795..89a16481dc7e 100644 --- a/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/updateRunbook.json +++ b/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/updateRunbook.json @@ -39,7 +39,8 @@ "creationTime": "2017-03-30T21:01:33.777+00:00", "lastModifiedBy": "myEmaild@microsoft.com", "lastModifiedTime": "2017-03-30T21:01:39.45+00:00" - } + }, + "body": {} } } } diff --git a/specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/replaceRunbookDraftContent.json b/specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/replaceRunbookDraftContent.json index 7662c3270b27..aba8ecc2658c 100644 --- a/specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/replaceRunbookDraftContent.json +++ b/specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/replaceRunbookDraftContent.json @@ -13,6 +13,8 @@ "Location": "https://management.azure.com/subscriptions/subid/resourcegroups/rg/providers/Microsoft.Automation/automationAccounts/ContoseAutomationAccount/runbooks/Get-AzureVMTutorial/draft/content/operationResults/9bd70be2-cf73-49b4-9467-5261d48c2b3d?api-version=2019-06-01" } }, - "200": {} + "200": { + "body": {} + } } } diff --git a/specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/undoDraftEditToLastKnownPublishedState.json b/specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/undoDraftEditToLastKnownPublishedState.json index 91dcb89c34e2..e6a50bfcf42c 100644 --- a/specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/undoDraftEditToLastKnownPublishedState.json +++ b/specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/undoDraftEditToLastKnownPublishedState.json @@ -7,6 +7,8 @@ "api-version": "2022-08-08" }, "responses": { - "200": {} + "200": { + "body": {} + } } } diff --git a/specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/runbook.json b/specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/runbook.json index 76fa2eb51e55..acaab06af79b 100644 --- a/specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/runbook.json +++ b/specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/runbook.json @@ -69,7 +69,8 @@ "in": "path", "required": true, "type": "string", - "description": "The runbook name." + "description": "The runbook name.", + "pattern": "^[a-zA-Z]*-*[a-zA-Z0-9]*$" }, { "$ref": "../../common/v1/definitions.json#/parameters/ApiVersionParameter" @@ -122,7 +123,8 @@ "in": "path", "required": true, "type": "string", - "description": "The runbook name." + "description": "The runbook name.", + "pattern": "^[a-zA-Z]*-*[a-zA-Z0-9]*$" }, { "name": "runbookContent", @@ -140,7 +142,10 @@ ], "responses": { "200": { - "description": "OK" + "description": "OK", + "schema": { + "type": "file" + } }, "202": { "description": "Accepted and the operation will complete asynchronously.", @@ -160,7 +165,7 @@ }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { - "final-state-via": "location" + "final-state-via": "azure-async-operation" } } }, @@ -194,7 +199,8 @@ "in": "path", "required": true, "type": "string", - "description": "The runbook name." + "description": "The runbook name.", + "pattern": "^[a-zA-Z]*-*[a-zA-Z0-9]*$" }, { "$ref": "../../common/v1/definitions.json#/parameters/ApiVersionParameter" @@ -246,7 +252,8 @@ "in": "path", "required": true, "type": "string", - "description": "The parameters supplied to the publish runbook operation." + "description": "The parameters supplied to the publish runbook operation.", + "pattern": "^[a-zA-Z]*-*[a-zA-Z0-9]*$" }, { "$ref": "../../common/v1/definitions.json#/parameters/ApiVersionParameter" @@ -302,7 +309,8 @@ "in": "path", "required": true, "type": "string", - "description": "The runbook name." + "description": "The runbook name.", + "pattern": "^[a-zA-Z]*-*[a-zA-Z0-9]*$" }, { "$ref": "../../common/v1/definitions.json#/parameters/ApiVersionParameter" @@ -310,7 +318,10 @@ ], "responses": { "200": { - "description": "OK" + "description": "OK", + "schema": { + "$ref": "#/definitions/RunbookDraftUndoEditResult" + } }, "default": { "description": "Automation error response describing why the operation failed.", @@ -354,7 +365,8 @@ "in": "path", "required": true, "type": "string", - "description": "The runbook name." + "description": "The runbook name.", + "pattern": "^[a-zA-Z]*-*[a-zA-Z0-9]*$" }, { "$ref": "../../common/v1/definitions.json#/parameters/ApiVersionParameter" @@ -406,7 +418,8 @@ "in": "path", "required": true, "type": "string", - "description": "The runbook name." + "description": "The runbook name.", + "pattern": "^[a-zA-Z]*-*[a-zA-Z0-9]*$" }, { "$ref": "../../common/v1/definitions.json#/parameters/ApiVersionParameter" @@ -459,7 +472,8 @@ "in": "path", "required": true, "type": "string", - "description": "The runbook name." + "description": "The runbook name.", + "pattern": "^[a-zA-Z]*-*[a-zA-Z0-9]*$" }, { "name": "parameters", @@ -524,7 +538,8 @@ "in": "path", "required": true, "type": "string", - "description": "The runbook name." + "description": "The runbook name.", + "pattern": "^[a-zA-Z]*-*[a-zA-Z0-9]*$" }, { "name": "parameters", @@ -583,7 +598,8 @@ "in": "path", "required": true, "type": "string", - "description": "The runbook name." + "description": "The runbook name.", + "pattern": "^[a-zA-Z]*-*[a-zA-Z0-9]*$" }, { "$ref": "../../common/v1/definitions.json#/parameters/ApiVersionParameter" @@ -683,7 +699,8 @@ "in": "path", "required": true, "type": "string", - "description": "The runbook name." + "description": "The runbook name.", + "pattern": "^[a-zA-Z]*-*[a-zA-Z0-9]*$" }, { "name": "jobStreamId", @@ -742,7 +759,8 @@ "in": "path", "required": true, "type": "string", - "description": "The runbook name." + "description": "The runbook name.", + "pattern": "^[a-zA-Z]*-*[a-zA-Z0-9]*$" }, { "name": "$filter", @@ -804,7 +822,8 @@ "in": "path", "required": true, "type": "string", - "description": "The parameters supplied to the create test job operation." + "description": "The parameters supplied to the create test job operation.", + "pattern": "^[a-zA-Z]*-*[a-zA-Z0-9]*$" }, { "name": "parameters", @@ -863,7 +882,8 @@ "in": "path", "required": true, "type": "string", - "description": "The runbook name." + "description": "The runbook name.", + "pattern": "^[a-zA-Z]*-*[a-zA-Z0-9]*$" }, { "$ref": "../../common/v1/definitions.json#/parameters/ApiVersionParameter" @@ -915,7 +935,8 @@ "in": "path", "required": true, "type": "string", - "description": "The runbook name." + "description": "The runbook name.", + "pattern": "^[a-zA-Z]*-*[a-zA-Z0-9]*$" }, { "$ref": "../../common/v1/definitions.json#/parameters/ApiVersionParameter" @@ -964,7 +985,8 @@ "in": "path", "required": true, "type": "string", - "description": "The runbook name." + "description": "The runbook name.", + "pattern": "^[a-zA-Z]*-*[a-zA-Z0-9]*$" }, { "$ref": "../../common/v1/definitions.json#/parameters/ApiVersionParameter" @@ -1013,7 +1035,8 @@ "in": "path", "required": true, "type": "string", - "description": "The runbook name." + "description": "The runbook name.", + "pattern": "^[a-zA-Z]*-*[a-zA-Z0-9]*$" }, { "$ref": "../../common/v1/definitions.json#/parameters/ApiVersionParameter" @@ -1035,6 +1058,7 @@ }, "definitions": { "JobStream": { + "type": "object", "properties": { "id": { "type": "string", @@ -1049,6 +1073,7 @@ "description": "Definition of the job stream." }, "JobStreamProperties": { + "type": "object", "properties": { "jobStreamId": { "type": "string", @@ -1097,6 +1122,7 @@ "description": "Definition of the job stream." }, "JobStreamListResult": { + "type": "object", "properties": { "value": { "type": "array", @@ -1149,6 +1175,7 @@ "description": "Definition of the content link." }, "RunbookProperties": { + "type": "object", "properties": { "runbookType": { "type": "string", @@ -1256,6 +1283,7 @@ "description": "Definition of the runbook property type." }, "Runbook": { + "type": "object", "properties": { "properties": { "$ref": "#/definitions/RunbookProperties", @@ -1275,6 +1303,7 @@ "description": "Definition of the runbook type." }, "RunbookListResult": { + "type": "object", "properties": { "value": { "type": "array", @@ -1291,6 +1320,7 @@ "description": "The response model for the list runbook operation." }, "RunbookCreateOrUpdateProperties": { + "type": "object", "properties": { "logVerbose": { "type": "boolean", @@ -1342,6 +1372,7 @@ "description": "The parameters supplied to the create or update runbook properties." }, "RunbookCreateOrUpdateParameters": { + "type": "object", "properties": { "properties": { "$ref": "#/definitions/RunbookCreateOrUpdateProperties", @@ -1370,6 +1401,7 @@ "description": "The parameters supplied to the create or update runbook operation." }, "RunbookUpdateProperties": { + "type": "object", "properties": { "description": { "type": "string", @@ -1392,6 +1424,7 @@ "description": "The parameters supplied to the update runbook properties." }, "RunbookUpdateParameters": { + "type": "object", "properties": { "properties": { "$ref": "#/definitions/RunbookUpdateProperties", @@ -1417,6 +1450,7 @@ "description": "The parameters supplied to the update runbook operation." }, "RunbookDraftUndoEditResult": { + "type": "object", "properties": { "statusCode": { "type": "string", @@ -1481,6 +1515,7 @@ "description": "The response model for the undo edit runbook operation." }, "RunbookDraft": { + "type": "object", "properties": { "inEdit": { "type": "boolean", @@ -1519,6 +1554,7 @@ } }, "RunbookParameter": { + "type": "object", "properties": { "type": { "type": "string", @@ -1541,6 +1577,7 @@ "description": "Definition of the runbook parameter type." }, "TestJobCreateParameters": { + "type": "object", "properties": { "parameters": { "type": "object", @@ -1557,6 +1594,7 @@ "description": "The parameters supplied to the create test job operation." }, "TestJob": { + "type": "object", "x-ms-mutability": [ "read", "create" @@ -1624,6 +1662,7 @@ "description": "Definition of the test job." }, "RunbookCreateOrUpdateDraftProperties": { + "type": "object", "properties": { "logVerbose": { "type": "boolean", @@ -1672,6 +1711,7 @@ "description": "The parameters supplied to the create or update draft runbook properties." }, "RunbookCreateOrUpdateDraftParameters": { + "type": "object", "properties": { "runbookContent": { "type": "string", diff --git a/specification/automation/resource-manager/readme.md b/specification/automation/resource-manager/readme.md index 833f00f375a1..67346150c9f5 100644 --- a/specification/automation/resource-manager/readme.md +++ b/specification/automation/resource-manager/readme.md @@ -366,7 +366,6 @@ input-file: - Microsoft.Automation/stable/2019-06-01/softwareUpdateConfiguration.json - Microsoft.Automation/stable/2015-10-31/webhook.json - Microsoft.Automation/stable/2022-01-31/deletedAutomationAccount.json -- Microsoft.Automation/stable/2022-08-08/python3package.json - Microsoft.Automation/stable/2022-08-08/account.json - Microsoft.Automation/stable/2022-08-08/certificate.json - Microsoft.Automation/stable/2022-08-08/connection.json @@ -402,7 +401,6 @@ directive: where: $.definitions.TestJob - suppress: BodyTopLevelProperties from: runbook.json - where: $.definitions.TestJob.properties - suppress: DefinitionsPropertiesNamesCamelCase from: account.json where: $.definitions.Key.properties.KeyName @@ -499,7 +497,9 @@ directive: - suppress: DefaultErrorResponseSchema from: variable.json reason: This error format is already part of the previous api, cannot change it as it will result in breaking change. - + - suppress: DefaultErrorResponseSchema + from: runbook.json + reason: This error format is already part of the previous api, cannot change it as it will result in breaking change. - suppress: DeleteOperationResponses from: credential.json reason: This error format is already part of the previous api, cannot change it as it will result in breaking change.