From e2572ce987ac782995310a9ae1b1ed83454f87af Mon Sep 17 00:00:00 2001 From: Bhaskar Brahma Date: Tue, 30 Jan 2018 14:45:42 -0800 Subject: [PATCH 1/2] Added example for webhook generate URI operation --- .../2015-10-31/examples/webhookGenerateUri.json | 14 ++++++++++++++ .../stable/2015-10-31/webhook.json | 5 +++++ 2 files changed, 19 insertions(+) create mode 100644 specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/examples/webhookGenerateUri.json diff --git a/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/examples/webhookGenerateUri.json b/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/examples/webhookGenerateUri.json new file mode 100644 index 000000000000..0d1eb5d8e802 --- /dev/null +++ b/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/examples/webhookGenerateUri.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "subscriptionId": "subid", + "resourceGroupName": "rg", + "automationAccountName": "myAutomationAccount33", + "api-version": "2015-10-31" + }, + "responses": { + "200": { + "headers": {}, + "body": "https://s13events.azure-automation.net/webhooks?token=O6n03K%2b1%2bSLPH50m4x9%2fcbcqtAu2tJDTvr8QHnbJ1kw%3d" + } + } +} \ No newline at end of file diff --git a/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/webhook.json b/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/webhook.json index 0edbcdde196f..9c3c2fa3561b 100644 --- a/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/webhook.json +++ b/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/webhook.json @@ -43,6 +43,11 @@ "externalDocs": { "url": "http://aka.ms/azureautomationsdk/webhookoperations" }, + "x-ms-examples": { + "Generate webhook uri": { + "$ref": "./examples/webhookGenerateUri.json" + } + }, "parameters": [ { "$ref": "./definitions.json#/parameters/ResourceGroupNameParameter" From 6eeada06303d68265ab19f0808729d05ad0e2cfb Mon Sep 17 00:00:00 2001 From: Bhaskar Brahma Date: Wed, 31 Jan 2018 17:42:58 -0800 Subject: [PATCH 2/2] Fixed Swagger validation error for Webhook Fixed the Model definition 'Webhook' must have the properties 'name', 'id' and 'type' in its hierarchy and these properties must be marked as readonly issue --- .../stable/2015-10-31/definitions.json | 11 +++++++++-- .../2015-10-31/examples/createOrUpdateWebhook.json | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/definitions.json b/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/definitions.json index eb27420f76f6..2dcc1c0e0ee0 100644 --- a/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/definitions.json +++ b/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/definitions.json @@ -3680,11 +3680,18 @@ "properties": { "id": { "type": "string", - "description": "Gets or sets the id of the resource." + "readOnly": true, + "description": "Gets the id of the resource." }, "name": { "type": "string", - "description": "Gets or sets the name of the webhook." + "readOnly": true, + "description": "Gets the name of the webhook." + }, + "type": { + "type": "string", + "readOnly": true, + "description": "Gets the type of the resource." }, "properties": { "$ref": "#/definitions/WebhookProperties", diff --git a/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/examples/createOrUpdateWebhook.json b/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/examples/createOrUpdateWebhook.json index f7ad4ac6a634..6838dbb0697e 100644 --- a/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/examples/createOrUpdateWebhook.json +++ b/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/examples/createOrUpdateWebhook.json @@ -23,6 +23,7 @@ "body": { "id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/webhooks/TestWebhook", "name": "TestWebhook", + "type": "Microsoft.Automation/AutomationAccounts/Webhooks", "properties": { "isEnabled": true, "expiryTime": "2018-03-29T22:18:13.7002872+00:00", @@ -44,6 +45,7 @@ "body": { "id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/webhooks/TestWebhook", "name": "TestWebhook", + "type": "Microsoft.Automation/AutomationAccounts/Webhooks", "properties": { "isEnabled": true, "expiryTime": "2018-03-29T22:18:13.7002872+00:00",