Skip to content

Commit

Permalink
Add swagger definitions for deletedAutomationAccounts resource type (#…
Browse files Browse the repository at this point in the history
…17169)

* add swagger definitions for deletedAutomationAccounts resource type

* fix semantic and model validation error

* fix model validation error

* fix date format and schema type

* fix lint diff error

* fix paths

* fix lint diff

* remove errorresponse schema

* add errorresponse schema

* add reference in readme

* supress error schema

* fix URI path to return list of deleted accounts

* remove automation account name parameter

Co-authored-by: Ravi Yadav <[email protected]>
  • Loading branch information
ravydv and Ravi Yadav authored Jan 12, 2022
1 parent a82659d commit cc7ba44
Show file tree
Hide file tree
Showing 3 changed files with 214 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
{
"swagger": "2.0",
"info": {
"title": "AutomationManagement",
"version": "2022-01-31",
"x-ms-code-generation-settings": {
"useDateTimeOffset": true
}
},
"host": "management.azure.com",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"security": [
{
"azure_auth": [
"user_impersonation"
]
}
],
"securityDefinitions": {
"azure_auth": {
"type": "oauth2",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"flow": "implicit",
"description": "Azure Active Directory OAuth2 Flow",
"scopes": {
"user_impersonation": "impersonate your user account"
}
}
},
"paths": {
"/subscriptions/{subscriptionId}/providers/Microsoft.Automation/deletedAutomationAccounts": {
"get": {
"tags": [
"DeletedAutomationAccounts"
],
"operationId": "deletedAutomationAccounts_ListBySubscription",
"description": "Retrieve deleted automation account.",
"x-ms-examples": {
"Get deleted automation account": {
"$ref": "./examples/getDeletedAutomationAccount.json"
}
},
"parameters": [
{
"$ref": "../../common/v1/definitions.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../common/v1/definitions.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/DeletedAutomationAccountListResult"
}
},
"default": {
"description": "Automation error response describing why the operation failed.",
"schema": {
"$ref": "../../common/v1/definitions.json#/definitions/ErrorResponse"
}
}
}
}
}
},
"definitions": {
"DeletedAutomationAccountListResult": {
"type": "object",
"properties": {
"value": {
"type": "array",
"items": {
"$ref": "#/definitions/DeletedAutomationAccount"
},
"description": "Gets or sets the list of deleted automation accounts."
}
},
"description": "The response model for the list deleted automation account."
},
"DeletedAutomationAccount": {
"type": "object",
"properties": {
"properties": {
"$ref": "#/definitions/DeletedAutomationAccountProperties",
"x-ms-client-flatten": true,
"description": "Gets or sets the automation account properties."
},
"id": {
"description": "The resource id.",
"type": "string"
},
"name": {
"type": "string",
"description": "Gets or sets name of the resource."
},
"type": {
"type": "string",
"description": "The resource type."
},
"location": {
"type": "string",
"description": "Gets or sets the location of the resource."
}
},
"description": "Definition of the deleted automation account type."
},
"DeletedAutomationAccountProperties": {
"type": "object",
"properties": {
"automationAccountResourceId": {
"type": "string",
"description": "Gets or sets the Automation Account Resource Id."
},
"automationAccountId": {
"type": "string",
"description": "Gets or sets the Automation Account Id."
},
"location": {
"type": "string",
"description": "Gets or sets the location of the resource."
},
"deletedTime": {
"type": "string",
"format": "date-time",
"readOnly": true,
"description": "Gets the creation time.",
"x-nullable": false
}
},
"description": "Definition of the deleted automation account properties."
}
},
"parameters": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"parameters": {
"subscriptionId": "subid",
"api-version": "2022-01-31"
},
"responses": {
"200": {
"headers": {},
"body": {
"value": [
{
"id": "/subscriptions/subid/resourceGroups/msitest/providers/Microsoft.Automation/deletedAutomationAccounts/myAutomationAccount",
"name": "myAutomationAccount",
"type": "Microsoft.Automation/deletedAutomationAccounts",
"location": "westus",
"properties": {
"automationAccountResourceId": "/subscriptions/subid/resourceGroups/msitest/providers/Microsoft.Automation/automationAccounts/myAutomationAccount",
"automationAccountId": "cb855f13-0223-4fe4-8260-9e6583dfef24",
"location": "westus",
"deletedTime": "2018-04-24T16:30:55+00:00"
}
}
]
}
}
}
}
43 changes: 43 additions & 0 deletions specification/automation/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,46 @@ input-file:
- Microsoft.Automation/stable/2021-06-22/hybridRunbookWorker.json
```

### Tag: package-2022-01-31

These settings apply only when `--tag=package-2022-01-31` is specified on the command line.

``` yaml $(tag) == 'package-2022-01-31'
input-file:
- Microsoft.Automation/preview/2020-01-13-preview/privateEndpointConnection.json
- Microsoft.Automation/preview/2020-01-13-preview/privateLinkResources.json
- Microsoft.Automation/preview/2020-01-13-preview/python2package.json
- Microsoft.Automation/preview/2020-01-13-preview/dscNode.json
- Microsoft.Automation/preview/2020-01-13-preview/dscNodeConfiguration.json
- Microsoft.Automation/preview/2020-01-13-preview/dscCompilationJob.json
- Microsoft.Automation/preview/2020-01-13-preview/dscNodeCounts.json
- Microsoft.Automation/preview/2020-01-13-preview/sourceControl.json
- Microsoft.Automation/preview/2020-01-13-preview/sourceControlSyncJob.json
- Microsoft.Automation/preview/2020-01-13-preview/sourceControlSyncJobStreams.json
- Microsoft.Automation/stable/2021-06-22/account.json
- Microsoft.Automation/preview/2020-01-13-preview/certificate.json
- Microsoft.Automation/preview/2020-01-13-preview/connection.json
- Microsoft.Automation/preview/2020-01-13-preview/connectionType.json
- Microsoft.Automation/preview/2020-01-13-preview/credential.json
- Microsoft.Automation/stable/2021-06-22/hybridRunbookWorkerGroup.json
- Microsoft.Automation/preview/2020-01-13-preview/jobSchedule.json
- Microsoft.Automation/preview/2020-01-13-preview/linkedWorkspace.json
- Microsoft.Automation/preview/2020-01-13-preview/module.json
- Microsoft.Automation/preview/2020-01-13-preview/schedule.json
- Microsoft.Automation/preview/2020-01-13-preview/variable.json
- Microsoft.Automation/preview/2020-01-13-preview/watcher.json
- Microsoft.Automation/stable/2019-06-01/dscConfiguration.json
- Microsoft.Automation/stable/2019-06-01/job.json
- Microsoft.Automation/stable/2021-06-22/operations.json
- Microsoft.Automation/stable/2019-06-01/softwareUpdateConfiguration.json
- Microsoft.Automation/stable/2019-06-01/softwareUpdateConfigurationRun.json
- Microsoft.Automation/stable/2019-06-01/softwareUpdateConfigurationMachineRun.json
- Microsoft.Automation/stable/2018-06-30/runbook.json
- Microsoft.Automation/stable/2015-10-31/webhook.json
- Microsoft.Automation/stable/2021-06-22/hybridRunbookWorker.json
- Microsoft.Automation/stable/2022-01-31/deletedAutomationAccount.json
```

---
## Suppression
``` yaml
Expand Down Expand Up @@ -311,6 +351,9 @@ directive:
- suppress: RequiredPropertiesMissingInResourceModel
from: hybridRunbookWorkerGroup.json
reason: This body format is already part of the previous api, cannot change it as it will result in breaking change.
- suppress: DefaultErrorResponseSchema
from: deletedAutomationAccount.json
reason: This error format is already part of the previous api, cannot change it as it will result in breaking change.
```

---
Expand Down

0 comments on commit cc7ba44

Please sign in to comment.