From e63791f0d923150db6bdc01dd801d20496adfa1e Mon Sep 17 00:00:00 2001 From: Ramakrishna Casturi Date: Mon, 20 May 2019 12:30:26 -0700 Subject: [PATCH 1/6] Add Associations API Swagger specification --- .../2018-09-01-preview/customproviders.json | 286 +++++++++++++++++- .../examples/createOrUpdateAssociation.json | 38 +++ .../examples/deleteAssociation.json | 12 + .../examples/getAllAssociations.json | 25 ++ .../examples/getAssociation.json | 22 ++ 5 files changed, 382 insertions(+), 1 deletion(-) create mode 100644 specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateAssociation.json create mode 100644 specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/deleteAssociation.json create mode 100644 specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAllAssociations.json create mode 100644 specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAssociation.json diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/customproviders.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/customproviders.json index 8f5a4c9fdec3..d76140d0469c 100644 --- a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/customproviders.json +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/customproviders.json @@ -380,6 +380,225 @@ "application/json" ] } + }, + "/{scope}/providers/Microsoft.CustomProviders/associations/{associationName}": { + "put": { + "tags": [ + "Associations" + ], + "operationId": "Association_CreateOrUpdate", + "x-ms-long-running-operation": true, + "description": "Create or update an association.", + "x-ms-examples": { + "Create or update an association": { + "$ref": "examples/createOrUpdateAssociation.json" + } + }, + "parameters": [ + { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope of the association. The scope can be any valid REST resource instance. For example, use '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.Compute/virtualMachines/{vm-name}' for a virtual machine resource.", + "x-ms-skip-url-encoding": true + }, + { + "name": "associationName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the association." + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Association" + }, + "description": "The parameters required to create or update an association." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "201": { + "description": "Created. Association has been created.", + "schema": { + "$ref": "#/definitions/Association" + } + }, + "200": { + "description": "OK. Association already exists and the changes have been accepted.", + "schema": { + "$ref": "#/definitions/Association" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ] + }, + "delete": { + "tags": [ + "Associations" + ], + "operationId": "Association_Delete", + "x-ms-long-running-operation": true, + "description": "Delete an association.", + "x-ms-examples": { + "Delete an association": { + "$ref": "examples/deleteAssociation.json" + } + }, + "parameters": [ + { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope of the association.", + "x-ms-skip-url-encoding": true + }, + { + "name": "associationName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the association." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. Association deleted." + }, + "202": { + "description": "Accepted. Association delete has been accepted." + }, + "204": { + "description": "No Content. Association was not found." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "produces": [ + "application/json" + ] + }, + "get": { + "tags": [ + "Associations" + ], + "operationId": "Association_Get", + "description": "Get an association.", + "x-ms-examples": { + "Get an association": { + "$ref": "examples/getAssociation.json" + } + }, + "parameters": [ + { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope of the association.", + "x-ms-skip-url-encoding": true + }, + { + "name": "associationName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the association." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. Returns association.", + "schema": { + "$ref": "#/definitions/Association" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "produces": [ + "application/json" + ] + } + }, + "/{scope}/providers/Microsoft.CustomProviders/associations": { + "get": { + "tags": [ + "Associations" + ], + "operationId": "Association_GetAll", + "description": "Gets all association for the given scope.", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Get all associations": { + "$ref": "examples/getAllAssociations.json" + } + }, + "parameters": [ + { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope of the association.", + "x-ms-skip-url-encoding": true + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. Returns all associations for the given scope.", + "schema": { + "$ref": "#/definitions/AssociationsList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "produces": [ + "application/json" + ] + } } }, "definitions": { @@ -586,7 +805,72 @@ } } }, - "Resource": { + "Association": { + "x-ms-azure-resource": true, + "x-ms-client-flatten": true, + "description": "The resource definition of this association.", + "properties": { + "id": { + "type": "string", + "readOnly": true, + "description": "The association id." + }, + "name": { + "type": "string", + "readOnly": true, + "description": "The association name." + }, + "type": { + "type": "string", + "readOnly": true, + "description": "The association type." + }, + "properties": { + "type": "object", + "description": "The properties of the association.", + "x-ms-client-flatten": true, + "properties": { + "targetResourceId": { + "type": "string", + "description": "The REST resource instance of the target resource for this association." + }, + "provisioningState": { + "type": "string", + "description": "The provisioning state of the association.", + "readOnly": true, + "x-ms-enum": { + "modelAsString": true, + "name": "ProvisioningState" + }, + "enum": [ + "Accepted", + "Deleting", + "Running", + "Succeeded", + "Failed" + ] + } + } + } + } + }, + "AssociationsList": { + "description": "List of associations.", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Association" + }, + "description": "The array of associations." + }, + "nextLink": { + "type": "string", + "description": "The URL to use for getting the next set of results." + } + } + }, + "Resource": { "properties": { "id": { "readOnly": true, diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateAssociation.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateAssociation.json new file mode 100644 index 000000000000..7f2894486c6a --- /dev/null +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateAssociation.json @@ -0,0 +1,38 @@ +{ + "parameters": { + "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1", + "associationName": "association1", + "api-version": "2018-09-01-preview", + "properties": { + "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/appRG/providers/Microsoft.Solutions/applications/application1" + } + }, + "responses": { + "201": { + "headers": {}, + "body": { + "name": "association1", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.CustomProviders/associations/association1", + "type": "Microsoft.CustomProviders/associations", + "location": "East US", + "properties": { + "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/appRG/providers/Microsoft.Solutions/applications/application1", + "provisioningState": "Accepted" + } + } + }, + "200": { + "headers": {}, + "body": { + "name": "association1", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.CustomProviders/associations/association1", + "type": "Microsoft.CustomProviders/associations", + "location": "East US", + "properties": { + "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/appRG/providers/Microsoft.Solutions/applications/application1", + "provisioningState": "Accepted" + } + } + } + } +} \ No newline at end of file diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/deleteAssociation.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/deleteAssociation.json new file mode 100644 index 000000000000..faf2d213566e --- /dev/null +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/deleteAssociation.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1", + "associationName": "association1", + "api-version": "2018-09-01-preview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} \ No newline at end of file diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAllAssociations.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAllAssociations.json new file mode 100644 index 000000000000..f789e225bd4b --- /dev/null +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAllAssociations.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1", + "api-version": "2018-09-01-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "name": "association1", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.CustomProviders/associations/association1", + "type": "Microsoft.CustomProviders/associations", + "location": "East US", + "properties": { + "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/appRG/providers/Microsoft.Solutions/applications/application1", + "provisioningState": "Succeeded" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAssociation.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAssociation.json new file mode 100644 index 000000000000..0b5da71af328 --- /dev/null +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAssociation.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1", + "associationName": "association1", + "api-version": "2018-09-01-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "name": "association1", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.CustomProviders/associations/association1", + "type": "Microsoft.CustomProviders/associations", + "location": "East US", + "properties": { + "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/appRG/providers/Microsoft.Solutions/applications/application1", + "provisioningState": "Succeeded" + } + } + } + } +} \ No newline at end of file From a299994fee8721eda3eaaee87f61880bff46c8f6 Mon Sep 17 00:00:00 2001 From: Rama Casturi Date: Mon, 20 May 2019 17:34:16 -0700 Subject: [PATCH 2/6] Add Associations API Swagger specification --- .../preview/2018-09-01-preview/customproviders.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/customproviders.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/customproviders.json index d76140d0469c..faa3f95806e2 100644 --- a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/customproviders.json +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/customproviders.json @@ -386,7 +386,7 @@ "tags": [ "Associations" ], - "operationId": "Association_CreateOrUpdate", + "operationId": "Associations_CreateOrUpdate", "x-ms-long-running-operation": true, "description": "Create or update an association.", "x-ms-examples": { @@ -454,7 +454,7 @@ "tags": [ "Associations" ], - "operationId": "Association_Delete", + "operationId": "Associations_Delete", "x-ms-long-running-operation": true, "description": "Delete an association.", "x-ms-examples": { @@ -507,7 +507,7 @@ "tags": [ "Associations" ], - "operationId": "Association_Get", + "operationId": "Associations_Get", "description": "Get an association.", "x-ms-examples": { "Get an association": { @@ -558,7 +558,7 @@ "tags": [ "Associations" ], - "operationId": "Association_GetAll", + "operationId": "Associations_ListAll", "description": "Gets all association for the given scope.", "x-ms-pageable": { "nextLinkName": "nextLink" From 71366ce498f4aaabad7853c7ff7a542a771ea33d Mon Sep 17 00:00:00 2001 From: Rama Casturi Date: Tue, 21 May 2019 09:46:43 -0700 Subject: [PATCH 3/6] Add Associations API Swagger specification --- .../2018-09-01-preview/examples/createOrUpdateAssociation.json | 2 -- .../preview/2018-09-01-preview/examples/getAllAssociations.json | 1 - .../preview/2018-09-01-preview/examples/getAssociation.json | 1 - 3 files changed, 4 deletions(-) diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateAssociation.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateAssociation.json index 7f2894486c6a..ed1c5d832301 100644 --- a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateAssociation.json +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateAssociation.json @@ -14,7 +14,6 @@ "name": "association1", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.CustomProviders/associations/association1", "type": "Microsoft.CustomProviders/associations", - "location": "East US", "properties": { "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/appRG/providers/Microsoft.Solutions/applications/application1", "provisioningState": "Accepted" @@ -27,7 +26,6 @@ "name": "association1", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.CustomProviders/associations/association1", "type": "Microsoft.CustomProviders/associations", - "location": "East US", "properties": { "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/appRG/providers/Microsoft.Solutions/applications/application1", "provisioningState": "Accepted" diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAllAssociations.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAllAssociations.json index f789e225bd4b..dffa80716c3c 100644 --- a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAllAssociations.json +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAllAssociations.json @@ -12,7 +12,6 @@ "name": "association1", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.CustomProviders/associations/association1", "type": "Microsoft.CustomProviders/associations", - "location": "East US", "properties": { "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/appRG/providers/Microsoft.Solutions/applications/application1", "provisioningState": "Succeeded" diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAssociation.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAssociation.json index 0b5da71af328..1773dd71bd1f 100644 --- a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAssociation.json +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAssociation.json @@ -11,7 +11,6 @@ "name": "association1", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.CustomProviders/associations/association1", "type": "Microsoft.CustomProviders/associations", - "location": "East US", "properties": { "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/appRG/providers/Microsoft.Solutions/applications/application1", "provisioningState": "Succeeded" From 00d7f3481eeb3114160ae721c0e526514e2fc372 Mon Sep 17 00:00:00 2001 From: Rama Casturi Date: Tue, 21 May 2019 10:19:35 -0700 Subject: [PATCH 4/6] Add Associations API Swagger specification --- .../examples/createOrUpdateAssociation.json | 18 +++++++++--------- .../examples/deleteAssociation.json | 4 ++-- .../examples/getAllAssociations.json | 8 ++++---- .../examples/getAssociation.json | 10 +++++----- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateAssociation.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateAssociation.json index ed1c5d832301..011689c5d572 100644 --- a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateAssociation.json +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateAssociation.json @@ -1,21 +1,21 @@ { "parameters": { - "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1", - "associationName": "association1", + "scope": "scope", + "associationName": "associationName", "api-version": "2018-09-01-preview", "properties": { - "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/appRG/providers/Microsoft.Solutions/applications/application1" + "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/application1" } }, "responses": { "201": { "headers": {}, "body": { - "name": "association1", - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.CustomProviders/associations/association1", + "name": "associationName", + "id": "/scope/providers/Microsoft.CustomProviders/associations/associationName", "type": "Microsoft.CustomProviders/associations", "properties": { - "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/appRG/providers/Microsoft.Solutions/applications/application1", + "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName", "provisioningState": "Accepted" } } @@ -23,11 +23,11 @@ "200": { "headers": {}, "body": { - "name": "association1", - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.CustomProviders/associations/association1", + "name": "associationName", + "id": "/scope/providers/Microsoft.CustomProviders/associations/associationName", "type": "Microsoft.CustomProviders/associations", "properties": { - "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/appRG/providers/Microsoft.Solutions/applications/application1", + "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName", "provisioningState": "Accepted" } } diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/deleteAssociation.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/deleteAssociation.json index faf2d213566e..89e3e62b758a 100644 --- a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/deleteAssociation.json +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/deleteAssociation.json @@ -1,7 +1,7 @@ { "parameters": { - "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1", - "associationName": "association1", + "scope": "scope", + "associationName": "associationName", "api-version": "2018-09-01-preview" }, "responses": { diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAllAssociations.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAllAssociations.json index dffa80716c3c..5c259906bf52 100644 --- a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAllAssociations.json +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAllAssociations.json @@ -1,6 +1,6 @@ { "parameters": { - "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1", + "scope": "scope", "api-version": "2018-09-01-preview" }, "responses": { @@ -9,11 +9,11 @@ "body": { "value": [ { - "name": "association1", - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.CustomProviders/associations/association1", + "name": "associationName", + "id": "scope/providers/Microsoft.CustomProviders/associations/associationName", "type": "Microsoft.CustomProviders/associations", "properties": { - "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/appRG/providers/Microsoft.Solutions/applications/application1", + "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName", "provisioningState": "Succeeded" } } diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAssociation.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAssociation.json index 1773dd71bd1f..2d608e4c3005 100644 --- a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAssociation.json +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAssociation.json @@ -1,18 +1,18 @@ { "parameters": { - "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1", - "associationName": "association1", + "scope": "scope", + "associationName": "associationName", "api-version": "2018-09-01-preview" }, "responses": { "200": { "headers": {}, "body": { - "name": "association1", - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.CustomProviders/associations/association1", + "name": "associationName", + "id": "scope/providers/Microsoft.CustomProviders/associations/associationName", "type": "Microsoft.CustomProviders/associations", "properties": { - "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/appRG/providers/Microsoft.Solutions/applications/application1", + "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName", "provisioningState": "Succeeded" } } From 892c4cd831c56f027f2e26792d2149cb7f923ea7 Mon Sep 17 00:00:00 2001 From: Rama Casturi Date: Tue, 21 May 2019 10:58:34 -0700 Subject: [PATCH 5/6] Add Associations API Swagger specification --- .../preview/2018-09-01-preview/customproviders.json | 2 +- .../examples/createOrUpdateAssociation.json | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/customproviders.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/customproviders.json index faa3f95806e2..dfe58ca019be 100644 --- a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/customproviders.json +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/customproviders.json @@ -411,7 +411,7 @@ "description": "The name of the association." }, { - "name": "parameters", + "name": "association", "in": "body", "required": true, "schema": { diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateAssociation.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateAssociation.json index 011689c5d572..380240dc9c0a 100644 --- a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateAssociation.json +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateAssociation.json @@ -3,9 +3,11 @@ "scope": "scope", "associationName": "associationName", "api-version": "2018-09-01-preview", - "properties": { - "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/application1" - } + "association": { + "properties": { + "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName" + } + } }, "responses": { "201": { From 60a268246bc33378d469e597588d14a6ea76755f Mon Sep 17 00:00:00 2001 From: Rama Casturi Date: Tue, 21 May 2019 14:19:57 -0700 Subject: [PATCH 6/6] Add Associations API Swagger specification --- .../2018-09-01-preview/customproviders.json | 504 +++++++++--------- .../examples/createOrUpdateAssociation.json | 66 +-- .../examples/deleteAssociation.json | 20 +- .../examples/getAllAssociations.json | 40 +- .../examples/getAssociation.json | 34 +- 5 files changed, 332 insertions(+), 332 deletions(-) diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/customproviders.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/customproviders.json index dfe58ca019be..c68e3403dd21 100644 --- a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/customproviders.json +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/customproviders.json @@ -383,221 +383,221 @@ }, "/{scope}/providers/Microsoft.CustomProviders/associations/{associationName}": { "put": { - "tags": [ - "Associations" - ], - "operationId": "Associations_CreateOrUpdate", - "x-ms-long-running-operation": true, - "description": "Create or update an association.", - "x-ms-examples": { - "Create or update an association": { - "$ref": "examples/createOrUpdateAssociation.json" - } + "tags": [ + "Associations" + ], + "operationId": "Associations_CreateOrUpdate", + "x-ms-long-running-operation": true, + "description": "Create or update an association.", + "x-ms-examples": { + "Create or update an association": { + "$ref": "examples/createOrUpdateAssociation.json" + } + }, + "parameters": [ + { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope of the association. The scope can be any valid REST resource instance. For example, use '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.Compute/virtualMachines/{vm-name}' for a virtual machine resource.", + "x-ms-skip-url-encoding": true }, - "parameters": [ - { - "name": "scope", - "in": "path", - "required": true, - "type": "string", - "description": "The scope of the association. The scope can be any valid REST resource instance. For example, use '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.Compute/virtualMachines/{vm-name}' for a virtual machine resource.", - "x-ms-skip-url-encoding": true - }, - { - "name": "associationName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the association." - }, - { - "name": "association", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Association" - }, - "description": "The parameters required to create or update an association." - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "201": { - "description": "Created. Association has been created.", - "schema": { - "$ref": "#/definitions/Association" - } - }, - "200": { - "description": "OK. Association already exists and the changes have been accepted.", - "schema": { - "$ref": "#/definitions/Association" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } + { + "name": "associationName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the association." }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + { + "name": "association", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Association" + }, + "description": "The parameters required to create or update an association." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "201": { + "description": "Created. Association has been created.", + "schema": { + "$ref": "#/definitions/Association" + } + }, + "200": { + "description": "OK. Association already exists and the changes have been accepted.", + "schema": { + "$ref": "#/definitions/Association" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ] }, "delete": { - "tags": [ - "Associations" - ], - "operationId": "Associations_Delete", - "x-ms-long-running-operation": true, - "description": "Delete an association.", - "x-ms-examples": { - "Delete an association": { - "$ref": "examples/deleteAssociation.json" - } + "tags": [ + "Associations" + ], + "operationId": "Associations_Delete", + "x-ms-long-running-operation": true, + "description": "Delete an association.", + "x-ms-examples": { + "Delete an association": { + "$ref": "examples/deleteAssociation.json" + } + }, + "parameters": [ + { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope of the association.", + "x-ms-skip-url-encoding": true }, - "parameters": [ - { - "name": "scope", - "in": "path", - "required": true, - "type": "string", - "description": "The scope of the association.", - "x-ms-skip-url-encoding": true - }, - { - "name": "associationName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the association." - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK. Association deleted." - }, - "202": { - "description": "Accepted. Association delete has been accepted." - }, - "204": { - "description": "No Content. Association was not found." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } + { + "name": "associationName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the association." }, - "produces": [ - "application/json" - ] + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. Association deleted." + }, + "202": { + "description": "Accepted. Association delete has been accepted." + }, + "204": { + "description": "No Content. Association was not found." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "produces": [ + "application/json" + ] }, "get": { - "tags": [ - "Associations" - ], - "operationId": "Associations_Get", - "description": "Get an association.", - "x-ms-examples": { - "Get an association": { - "$ref": "examples/getAssociation.json" - } + "tags": [ + "Associations" + ], + "operationId": "Associations_Get", + "description": "Get an association.", + "x-ms-examples": { + "Get an association": { + "$ref": "examples/getAssociation.json" + } + }, + "parameters": [ + { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope of the association.", + "x-ms-skip-url-encoding": true }, - "parameters": [ - { - "name": "scope", - "in": "path", - "required": true, - "type": "string", - "description": "The scope of the association.", - "x-ms-skip-url-encoding": true - }, - { - "name": "associationName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the association." - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK. Returns association.", - "schema": { - "$ref": "#/definitions/Association" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } + { + "name": "associationName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the association." }, - "produces": [ - "application/json" - ] + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. Returns association.", + "schema": { + "$ref": "#/definitions/Association" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "produces": [ + "application/json" + ] } }, "/{scope}/providers/Microsoft.CustomProviders/associations": { - "get": { - "tags": [ - "Associations" - ], - "operationId": "Associations_ListAll", - "description": "Gets all association for the given scope.", - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, - "x-ms-examples": { - "Get all associations": { - "$ref": "examples/getAllAssociations.json" - } + "get": { + "tags": [ + "Associations" + ], + "operationId": "Associations_ListAll", + "description": "Gets all association for the given scope.", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Get all associations": { + "$ref": "examples/getAllAssociations.json" + } + }, + "parameters": [ + { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope of the association.", + "x-ms-skip-url-encoding": true }, - "parameters": [ - { - "name": "scope", - "in": "path", - "required": true, - "type": "string", - "description": "The scope of the association.", - "x-ms-skip-url-encoding": true - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK. Returns all associations for the given scope.", - "schema": { - "$ref": "#/definitions/AssociationsList" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. Returns all associations for the given scope.", + "schema": { + "$ref": "#/definitions/AssociationsList" + } }, - "produces": [ - "application/json" - ] + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "produces": [ + "application/json" + ] } } }, @@ -810,67 +810,67 @@ "x-ms-client-flatten": true, "description": "The resource definition of this association.", "properties": { - "id": { - "type": "string", - "readOnly": true, - "description": "The association id." - }, - "name": { + "id": { + "type": "string", + "readOnly": true, + "description": "The association id." + }, + "name": { + "type": "string", + "readOnly": true, + "description": "The association name." + }, + "type": { + "type": "string", + "readOnly": true, + "description": "The association type." + }, + "properties": { + "type": "object", + "description": "The properties of the association.", + "x-ms-client-flatten": true, + "properties": { + "targetResourceId": { "type": "string", - "readOnly": true, - "description": "The association name." - }, - "type": { + "description": "The REST resource instance of the target resource for this association." + }, + "provisioningState": { "type": "string", + "description": "The provisioning state of the association.", "readOnly": true, - "description": "The association type." - }, - "properties": { - "type": "object", - "description": "The properties of the association.", - "x-ms-client-flatten": true, - "properties": { - "targetResourceId": { - "type": "string", - "description": "The REST resource instance of the target resource for this association." - }, - "provisioningState": { - "type": "string", - "description": "The provisioning state of the association.", - "readOnly": true, - "x-ms-enum": { - "modelAsString": true, - "name": "ProvisioningState" - }, - "enum": [ - "Accepted", - "Deleting", - "Running", - "Succeeded", - "Failed" - ] - } - } + "x-ms-enum": { + "modelAsString": true, + "name": "ProvisioningState" + }, + "enum": [ + "Accepted", + "Deleting", + "Running", + "Succeeded", + "Failed" + ] + } } + } } - }, - "AssociationsList": { + }, + "AssociationsList": { "description": "List of associations.", "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/Association" - }, - "description": "The array of associations." + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Association" }, - "nextLink": { - "type": "string", - "description": "The URL to use for getting the next set of results." - } + "description": "The array of associations." + }, + "nextLink": { + "type": "string", + "description": "The URL to use for getting the next set of results." + } } - }, - "Resource": { + }, + "Resource": { "properties": { "id": { "readOnly": true, diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateAssociation.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateAssociation.json index 380240dc9c0a..2560751e4e0c 100644 --- a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateAssociation.json +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateAssociation.json @@ -1,38 +1,38 @@ { - "parameters": { - "scope": "scope", - "associationName": "associationName", - "api-version": "2018-09-01-preview", - "association": { - "properties": { - "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName" - } - } + "parameters": { + "scope": "scope", + "associationName": "associationName", + "api-version": "2018-09-01-preview", + "association": { + "properties": { + "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName" + } + } + }, + "responses": { + "201": { + "headers": {}, + "body": { + "name": "associationName", + "id": "/scope/providers/Microsoft.CustomProviders/associations/associationName", + "type": "Microsoft.CustomProviders/associations", + "properties": { + "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName", + "provisioningState": "Accepted" + } + } }, - "responses": { - "201": { - "headers": {}, - "body": { - "name": "associationName", - "id": "/scope/providers/Microsoft.CustomProviders/associations/associationName", - "type": "Microsoft.CustomProviders/associations", - "properties": { - "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName", - "provisioningState": "Accepted" - } - } - }, - "200": { - "headers": {}, - "body": { - "name": "associationName", - "id": "/scope/providers/Microsoft.CustomProviders/associations/associationName", - "type": "Microsoft.CustomProviders/associations", - "properties": { - "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName", - "provisioningState": "Accepted" - } - } + "200": { + "headers": {}, + "body": { + "name": "associationName", + "id": "/scope/providers/Microsoft.CustomProviders/associations/associationName", + "type": "Microsoft.CustomProviders/associations", + "properties": { + "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName", + "provisioningState": "Succeeded" } + } } + } } \ No newline at end of file diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/deleteAssociation.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/deleteAssociation.json index 89e3e62b758a..200e6d59922b 100644 --- a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/deleteAssociation.json +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/deleteAssociation.json @@ -1,12 +1,12 @@ { - "parameters": { - "scope": "scope", - "associationName": "associationName", - "api-version": "2018-09-01-preview" - }, - "responses": { - "200": {}, - "202": {}, - "204": {} - } + "parameters": { + "scope": "scope", + "associationName": "associationName", + "api-version": "2018-09-01-preview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } } \ No newline at end of file diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAllAssociations.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAllAssociations.json index 5c259906bf52..907b0171dd50 100644 --- a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAllAssociations.json +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAllAssociations.json @@ -1,24 +1,24 @@ { - "parameters": { - "scope": "scope", - "api-version": "2018-09-01-preview" - }, - "responses": { - "200": { - "headers": {}, - "body": { - "value": [ - { - "name": "associationName", - "id": "scope/providers/Microsoft.CustomProviders/associations/associationName", - "type": "Microsoft.CustomProviders/associations", - "properties": { - "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName", - "provisioningState": "Succeeded" - } - } - ] + "parameters": { + "scope": "scope", + "api-version": "2018-09-01-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "name": "associationName", + "id": "scope/providers/Microsoft.CustomProviders/associations/associationName", + "type": "Microsoft.CustomProviders/associations", + "properties": { + "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName", + "provisioningState": "Succeeded" } - } + } + ] + } } + } } \ No newline at end of file diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAssociation.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAssociation.json index 2d608e4c3005..6791d0eb6c17 100644 --- a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAssociation.json +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getAssociation.json @@ -1,21 +1,21 @@ { - "parameters": { - "scope": "scope", - "associationName": "associationName", - "api-version": "2018-09-01-preview" - }, - "responses": { - "200": { - "headers": {}, - "body": { - "name": "associationName", - "id": "scope/providers/Microsoft.CustomProviders/associations/associationName", - "type": "Microsoft.CustomProviders/associations", - "properties": { - "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName", - "provisioningState": "Succeeded" - } - } + "parameters": { + "scope": "scope", + "associationName": "associationName", + "api-version": "2018-09-01-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "name": "associationName", + "id": "scope/providers/Microsoft.CustomProviders/associations/associationName", + "type": "Microsoft.CustomProviders/associations", + "properties": { + "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName", + "provisioningState": "Succeeded" } + } } + } } \ No newline at end of file