diff --git a/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/deviceupdate.json b/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/deviceupdate.json new file mode 100644 index 000000000000..0e3c6a46d44c --- /dev/null +++ b/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/deviceupdate.json @@ -0,0 +1,860 @@ +{ + "swagger": "2.0", + "info": { + "title": "DeviceUpdate", + "description": "Microsoft Device Update resource provider.", + "version": "2020-03-01-preview" + }, + "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.DeviceUpdate/accounts": { + "get": { + "description": "Returns list of Accounts.", + "operationId": "Accounts_ListBySubscription", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "List of Accounts.", + "schema": { + "$ref": "#/definitions/AccountList" + } + }, + "default": { + "description": "Error response describing the reason for operation failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "deprecated": false, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Get list of Accounts": { + "$ref": "./examples/Accounts/Accounts_List.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/instances": { + "get": { + "description": "Returns instances for the given account name.", + "operationId": "Instances_ListBySubscription", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/AccountNameParameter" + } + ], + "responses": { + "200": { + "description": "List of Instances.", + "schema": { + "$ref": "#/definitions/InstanceList" + } + }, + "default": { + "description": "Error response describing the reason for operation failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Get list of Instances by Account": { + "$ref": "./examples/Instances/Instances_ListByAccount.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts": { + "get": { + "description": "Returns list of Accounts.", + "operationId": "Accounts_ListByResourceGroup", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "List of Accounts.", + "schema": { + "$ref": "#/definitions/AccountList" + } + }, + "default": { + "description": "Error response describing the reason for operation failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "deprecated": false, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Gets list of Accounts": { + "$ref": "./examples/Accounts/Accounts_List.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}": { + "get": { + "description": "Returns account details for the given account name.", + "operationId": "Accounts_Get", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/AccountNameParameter" + } + ], + "responses": { + "200": { + "description": "Account details.", + "schema": { + "$ref": "#/definitions/Account" + } + }, + "default": { + "description": "Error response describing the reason for operation failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Gets Account details": { + "$ref": "./examples/Accounts/Accounts_Get.json" + } + } + }, + "put": { + "description": "Creates or updates Account.", + "operationId": "Accounts_Create", + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/AccountNameParameter" + }, + { + "name": "Account", + "description": "Account details.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Account" + } + } + ], + "responses": { + "201": { + "description": "Async operation to create or update Account was created.", + "schema": { + "$ref": "#/definitions/Account" + } + }, + "default": { + "description": "Error response describing the reason for operation failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Creates or updates Account": { + "$ref": "./examples/Accounts/Accounts_Create.json" + } + } + }, + "delete": { + "description": "Deletes account.", + "operationId": "Accounts_Delete", + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/AccountNameParameter" + } + ], + "responses": { + "200": { + "description": "Async operation to delete Account was created." + }, + "202": { + "description": "Async operation to delete Account was created." + }, + "204": { + "description": "Account has been already deleted." + }, + "default": { + "description": "Error response describing the reason for operation failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Deletes an account": { + "$ref": "./examples/Accounts/Accounts_Delete.json" + } + } + }, + "patch": { + "description": "Updates account's patchable properties", + "operationId": "Accounts_Update", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/AccountNameParameter" + }, + { + "name": "accountUpdatePayload", + "description": "Updated Account.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AccountUpdate" + } + } + ], + "responses": { + "200": { + "description": "Account updated successfully.", + "schema": { + "$ref": "#/definitions/Account" + } + }, + "default": { + "description": "Error response describing the reason for operation failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-examples": { + "Updates Account": { + "$ref": "./examples/Accounts/Accounts_Update.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/instances": { + "get": { + "description": "Returns instances for the given account name.", + "operationId": "Instances_ListByAccount", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/AccountNameParameter" + } + ], + "responses": { + "200": { + "description": "List of Instances.", + "schema": { + "$ref": "#/definitions/InstanceList" + } + }, + "default": { + "description": "Error response describing the reason for operation failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Gets list of Instances by Account": { + "$ref": "./examples/Instances/Instances_ListByAccount.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/instances/{instanceName}": { + "get": { + "description": "Returns instances for the given account and instance name.", + "operationId": "Instances_Get", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/AccountNameParameter" + }, + { + "$ref": "#/parameters/InstanceNameParameter" + } + ], + "responses": { + "200": { + "description": "Instance details.", + "schema": { + "$ref": "#/definitions/Instance" + } + }, + "default": { + "description": "Error response describing the reason for operation failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Gets list of Accounts": { + "$ref": "./examples/Instances/Instances_Get.json" + } + } + }, + "put": { + "description": "Creates or updates instance.", + "operationId": "Instances_Create", + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/AccountNameParameter" + }, + { + "$ref": "#/parameters/InstanceNameParameter" + }, + { + "name": "Instance", + "description": "Instance details.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Instance" + } + } + ], + "responses": { + "201": { + "description": "Async operation to create or update Instance was created.", + "schema": { + "$ref": "#/definitions/Instance" + } + }, + "default": { + "description": "Error response describing the reason for operation failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Creates or updates Instance": { + "$ref": "./examples/Instances/Instances_Create.json" + } + } + }, + "delete": { + "description": "Deletes instance.", + "operationId": "Instances_Delete", + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/AccountNameParameter" + }, + { + "$ref": "#/parameters/InstanceNameParameter" + } + ], + "responses": { + "200": { + "description": "Async operation to delete Instance was created." + }, + "202": { + "description": "Async operation to delete Instance was created." + }, + "204": { + "description": "Instance has been already deleted." + }, + "default": { + "description": "Error response describing the reason for operation failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Deletes instance": { + "$ref": "./examples/Instances/Instances_Delete.json" + } + } + }, + "patch": { + "description": "Updates instance's tags.", + "operationId": "Instances_Update", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/AccountNameParameter" + }, + { + "$ref": "#/parameters/InstanceNameParameter" + }, + { + "name": "tagUpdatePayload", + "description": "Updated tags.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TagUpdate" + } + } + ], + "responses": { + "200": { + "description": "Instance updated successfully.", + "schema": { + "$ref": "#/definitions/Instance" + } + }, + "default": { + "description": "Error response describing the reason for operation failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Updates Instance": { + "$ref": "./examples/Instances/Instances_Update.json" + } + } + } + }, + "/providers/Microsoft.DeviceUpdate/operations": { + "get": { + "description": "Returns list of operations for Microsoft.DeviceUpdate resource provider.", + "operationId": "Operations_List", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Operation details.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/OperationListResult" + } + }, + "default": { + "description": "Error response describing the reason for operation failure.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "deprecated": false, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + } + }, + "definitions": { + "Account": { + "description": "Device Update account details.", + "type": "object", + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/TrackedResource" + } + ], + "properties": { + "properties": { + "description": "Device Update account properties.", + "x-ms-client-flatten": true, + "type": "object", + "properties": { + "provisioningState": { + "description": "Provisioning state.", + "type": "string", + "enum": [ + "Succeeded", + "Deleted", + "Failed", + "Canceled", + "Accepted", + "Creating" + ], + "readOnly": true, + "x-ms-enum": { + "name": "ProvisioningState", + "modelAsString": true + } + }, + "hostName": { + "description": "API host name.", + "type": "string", + "readOnly": true + } + } + } + } + }, + "AccountList": { + "description": "List of Accounts.", + "type": "object", + "properties": { + "nextLink": { + "description": "The link used to get the next page of Accounts list.", + "type": "string" + }, + "value": { + "description": "List of Accounts.", + "type": "array", + "items": { + "$ref": "#/definitions/Account" + } + } + } + }, + "Instance": { + "description": "Device Update instance details.", + "type": "object", + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/TrackedResource" + } + ], + "properties": { + "properties": { + "description": "Device Update instance properties.", + "x-ms-client-flatten": true, + "type": "object", + "properties": { + "provisioningState": { + "description": "Provisioning state.", + "type": "string", + "enum": [ + "Succeeded", + "Deleted", + "Failed", + "Canceled", + "Accepted", + "Creating" + ], + "readOnly": true, + "x-ms-enum": { + "name": "ProvisioningState", + "modelAsString": true + } + }, + "accountName": { + "description": "Parent Device Update Account name which Instance belongs to.", + "type": "string", + "readOnly": true + }, + "iotHubs": { + "description": "List of IoT Hubs associated with the account.", + "type": "array", + "items": { + "$ref": "#/definitions/IotHubSettings" + } + } + } + } + }, + "required": [ + "properties" + ] + }, + "InstanceList": { + "description": "List of Instances.", + "type": "object", + "properties": { + "nextLink": { + "description": "The link used to get the next page of Instances list.", + "type": "string" + }, + "value": { + "description": "List of Instances.", + "type": "array", + "items": { + "$ref": "#/definitions/Instance" + } + } + } + }, + "IotHubSettings": { + "type": "object", + "description": "Device Update account integration with IoT Hub settings.", + "properties": { + "resourceId": { + "description": "IoTHub resource ID", + "type": "string", + "minLength": 108, + "maxLength": 244 + }, + "ioTHubConnectionString": { + "description": "IoTHub connection string.", + "x-ms-secret": true, + "type": "string" + }, + "eventHubConnectionString": { + "description": "EventHub connection string.", + "x-ms-secret": true, + "type": "string" + } + }, + "required": [ + "resourceId" + ] + }, + "ErrorResponse": { + "description": "Error response indicates that the service is not able to process the incoming request.", + "properties": { + "code": { + "description": "Error status code.", + "type": "string", + "readOnly": true + }, + "error": { + "$ref": "#/definitions/ErrorDefinition", + "description": "Error details.", + "readOnly": true + } + } + }, + "ErrorDefinition": { + "description": "Error definition.", + "properties": { + "code": { + "description": "Error status code.", + "type": "string", + "readOnly": true + }, + "message": { + "description": "Error message.", + "type": "string", + "readOnly": true + }, + "details": { + "description": "Error details.", + "type": "array", + "items": { + "$ref": "#/definitions/ErrorDefinition" + } + } + } + }, + "AccountUpdate": { + "description": "Request payload used to update and existing Accounts.", + "properties": { + "location": { + "type": "string", + "description": "The geo-location where the resource lives" + } + }, + "allOf": [ + { + "$ref": "#/definitions/TagUpdate" + } + ] + }, + "TagUpdate": { + "description": "Request payload used to update an existing resource's tags.", + "type": "object", + "properties": { + "tags": { + "type": "object", + "description": "List of key value pairs that describe the resource. This will overwrite the existing tags.", + "additionalProperties": { + "type": "string" + } + } + } + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "The Azure subscription ID." + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "ADU schema API version." + }, + "ResourceGroupNameParameter": { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The resource group name.", + "x-ms-parameter-location": "method" + }, + "AccountNameParameter": { + "name": "accountName", + "in": "path", + "required": true, + "type": "string", + "description": "Account name.", + "x-ms-parameter-location": "method", + "pattern": "^[A-Za-z][A-Za-z0-9]+$", + "minLength": 3, + "maxLength": 24 + }, + "InstanceNameParameter": { + "name": "instanceName", + "in": "path", + "required": true, + "type": "string", + "description": "Instance name.", + "x-ms-parameter-location": "method", + "pattern": "^[A-Za-z][A-Za-z0-9]+$", + "minLength": 3, + "maxLength": 36 + } + } +} diff --git a/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_Create.json b/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_Create.json new file mode 100644 index 000000000000..8e8f0b68712d --- /dev/null +++ b/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_Create.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "test-rg", + "accountName": "contoso", + "api-version": "2020-03-01-preview", + "Account": { + "location": "West US 2", + "properties": {} + } + }, + "responses": { + "201": { + "body": { + "name": "contoso", + "location": "westus2", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DeviceUpdate/accounts/contoso", + "type": "Microsoft.DeviceUpdate/accounts", + "properties": { + "provisioningState": "Accepted", + "hostName": "contoso.api.adu.microsoft.com" + } + } + } + } +} diff --git a/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_Delete.json b/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_Delete.json new file mode 100644 index 000000000000..9137be15f91c --- /dev/null +++ b/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_Delete.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "test-rg", + "accountName": "contoso", + "api-version": "2020-03-01-preview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} diff --git a/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_Get.json b/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_Get.json new file mode 100644 index 000000000000..4300bc6ef27c --- /dev/null +++ b/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_Get.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "test-rg", + "accountName": "contoso", + "api-version": "2020-03-01-preview" + }, + "responses": { + "200": { + "body": { + "name": "contoso", + "location": "westus2", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DeviceUpdate/accounts/contoso", + "type": "Microsoft.DeviceUpdate/accounts", + "properties": { + "provisioningState": "Succeeded", + "hostName": "contoso.api.adu.microsoft.com" + } + } + } + } +} diff --git a/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_List.json b/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_List.json new file mode 100644 index 000000000000..dc2ccf525818 --- /dev/null +++ b/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_List.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "test-rg", + "api-version": "2020-03-01-preview" + }, + "responses": { + "200": { + "body": { + "nextLink": "string", + "value": [ + { + "name": "contoso", + "location": "westus2", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DeviceUpdate/accounts/contoso", + "type": "Microsoft.DeviceUpdate/accounts", + "properties": { + "provisioningState": "Succeeded", + "hostName": "contoso.api.adu.microsoft.com" + } + } + ] + } + } + } +} diff --git a/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_Update.json b/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_Update.json new file mode 100644 index 000000000000..917c1de425ad --- /dev/null +++ b/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_Update.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "test-rg", + "accountName": "contoso", + "api-version": "2020-03-01-preview", + "accountUpdatePayload": { + "tags": { + "tagKey": "tagValue" + } + } + }, + "responses": { + "200": { + "body": { + "name": "contoso", + "location": "westus2", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DeviceUpdate/accounts/contoso", + "type": "Microsoft.DeviceUpdate/accounts", + "properties": { + "provisioningState": "Succeeded", + "hostName": "contoso.api.adu.microsoft.com" + }, + "tags": { + "tagKey": "tagValue" + } + } + } + } +} diff --git a/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_Create.json b/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_Create.json new file mode 100644 index 000000000000..32f7fe111527 --- /dev/null +++ b/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_Create.json @@ -0,0 +1,40 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "test-rg", + "accountName": "contoso", + "instanceName": "blue", + "api-version": "2020-03-01-preview", + "Instance": { + "location": "West US 2", + "properties": { + "iotHubs": [ + { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Devices/IotHubs/blue-contoso-hub", + "ioTHubConnectionString": "string", + "eventHubConnectionString": "string" + } + ] + } + } + }, + "responses": { + "201": { + "body": { + "name": "blue", + "location": "West US 2", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DeviceUpdate/accounts/contoso/instances/blue", + "type": "Microsoft.DeviceUpdate/accounts/instances", + "properties": { + "provisioningState": "Accepted", + "accountName": "contoso", + "iotHubs": [ + { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Devices/IotHubs/blue-contoso-hub" + } + ] + } + } + } + } +} diff --git a/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_Delete.json b/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_Delete.json new file mode 100644 index 000000000000..a9bf7145faad --- /dev/null +++ b/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_Delete.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "test-rg", + "accountName": "contoso", + "instanceName": "blue", + "api-version": "2020-03-01-preview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} diff --git a/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_Get.json b/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_Get.json new file mode 100644 index 000000000000..1f354395ae9e --- /dev/null +++ b/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_Get.json @@ -0,0 +1,28 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "test-rg", + "accountName": "contoso", + "instanceName": "blue", + "api-version": "2020-03-01-preview" + }, + "responses": { + "200": { + "body": { + "name": "blue", + "location": "westus2", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DeviceUpdate/accounts/contoso/instances/blue", + "type": "Microsoft.DeviceUpdate/accounts/instances", + "properties": { + "provisioningState": "Succeeded", + "accountName": "contoso", + "iotHubs": [ + { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Devices/IotHubs/blue-contoso-hub" + } + ] + } + } + } + } +} diff --git a/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_ListByAccount.json b/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_ListByAccount.json new file mode 100644 index 000000000000..eac2d6134f84 --- /dev/null +++ b/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_ListByAccount.json @@ -0,0 +1,47 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "test-rg", + "accountName": "contoso", + "api-version": "2020-03-01-preview" + }, + "responses": { + "200": { + "body": { + "nextLink": "string", + "value": [ + { + "name": "blue", + "location": "westus2", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DeviceUpdate/accounts/contoso/instances/blue", + "type": "Microsoft.DeviceUpdate/accounts/instances", + "properties": { + "provisioningState": "Succeeded", + "accountName": "contoso", + "iotHubs": [ + { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Devices/IotHubs/blue-contoso-hub" + } + ] + } + }, + { + "name": "red", + "location": "westus2", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DeviceUpdate/accounts/contoso/instances/red", + "type": "Microsoft.DeviceUpdate/accounts/instances", + "properties": { + "provisioningState": "Succeeded", + "accountName": "contoso", + "iotHubs": [ + { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Devices/IotHubs/red-contoso-hub" + } + ] + } + } + ] + } + } + } +} diff --git a/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_Update.json b/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_Update.json new file mode 100644 index 000000000000..a431fd26a2db --- /dev/null +++ b/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_Update.json @@ -0,0 +1,35 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "test-rg", + "accountName": "contoso", + "instanceName": "blue", + "api-version": "2020-03-01-preview", + "tagUpdatePayload": { + "tags": { + "tagKey": "tagValue" + } + } + }, + "responses": { + "200": { + "body": { + "name": "blue", + "location": "westus2", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DeviceUpdate/accounts/contoso/instances/blue", + "type": "Microsoft.DeviceUpdate/accounts/instances", + "properties": { + "accountName": "contoso", + "iotHubs": [ + { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Devices/IotHubs/blue-contoso-hub" + } + ] + }, + "tags": { + "tagKey": "tagValue" + } + } + } + } +} diff --git a/specification/deviceupdate/resource-manager/readme.csharp.md b/specification/deviceupdate/resource-manager/readme.csharp.md new file mode 100644 index 000000000000..0b4ca02cffc9 --- /dev/null +++ b/specification/deviceupdate/resource-manager/readme.csharp.md @@ -0,0 +1,15 @@ +## C# + +These settings apply only when `--csharp` is specified on the command line. +Please also specify `--csharp-sdks-folder=`. + +```yaml $(csharp) +csharp: + azure-arm: true + license-header: MICROSOFT_MIT_NO_VERSION + payload-flattening-threshold: 1 + clear-output-folder: true + client-side-validation: false + namespace: Azure.ResourceManager.DeviceUpdate + output-folder: $(csharp-sdks-folder)/deviceupdate/Azure.ResourceManager.DeviceUpdate/src/Generated +``` diff --git a/specification/deviceupdate/resource-manager/readme.go.md b/specification/deviceupdate/resource-manager/readme.go.md new file mode 100644 index 000000000000..1cd6ddaed47b --- /dev/null +++ b/specification/deviceupdate/resource-manager/readme.go.md @@ -0,0 +1,26 @@ +## Go + +These settings apply only when `--go` is specified on the command line. + +```yaml $(go) +go: + license-header: MICROSOFT_MIT_NO_VERSION + clear-output-folder: true +``` + +### Go multi-api + +``` yaml $(go) && $(multiapi) +batch: + - tag: package-2020-03-01-preview +``` + +### Tag: package-2020-03-01-preview and go + +These settings apply only when `--tag=package-2020-03-01-preview --go` is specified on the command line. +Please also specify `--go-sdks-folder=`. + +```yaml $(tag) == 'package-2020-03-01-preview' && $(go) +namespace: deviceupdate +output-folder: $(go-sdk-folder)/services/preview/$(namespace)/mgmt/2020-03-01-preview/$(namespace) +``` diff --git a/specification/deviceupdate/resource-manager/readme.md b/specification/deviceupdate/resource-manager/readme.md new file mode 100644 index 000000000000..49be17c855c0 --- /dev/null +++ b/specification/deviceupdate/resource-manager/readme.md @@ -0,0 +1,80 @@ +# Device Update + +> see https://aka.ms/autorest + +This is the AutoRest configuration file for deviceupdate. + +## Getting Started + +To build the SDKs for My API, simply install AutoRest via `npm` (`npm install -g autorest`) and then run: + +> `autorest readme.md` + +To see additional help and options, run: + +> `autorest --help` + +For other options on installation see [Installing AutoRest](https://aka.ms/autorest/install) on the AutoRest github page. + +--- + +## Configuration + +### Basic Information + +These are the global settings for the deviceupdate. + +```yaml +openapi-type: arm +openapi-subtype: rpaas +tag: package-2020-03-01-preview +``` + +### Tag: package-2020-03-01-preview + +These settings apply only when `--tag=package-2020-03-01-preview` is specified on the command line. + +```yaml $(tag) == 'package-2020-03-01-preview' +input-file: + - Microsoft.DeviceUpdate/preview/2020-03-01-preview/deviceupdate.json +``` + +## Suppression + +``` yaml +directive: + - suppress: ENUM_CASE_MISMATCH + where: $.definitions.Identity.properties.type + from: deviceupdate.json + reason: Managed Identity type can be case in-sensitive +``` + +--- + +# Code Generation + +## Swagger to SDK + +This section describes what SDK should be generated by the automatic system. +This is not used by Autorest itself. + +```yaml $(swagger-to-sdk) +swagger-to-sdk: + - repo: azure-sdk-for-net + - repo: azure-sdk-for-python + - repo: azure-sdk-for-go + after_scripts: + - bundle install && rake arm:regen_all_profiles['azure_mgmt_deviceupdate'] +``` + +## CSharp + +See configuration in [readme.csharp.md](./readme.csharp.md) + +## Python + +See configuration in [readme.python.md](./readme.python.md) + +## Go + +See configuration in [readme.go.md](./readme.go.md) diff --git a/specification/deviceupdate/resource-manager/readme.python.md b/specification/deviceupdate/resource-manager/readme.python.md new file mode 100644 index 000000000000..13b9a0f53a57 --- /dev/null +++ b/specification/deviceupdate/resource-manager/readme.python.md @@ -0,0 +1,18 @@ +## Python + +These settings apply only when `--python` is specified on the command line. +Please also specify `--python-sdks-folder=`. + +```yaml + azure-arm: true + license-header: MICROSOFT_MIT_NO_VERSION + payload-flattening-threshold: 2 + namespace: azure.mgmt.deviceupdate + package-name: azure_mgmt_deviceupdate + package-version: 2020-03-01-preview + clear-output-folder: true + add-credentials: true + credential-scopes: 9347d57b-9e24-4142-b4a3-20576bf22aa3/.default + no-namespace-folders: true + output-folder: $(python-sdks-folder)/sdk/deviceupdate/azure-mgmt-deviceupdate/azure/mgmt/deviceupdate +```