From 0278b7a00ab2338ac4d37a9088ed25b87856314c Mon Sep 17 00:00:00 2001 From: Mahmut Burak Senol Date: Wed, 24 Feb 2021 12:21:47 -0800 Subject: [PATCH 1/2] [Quantum] Addressing swagger completeness and correctness errors --- .../examples/offeringsList.json | 1 + ...uantumWorkspacesCheckNameAvailability.json | 19 ++++ .../examples/quantumWorkspacesGet.json | 8 ++ .../quantumWorkspacesListResourceGroup.json | 8 ++ .../quantumWorkspacesListSubscription.json | 8 ++ .../examples/quantumWorkspacesPatch.json | 8 ++ .../examples/quantumWorkspacesPut.json | 16 ++++ .../preview/2019-11-04-preview/quantum.json | 92 ++++++++++++++++++- 8 files changed, 157 insertions(+), 3 deletions(-) create mode 100644 specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesCheckNameAvailability.json diff --git a/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/offeringsList.json b/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/offeringsList.json index c2b42302ca97..79a50d60dd5b 100644 --- a/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/offeringsList.json +++ b/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/offeringsList.json @@ -24,6 +24,7 @@ { "name": "Standard", "id": "Standard", + "version": "1.0", "description": "Provider CPU and FPGA QIO based solver.", "restrictedAccessUri": "https://endpoint", "targets": [ diff --git a/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesCheckNameAvailability.json b/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesCheckNameAvailability.json new file mode 100644 index 000000000000..36a3296d2f9a --- /dev/null +++ b/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesCheckNameAvailability.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "api-version": "2019-11-04-preview", + "locationName": "westus2", + "checkNameAvailabilityParameters": { + "name": "sample-workspace-name", + "type": "Microsoft.Quantum/Workspaces" + } + }, + "responses": { + "200": { + "body": { + "nameAvailable": true, + "reason": "" + } + } + } + } \ No newline at end of file diff --git a/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesGet.json b/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesGet.json index 463e74596333..5fdc0edc2295 100644 --- a/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesGet.json +++ b/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesGet.json @@ -52,6 +52,14 @@ "type": "SystemAssigned", "principalId": "00000000-1111-2222-3333-444444444444", "tenantId": "00000000-1111-2222-3333-444444444444" + }, + "systemData": { + "createdBy": "user1", + "createdByType": "User", + "createdAt": "2020-01-01T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z" } } } diff --git a/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesListResourceGroup.json b/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesListResourceGroup.json index 46b497fd1874..82d12a65ce79 100644 --- a/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesListResourceGroup.json +++ b/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesListResourceGroup.json @@ -37,6 +37,14 @@ "type": "SystemAssigned", "principalId": "00000000-1111-2222-3333-444444444444", "tenantId": "00000000-1111-2222-3333-444444444444" + }, + "systemData": { + "createdBy": "user1", + "createdByType": "User", + "createdAt": "2020-01-01T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z" } } ] diff --git a/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesListSubscription.json b/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesListSubscription.json index ca664270130f..07cd835d7a90 100644 --- a/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesListSubscription.json +++ b/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesListSubscription.json @@ -36,6 +36,14 @@ "type": "SystemAssigned", "principalId": "00000000-1111-2222-3333-444444444444", "tenantId": "00000000-1111-2222-3333-444444444444" + }, + "systemData": { + "createdBy": "user1", + "createdByType": "User", + "createdAt": "2020-01-01T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z" } } ] diff --git a/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesPatch.json b/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesPatch.json index 7943091c271f..ff824c825a0d 100644 --- a/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesPatch.json +++ b/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesPatch.json @@ -58,6 +58,14 @@ "type": "SystemAssigned", "principalId": "00000000-1111-2222-3333-444444444444", "tenantId": "00000000-1111-2222-3333-444444444444" + }, + "systemData": { + "createdBy": "user1", + "createdByType": "User", + "createdAt": "2020-01-01T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z" } } } diff --git a/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesPut.json b/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesPut.json index ce754f0f180e..2c7bac2e94c5 100644 --- a/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesPut.json +++ b/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesPut.json @@ -72,6 +72,14 @@ "type": "SystemAssigned", "principalId": "00000000-1111-2222-3333-444444444444", "tenantId": "00000000-1111-2222-3333-444444444444" + }, + "systemData": { + "createdBy": "user1", + "createdByType": "User", + "createdAt": "2020-01-01T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z" } } }, @@ -111,6 +119,14 @@ "type": "SystemAssigned", "principalId": "00000000-1111-2222-3333-444444444444", "tenantId": "00000000-1111-2222-3333-444444444444" + }, + "systemData": { + "createdBy": "user1", + "createdByType": "User", + "createdAt": "2020-01-01T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z" } } } diff --git a/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/quantum.json b/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/quantum.json index 0d8a2dee72d4..d31fafc8d37b 100644 --- a/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/quantum.json +++ b/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/quantum.json @@ -361,6 +361,52 @@ "nextLinkName": "nextLink" } } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Quantum/locations/{locationName}/checkNameAvailability": { + "post": { + "description": "Check the availability of the resource name.", + "operationId": "Workspace_CheckNameAvailability", + "x-ms-examples": { + "QuantumWorkspacesCheckNameAvailability": { + "$ref": "./examples/quantumWorkspacesCheckNameAvailability.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/LocationParameter" + }, + { + "name": "checkNameAvailabilityParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CheckNameAvailabilityParameters" + }, + "description": "The name and type of the resource." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/CheckNameAvailabilityResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + } + } + }, + "deprecated": false + } } }, "definitions": { @@ -402,7 +448,7 @@ "properties": { "properties": { "x-ms-client-flatten": true, - "description": "Gets or sets the properties. Define quantum space's specific properties.", + "description": "Gets or sets the properties. Define quantum workspace's specific properties.", "$ref": "#/definitions/WorkspaceResourceProperties" }, "identity": { @@ -432,6 +478,11 @@ } } } + }, + "systemData": { + "description": "System metadata", + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData", + "readOnly": true } }, "allOf": [ @@ -654,6 +705,10 @@ "type": "string", "description": "Display name of this sku." }, + "version": { + "type": "string", + "description": "Display name of this sku." + }, "description": { "type": "string", "description": "Description about this sku." @@ -769,7 +824,8 @@ }, "applicationName": { "type": "string", - "description": "The provider's marketplace application display name." + "description": "The provider's marketplace application display name.", + "readOnly": true }, "provisioningState": { "type": "string", @@ -789,7 +845,8 @@ }, "resourceUsageId": { "type": "string", - "description": "Id to track resource usage for the provider." + "description": "Id to track resource usage for the provider.", + "readOnly": true } } }, @@ -848,6 +905,35 @@ "required": [ "value" ] + }, + "CheckNameAvailabilityParameters": { + "description": "Details of check name availiability request body.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name for checking availability." + }, + "type": { + "type": "string", + "default": "Microsoft.Quantum/Workspaces", + "description": "The resource type of Quantum Workspace." + } + } + }, + "CheckNameAvailabilityResult": { + "description": "Result of check name availiability.", + "type": "object", + "properties": { + "nameAvailable": { + "type": "boolean", + "description": "Indicator of availability of the Quantum Workspace resource name." + }, + "reason": { + "type": "string", + "description": "The reason of unavailability." + } + } } }, "parameters": { From c228996dbf87b4af563d3c16da04495f9868c76f Mon Sep 17 00:00:00 2001 From: Mahmut Burak Senol Date: Wed, 24 Feb 2021 12:37:38 -0800 Subject: [PATCH 2/2] Fixing errors in SpellCheck and PrettierCheck --- ...uantumWorkspacesCheckNameAvailability.json | 32 +++++++++---------- .../preview/2019-11-04-preview/quantum.json | 4 +-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesCheckNameAvailability.json b/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesCheckNameAvailability.json index 36a3296d2f9a..78dbf1fe48b1 100644 --- a/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesCheckNameAvailability.json +++ b/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/examples/quantumWorkspacesCheckNameAvailability.json @@ -1,19 +1,19 @@ { - "parameters": { - "subscriptionId": "00000000-1111-2222-3333-444444444444", - "api-version": "2019-11-04-preview", - "locationName": "westus2", - "checkNameAvailabilityParameters": { - "name": "sample-workspace-name", - "type": "Microsoft.Quantum/Workspaces" - } - }, - "responses": { - "200": { - "body": { - "nameAvailable": true, - "reason": "" - } + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "api-version": "2019-11-04-preview", + "locationName": "westus2", + "checkNameAvailabilityParameters": { + "name": "sample-workspace-name", + "type": "Microsoft.Quantum/Workspaces" + } + }, + "responses": { + "200": { + "body": { + "nameAvailable": true, + "reason": "" } } - } \ No newline at end of file + } +} diff --git a/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/quantum.json b/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/quantum.json index d31fafc8d37b..8ad196274c20 100644 --- a/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/quantum.json +++ b/specification/quantum/resource-manager/Microsoft.Quantum/preview/2019-11-04-preview/quantum.json @@ -907,7 +907,7 @@ ] }, "CheckNameAvailabilityParameters": { - "description": "Details of check name availiability request body.", + "description": "Details of check name availability request body.", "type": "object", "properties": { "name": { @@ -922,7 +922,7 @@ } }, "CheckNameAvailabilityResult": { - "description": "Result of check name availiability.", + "description": "Result of check name availability.", "type": "object", "properties": { "nameAvailable": {