Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Watcher resource swagger specs. For more details on the Usage of the resource: https://docs.microsoft.com/en-us/azure/automation/automation-watchers-tutorial #3102

Merged
merged 2 commits into from
May 29, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3830,6 +3830,160 @@
}
},
"description": "The parameters supplied to the update webhook operation."
},
"WatcherProperties": {
"properties": {
"executionFrequencyInSeconds": {
"type": "integer",
"format": "int64",
"description": "Gets or sets the frequency at which the watcher is invoked."
},
"scriptName": {
"type": "string",
"description": "Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook."
},
"scriptParameters": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Gets or sets the parameters of the script."
},
"scriptRunOn": {
"type": "string",
"description": "Gets or sets the name of the hybrid worker group the watcher will run on."
},
"status": {
"type": "string",
"description": "Gets the current status of the watcher."
},
"creationTime": {
"type": "string",
"format": "date-time",
"description": "Gets or sets the creation time.",
"x-nullable": false
},
"lastModifiedTime": {
"type": "string",
"format": "date-time",
"description": "Gets or sets the last modified time.",
"x-nullable": false
},
"lastModifiedBy": {
"type": "string",
"description": "Details of the user who last modified the watcher."
},
"description": {
"type": "string",
"description": "Gets or sets the description."
}
},
"description": "Definition of the watcher properties"
},
"Watcher": {
"properties": {
"properties": {
"$ref": "#/definitions/WatcherProperties",
"x-ms-client-flatten": true,
"description": "Gets or sets the watcher properties."
},
"etag": {
"type": "string",
"description": "Gets or sets the etag of the resource."
}
},
"description": "Definition of the watcher type.",
"allOf": [
{
"$ref": "#/definitions/TrackedResource"
}
]
},
"WatcherListResult": {
"properties": {
"value": {
"type": "array",
"items": {
"$ref": "#/definitions/Watcher"
},
"description": "Gets or sets a list of watchers."
},
"nextLink": {
"type": "string",
"description": "Gets or sets the next link."
}
},
"description": "The response model for the list watcher operation."
},
"WatcherUpdateParameters": {
"properties": {
"properties": {
"$ref": "#/definitions/WatcherUpdateProperties",
"x-ms-client-flatten": true,
"description": "Gets or sets the watcher update properties."
},
"name": {
"type": "string",
"description": "Gets or sets the name of the resource."
}
}
},
"WatcherUpdateProperties": {
"properties": {
"executionFrequencyInSeconds": {
"type": "integer",
"format": "int64",
"description": "Gets or sets the frequency at which the watcher is invoked."
}
},
"description": "The properties of the update watcher operation."
},
"WatcherCreateOrUpdateProperties": {
"properties": {
"executionFrequencyInSeconds": {
"type": "integer",
"format": "int64",
"description": "Gets or sets the frequency at which the watcher is invoked."
},
"scriptName": {
"type": "string",
"description": "Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook."
},
"scriptParameters": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Gets or sets the parameters of the script."
},
"scriptRunOn": {
"type": "string",
"description": "Gets or sets the name of the hybrid worker group the webhook job will run on."
},
"description": {
"type": "string",
"description": "Gets or sets the watcher's description."
}
},
"description": "The properties of the create watcher operation."
},
"WatcherCreateOrUpdateParameters": {
"properties": {
"name": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name should not be updatable through the request body. read-only?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reviewing Gaurav. As discussed, using the same Watcher model for get/put and also using the same model of input and output of the put request. Marking fields in the watcher model as readonly as required. using a different model for input for patch.

"type": "string",
"description": "Gets or sets the name of the watcher."
},
"properties": {
"$ref": "#/definitions/WatcherCreateOrUpdateProperties",
"x-ms-client-flatten": true,
"description": "Gets or sets the properties of the watcher."
}
},
"required": [
"name",
"properties"
],
"description": "The parameters supplied to the create or update watcher operation."
}
},
"parameters": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"parameters": {
"subscriptionId": "subid",
"resourceGroupName": "rg",
"automationAccountName": "MyTestAutomationAccount",
"watcherName": "MyTestWatcher",
"api-version": "2015-10-31",
"parameters": {
"name":"MyTestWatcher",
"type":null,
"location":null,
"tags":{ },
"etag":null,
"properties":{
"executionFrequencyInSeconds":60,
"scriptName":"MyTestWatcherRunbook",
"scriptParameters":null,
"description":"This is a test watcher.",
"scriptRunOn":"MyTestHybridWorkerGroup",
"creationTime":"2016-11-01T04:22:47.7333333-07:00",
"lastModifiedBy":null,
"lastModifiedTime":"2016-11-01T04:22:47.7333333-07:00"
}
}
},
"responses": {
"201": {
"headers": {},
"body": {
"id":"/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/MyTestAutomationAccount/watchers/MyTestWatcher",
"name":"MyTestWatcher",
"type":null,
"location":null,
"tags":{ },
"etag":null,
"properties":{
"executionFrequencyInSeconds":60,
"scriptName":"MyTestWatcherRunbook",
"scriptParameters":null,
"description":"This is a test watcher.",
"status":"New",
"scriptRunOn":"MyTestHybridWorkerGroup",
"creationTime":"2018-05-14T21:14:09.607+00:00",
"lastModifiedBy":null,
"lastModifiedTime":"2018-05-14T21:14:09.607+00:00"
}
}
},
"200": {
"headers": {},
"body": {
"id":"/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/MyTestAutomationAccount/watchers/MyTestWatcher",
"name":"MyTestWatcher",
"type":null,
"location":null,
"tags":{ },
"etag":null,
"properties":{
"executionFrequencyInSeconds":60,
"scriptName":"MyTestWatcherRunbook",
"scriptParameters":null,
"description":"This is a test watcher.",
"status":"New",
"scriptRunOn":"MyTestHybridWorkerGroup",
"creationTime":"2018-05-14T21:14:09.607+00:00",
"lastModifiedBy":null,
"lastModifiedTime":"2018-05-14T21:14:09.607+00:00"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"parameters": {
"subscriptionId": "subid",
"resourceGroupName": "rg",
"automationAccountName": "MyTestAutomationAccount",
"watcherName": "MyTestWatcher",
"api-version": "2015-10-31"
},
"responses": {
"200": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"parameters": {
"subscriptionId": "subid",
"resourceGroupName": "rg",
"automationAccountName": "MyTestAutomationAccount",
"watcherName": "MyTestWatcher",
"api-version": "2015-10-31"
},
"responses":{
"200": {
"headers": {},
"body": {
"id":"/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/MyTestAutomationAccount/watchers/MyTestWatcher",
"name":"MyTestWatcher",
"type":null,
"location":null,
"tags":{ },
"etag":null,
"properties":{
"executionFrequencyInSeconds":60,
"scriptName":"MyTestWatcherRunbook",
"scriptParameters":{ },
"description":"",
"status":"Running",
"scriptRunOn":"MyTestHybridWorkerGroup",
"creationTime":"2017-11-30T18:50:17.163+00:00",
"lastModifiedBy":null,
"lastModifiedTime":"2017-11-30T18:50:17.163+00:00"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"parameters": {
"subscriptionId": "subid",
"resourceGroupName": "rg",
"automationAccountName": "MyTestAutomationAccount",
"api-version": "2015-10-31"
},
"responses": {
"200": {
"headers": {},
"body": {
"value": [
{
"id":"/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/MyTestAutomationAccount/watchers/MyTestWatcher",
"name":"MyTestWatcher",
"properties":{
"executionFrequencyInSeconds":60,
"scriptName":"MyTestWatcher",
"scriptParameters":null,
"description":"This is a test watcher.",
"status":null,
"scriptRunOn":"MyTestHybridWorkerGroup",
"creationTime":"2016-12-20T21:36:48.597+00:00",
"lastModifiedBy":null,
"lastModifiedTime":"2016-12-20T21:36:48.597+00:00"
}
},
{
"id":"/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/MyTestAutomationAccount/watchers/MyTestWatcher01",
"name":"MyTestWatcher01",
"properties":{
"executionFrequencyInSeconds":60,
"scriptName":"MyTestWatcher",
"scriptParameters":null,
"description":"This is a test watcher.",
"status":null,
"scriptRunOn":"MyTestHybridWorkerGroup",
"creationTime":"2016-12-20T20:47:24.697+00:00",
"lastModifiedBy":null,
"lastModifiedTime":"2016-12-20T20:47:24.697+00:00"
}
},
{
"id":"/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/MyTestAutomationAccount/watchers/MyTestWatcher02",
"name":"MyTestWatcher02",
"properties":{
"executionFrequencyInSeconds":60,
"scriptName":"MyTestWatcher",
"scriptParameters":null,
"description":"This is a test watcher.",
"status":null,
"scriptRunOn":"MyTestHybridWorkerGroup",
"creationTime":"2016-12-20T21:26:35.647+00:00",
"lastModifiedBy":null,
"lastModifiedTime":"2016-12-20T21:26:35.647+00:00"
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"parameters": {
"subscriptionId": "subid",
"resourceGroupName": "rg",
"automationAccountName": "MyTestAutomationAccount",
"watcherName": "MyTestWatcher",
"api-version": "2015-10-31"
},
"responses": {
"200": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"parameters": {
"subscriptionId": "subid",
"resourceGroupName": "rg",
"automationAccountName": "MyTestAutomationAccount",
"watcherName": "MyTestWatcher",
"api-version": "2018-01-15"
},
"responses": {
"200": {}
}
}
Loading