From 4df4b843dd2692aadd416dd9ede5979610c08be6 Mon Sep 17 00:00:00 2001 From: George Moussa Date: Mon, 11 Oct 2021 11:16:32 -0700 Subject: [PATCH] [Quantum] Add job cost estimate (#16339) * copy existin api-version * update api-version ref * new feature --- .../examples/jobDelete.json | 11 + .../2021-10-01-preview/examples/jobGet.json | 53 ++ .../2021-10-01-preview/examples/jobList.json | 69 ++ .../2021-10-01-preview/examples/jobPatch.json | 51 ++ .../2021-10-01-preview/examples/jobPut.json | 88 ++ .../examples/providerStatus.json | 88 ++ .../examples/quotaList.json | 61 ++ .../examples/storageGet.json | 18 + .../preview/2021-10-01-preview/quantum.json | 815 ++++++++++++++++++ specification/quantum/data-plane/readme.md | 8 + 10 files changed, 1262 insertions(+) create mode 100644 specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/jobDelete.json create mode 100644 specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/jobGet.json create mode 100644 specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/jobList.json create mode 100644 specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/jobPatch.json create mode 100644 specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/jobPut.json create mode 100644 specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/providerStatus.json create mode 100644 specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/quotaList.json create mode 100644 specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/storageGet.json create mode 100644 specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/quantum.json diff --git a/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/jobDelete.json b/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/jobDelete.json new file mode 100644 index 000000000000..705e0ea4d43c --- /dev/null +++ b/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/jobDelete.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "jobId": "a0f7adb6-0378-11eb-9463-2816a847b9a3", + "resourceGroupName": "quantumResourcegroup", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "workspaceName": "quantumworkspace1" + }, + "responses": { + "204": {} + } +} diff --git a/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/jobGet.json b/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/jobGet.json new file mode 100644 index 000000000000..a7734f9e364e --- /dev/null +++ b/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/jobGet.json @@ -0,0 +1,53 @@ +{ + "parameters": { + "jobId": "a0f7adb6-0378-11eb-9463-2816a847b9a3", + "resourceGroupName": "quantumResourcegroup", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "workspaceName": "quantumworkspace1" + }, + "responses": { + "200": { + "body": { + "name": "tabu-demo", + "id": "a0f7adb6-0378-11eb-9463-2816a847b9a3", + "beginExecutionTime": "2020-09-30T23:57:11.5659691Z", + "cancellationTime": null, + "containerUri": "https://storage.blob.core.windows.net/job-a0f7adb6-0378-11eb-9463-2816a847b9a3?sv=2019-02-02&sr=c&sig=mhbf4fluypvLtgXwN5a7iWMygL6b9ojM4EnCC%2F8BZBg%3D&se=2020-10-01T11%3A57%3A01Z&sp=rcw", + "creationTime": "2020-09-30T23:57:02.3737928+00:00", + "endExecutionTime": "2020-09-30T23:57:11.6180743Z", + "errorData": null, + "inputDataFormat": "microsoft.qio.v2", + "inputDataUri": "https://storage.blob.core.windows.net/job-a0f7adb6-0378-11eb-9463-2816a847b9a3/inputData?sv=2019-02-02&sr=b&sig=MtgxZEmrCv%2FmeQWFUe6%2Bx9tViSrhxSxYr6euGGHtWnw%3D&se=2020-10-01T11%3A57%3A01Z&sp=rcw", + "inputParams": { + "params": { + "sweeps": 300 + } + }, + "metadata": null, + "outputDataFormat": "microsoft.qio-results.v2", + "outputDataUri": "https://storage.blob.core.windows.net/job-a0f7adb6-0378-11eb-9463-2816a847b9a3/rawOutputData?sv=2019-02-02&sr=c&sig=mhbf4fluypvLtgXwN5a7iWMygL6b9ojM4EnCC%2F8BZBg%3D&se=2020-10-01T11%3A57%3A01Z&sp=rcw", + "providerId": "microsoft", + "status": "Succeeded", + "target": "microsoft.tabu.cpu", + "costEstimate": { + "currency": "USD", + "events": [ + { + "dimensionId": "jobhours", + "dimensionName": "Job Hours", + "measureUnit": "Hours", + "amountBilled": 0.5, + "amountConsumed": 0.5, + "unitPrice": 0.01 + } + ], + "estimatedTotal": 0.005 + }, + "tags": [ + "tag1", + "new" + ] + } + } + } +} diff --git a/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/jobList.json b/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/jobList.json new file mode 100644 index 000000000000..3d30d4e69b6e --- /dev/null +++ b/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/jobList.json @@ -0,0 +1,69 @@ +{ + "parameters": { + "resourceGroupName": "quantumResourcegroup", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "workspaceName": "quantumworkspace1" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "tabu-demo", + "id": "a0f7adb6-0378-11eb-9463-2816a847b9a3", + "beginExecutionTime": "2020-09-30T23:57:11.5659691Z", + "cancellationTime": null, + "containerUri": "https://storage.blob.core.windows.net/job-a0f7adb6-0378-11eb-9463-2816a847b9a3?sv=2019-02-02&sr=c&sig=mhbf4fluypvLtgXwN5a7iWMygL6b9ojM4EnCC%2F8BZBg%3D&se=2020-10-01T11%3A57%3A01Z&sp=rcw", + "creationTime": "2020-09-30T23:57:02.3737928+00:00", + "endExecutionTime": "2020-09-30T23:57:11.6180743Z", + "errorData": null, + "inputDataFormat": "microsoft.qio.v2", + "inputDataUri": "https://storage.blob.core.windows.net/job-a0f7adb6-0378-11eb-9463-2816a847b9a3/inputData?sv=2019-02-02&sr=b&sig=MtgxZEmrCv%2FmeQWFUe6%2Bx9tViSrhxSxYr6euGGHtWnw%3D&se=2020-10-01T11%3A57%3A01Z&sp=rcw", + "inputParams": { + "params": { + "sweeps": 300 + } + }, + "metadata": null, + "outputDataFormat": "microsoft.qio-results.v2", + "outputDataUri": "https://storage.blob.core.windows.net/job-a0f7adb6-0378-11eb-9463-2816a847b9a3/rawOutputData?sv=2019-02-02&sr=c&sig=mhbf4fluypvLtgXwN5a7iWMygL6b9ojM4EnCC%2F8BZBg%3D&se=2020-10-01T11%3A57%3A01Z&sp=rcw", + "providerId": "microsoft", + "status": "Succeeded", + "target": "microsoft.tabu.cpu", + "tags": [ + "tag1" + ] + }, + { + "id": "ab1aeddd-f191-4884-b8a9-13cdfa020fc6", + "name": "Superposition: true", + "beginExecutionTime": "2020-09-18T23:25:45.781389Z", + "cancellationTime": null, + "containerUri": "https://storage.blob.core.windows.net/quantum-job-ab1aeddd-f191-4884-b8a9-13cdfa020fc6?sv=2019-02-02&sr=c&sig=xhQtyt7Forj1HtpEkBTJTXAMTuuEvN0dTssv2OZlUNk%3D&se=2020-09-25T23%3A25%3A32Z&sp=rcw", + "creationTime": "2020-09-18T23:25:33.5541484+00:00", + "endExecutionTime": "2020-09-18T23:25:53.911837Z", + "errorData": null, + "inputDataFormat": "microsoft.qci-ir.v1", + "inputDataUri": "https://storage.blob.core.windows.net/quantum-job-ab1aeddd-f191-4884-b8a9-13cdfa020fc6/inputData?sv=2019-02-02&sr=b&sig=nDMUBPqNskFDLq591NGBE4nVnCiQhXYQBhSiU4xseVY%3D&se=2020-09-19T00%3A25%3A33Z&sp=rcw", + "inputParams": { + "shots": "10" + }, + "metadata": { + "entryPointInput": "true", + "outputMappingBlobUri": "https://storage.blob.core.windows.net/quantum-job-ab1aeddd-f191-4884-b8a9-13cdfa020fc6/mappingData?sv=2019-02-02&sr=b&sig=k6Gvd396GUtBxJasU9muSzkYXPQb8utASRSz932MFiw%3D&se=2020-09-19T00%3A25%3A33Z&sp=rcw" + }, + "outputDataFormat": "microsoft.quantum-results.v1", + "outputDataUri": "https://storage.blob.core.windows.net/quantum-job-ab1aeddd-f191-4884-b8a9-13cdfa020fc6/outputData?sv=2019-02-02&sr=c&sig=xhQtyt7Forj1HtpEkBTJTXAMTuuEvN0dTssv2OZlUNk%3D&se=2020-09-25T23%3A25%3A32Z&sp=rcw", + "providerId": "qci", + "status": "Succeeded", + "target": "qci.simulator", + "tags": [ + "tag2" + ] + } + ], + "nextLink": null + } + } + } +} diff --git a/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/jobPatch.json b/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/jobPatch.json new file mode 100644 index 000000000000..b474360410ca --- /dev/null +++ b/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/jobPatch.json @@ -0,0 +1,51 @@ +{ + "parameters": { + "jobId": "a0f7adb6-0378-11eb-9463-2816a847b9a3", + "resourceGroupName": "quantumResourcegroup", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "workspaceName": "quantumworkspace1", + "patchJob": [ + { + "op": "add", + "path": "/tags/-", + "value": "new_tag" + }, + { + "op": "remove", + "path": "/tags/0" + } + ] + }, + "responses": { + "200": { + "body": { + "name": "tabu-demo", + "id": "a0f7adb6-0378-11eb-9463-2816a847b9a3", + "beginExecutionTime": "2020-09-30T23:57:11.5659691Z", + "cancellationTime": null, + "containerUri": "https://storage.blob.core.windows.net/job-a0f7adb6-0378-11eb-9463-2816a847b9a3?sv=2019-02-02&sr=c&sig=mhbf4fluypvLtgXwN5a7iWMygL6b9ojM4EnCC%2F8BZBg%3D&se=2020-10-01T11%3A57%3A01Z&sp=rcw", + "creationTime": "2020-09-30T23:57:02.3737928+00:00", + "endExecutionTime": "2020-09-30T23:57:11.6180743Z", + "errorData": null, + "inputDataFormat": "microsoft.qio.v2", + "inputDataUri": "https://storage.blob.core.windows.net/job-a0f7adb6-0378-11eb-9463-2816a847b9a3/inputData?sv=2019-02-02&sr=b&sig=MtgxZEmrCv%2FmeQWFUe6%2Bx9tViSrhxSxYr6euGGHtWnw%3D&se=2020-10-01T11%3A57%3A01Z&sp=rcw", + "inputParams": { + "params": { + "sweeps": 300 + } + }, + "metadata": null, + "outputDataFormat": "microsoft.qio-results.v2", + "outputDataUri": "https://storage.blob.core.windows.net/job-a0f7adb6-0378-11eb-9463-2816a847b9a3/rawOutputData?sv=2019-02-02&sr=c&sig=mhbf4fluypvLtgXwN5a7iWMygL6b9ojM4EnCC%2F8BZBg%3D&se=2020-10-01T11%3A57%3A01Z&sp=rcw", + "providerId": "microsoft", + "status": "Succeeded", + "target": "microsoft.tabu.cpu", + "tags": [ + "tag2", + "new_tag" + ] + } + }, + "204": {} + } +} diff --git a/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/jobPut.json b/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/jobPut.json new file mode 100644 index 000000000000..b14fad3a2e7d --- /dev/null +++ b/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/jobPut.json @@ -0,0 +1,88 @@ +{ + "parameters": { + "jobId": "a0f7adb6-0378-11eb-9463-2816a847b9a3", + "resourceGroupName": "quantumResourcegroup", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "workspaceName": "quantumworkspace1", + "job": { + "name": "tabu-demo", + "id": "a0f7adb6-0378-11eb-9463-2816a847b9a3", + "containerUri": "https://storage.blob.core.windows.net/job-a0f7adb6-0378-11eb-9463-2816a847b9a3?sv=2019-02-02&sr=c&sig=mhbf4fluypvLtgXwN5a7iWMygL6b9ojM4EnCC%2F8BZBg%3D&se=2020-10-01T11%3A57%3A01Z&sp=rcw", + "inputDataFormat": "microsoft.qio.v2", + "inputDataUri": "https://storage.blob.core.windows.net/job-a0f7adb6-0378-11eb-9463-2816a847b9a3/inputData?sv=2019-02-02&sr=b&sig=MtgxZEmrCv%2FmeQWFUe6%2Bx9tViSrhxSxYr6euGGHtWnw%3D&se=2020-10-01T11%3A57%3A01Z&sp=rcw", + "inputParams": { + "params": { + "sweeps": 300 + } + }, + "outputDataFormat": "microsoft.qio-results.v2", + "outputDataUri": "https://storage.blob.core.windows.net/job-a0f7adb6-0378-11eb-9463-2816a847b9a3/rawOutputData?sv=2019-02-02&sr=c&sig=mhbf4fluypvLtgXwN5a7iWMygL6b9ojM4EnCC%2F8BZBg%3D&se=2020-10-01T11%3A57%3A01Z&sp=rcw", + "providerId": "microsoft", + "target": "microsoft.tabu.cpu", + "tags": [ + "tag1", + "tag_2" + ] + } + }, + "responses": { + "200": { + "body": { + "name": "tabu-demo", + "id": "a0f7adb6-0378-11eb-9463-2816a847b9a3", + "beginExecutionTime": "2020-09-30T23:57:11.5659691Z", + "cancellationTime": null, + "containerUri": "https://storage.blob.core.windows.net/job-a0f7adb6-0378-11eb-9463-2816a847b9a3?sv=2019-02-02&sr=c&sig=mhbf4fluypvLtgXwN5a7iWMygL6b9ojM4EnCC%2F8BZBg%3D&se=2020-10-01T11%3A57%3A01Z&sp=rcw", + "creationTime": "2020-09-30T23:57:02.3737928+00:00", + "endExecutionTime": "2020-09-30T23:57:11.6180743Z", + "errorData": null, + "inputDataFormat": "microsoft.qio.v2", + "inputDataUri": "https://storage.blob.core.windows.net/job-a0f7adb6-0378-11eb-9463-2816a847b9a3/inputData?sv=2019-02-02&sr=b&sig=MtgxZEmrCv%2FmeQWFUe6%2Bx9tViSrhxSxYr6euGGHtWnw%3D&se=2020-10-01T11%3A57%3A01Z&sp=rcw", + "inputParams": { + "params": { + "sweeps": 300 + } + }, + "metadata": null, + "outputDataFormat": "microsoft.qio-results.v2", + "outputDataUri": "https://storage.blob.core.windows.net/job-a0f7adb6-0378-11eb-9463-2816a847b9a3/rawOutputData?sv=2019-02-02&sr=c&sig=mhbf4fluypvLtgXwN5a7iWMygL6b9ojM4EnCC%2F8BZBg%3D&se=2020-10-01T11%3A57%3A01Z&sp=rcw", + "providerId": "microsoft", + "status": "Succeeded", + "target": "microsoft.tabu.cpu", + "tags": [ + "tag1", + "tag_2" + ] + } + }, + "201": { + "body": { + "name": "tabu-demo", + "id": "a0f7adb6-0378-11eb-9463-2816a847b9a3", + "beginExecutionTime": "2020-09-30T23:57:11.5659691Z", + "cancellationTime": null, + "containerUri": "https://storage.blob.core.windows.net/job-a0f7adb6-0378-11eb-9463-2816a847b9a3?sv=2019-02-02&sr=c&sig=mhbf4fluypvLtgXwN5a7iWMygL6b9ojM4EnCC%2F8BZBg%3D&se=2020-10-01T11%3A57%3A01Z&sp=rcw", + "creationTime": "2020-09-30T23:57:02.3737928+00:00", + "endExecutionTime": "2020-09-30T23:57:11.6180743Z", + "errorData": null, + "inputDataFormat": "microsoft.qio.v2", + "inputDataUri": "https://storage.blob.core.windows.net/job-a0f7adb6-0378-11eb-9463-2816a847b9a3/inputData?sv=2019-02-02&sr=b&sig=MtgxZEmrCv%2FmeQWFUe6%2Bx9tViSrhxSxYr6euGGHtWnw%3D&se=2020-10-01T11%3A57%3A01Z&sp=rcw", + "inputParams": { + "params": { + "sweeps": 300 + } + }, + "metadata": null, + "outputDataFormat": "microsoft.qio-results.v2", + "outputDataUri": "https://storage.blob.core.windows.net/job-a0f7adb6-0378-11eb-9463-2816a847b9a3/rawOutputData?sv=2019-02-02&sr=c&sig=mhbf4fluypvLtgXwN5a7iWMygL6b9ojM4EnCC%2F8BZBg%3D&se=2020-10-01T11%3A57%3A01Z&sp=rcw", + "providerId": "microsoft", + "status": "Succeeded", + "target": "microsoft.tabu.cpu", + "tags": [ + "tag1", + "tag_2" + ] + } + } + } +} diff --git a/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/providerStatus.json b/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/providerStatus.json new file mode 100644 index 000000000000..4369f518c3ec --- /dev/null +++ b/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/providerStatus.json @@ -0,0 +1,88 @@ +{ + "parameters": { + "resourceGroupName": "quantumResourcegroup", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "workspaceName": "quantumworkspace1" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "Microsoft", + "currentAvailability": "Available", + "targets": [ + { + "id": "microsoft.paralleltempering-parameterfree.cpu", + "currentAvailability": "Available", + "averageQueueTime": 0, + "statusPage": null + }, + { + "id": "microsoft.paralleltempering.cpu", + "currentAvailability": "Available", + "averageQueueTime": 0, + "statusPage": null + }, + { + "id": "microsoft.simulatedannealing-parameterfree.cpu", + "currentAvailability": "Available", + "averageQueueTime": 0, + "statusPage": null + }, + { + "id": "microsoft.simulatedannealing.cpu", + "currentAvailability": "Available", + "averageQueueTime": 0, + "statusPage": null + }, + { + "id": "microsoft.tabu-parameterfree.cpu", + "currentAvailability": "Available", + "averageQueueTime": 0, + "statusPage": null + }, + { + "id": "microsoft.tabu.cpu", + "currentAvailability": "Available", + "averageQueueTime": 0, + "statusPage": null + }, + { + "id": "microsoft.simulatedannealing-parameterfree.fpga", + "currentAvailability": "Available", + "averageQueueTime": 0, + "statusPage": null + }, + { + "id": "microsoft.simulatedannealing.fpga", + "currentAvailability": "Available", + "averageQueueTime": 0, + "statusPage": null + } + ] + }, + { + "id": "ionq", + "currentAvailability": "Available", + "targets": [ + { + "id": "ionq.qpu", + "currentAvailability": "Available", + "averageQueueTime": 1679, + "statusPage": "https://status.ionq.co" + }, + { + "id": "ionq.simulator", + "currentAvailability": "Available", + "averageQueueTime": 0, + "statusPage": "https://status.ionq.co" + } + ] + } + ], + "nextLink": null + } + } + } +} diff --git a/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/quotaList.json b/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/quotaList.json new file mode 100644 index 000000000000..4959efb267a5 --- /dev/null +++ b/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/quotaList.json @@ -0,0 +1,61 @@ +{ + "parameters": { + "resourceGroupName": "quantumResourcegroup", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "workspaceName": "quantumworkspace1" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "dimension": "free_combined_job_hours", + "scope": "Subscription", + "providerId": "Microsoft", + "utilization": 0.001756120333333333, + "holds": 0.016666666666666666, + "limit": 15.0, + "period": "Monthly" + }, + { + "dimension": "free_fpga_job_hours", + "scope": "Workspace", + "providerId": "Microsoft", + "utilization": 0.0, + "holds": 0.0, + "limit": 0.25, + "period": "Monthly" + }, + { + "dimension": "free_combined_job_hours", + "scope": "Workspace", + "providerId": "Microsoft", + "utilization": 0.0017561203333333335, + "holds": 0.0, + "limit": 1.0, + "period": "Monthly" + }, + { + "dimension": "concurrent_cpu_jobs", + "scope": "Workspace", + "providerId": "Microsoft", + "utilization": 0.0, + "holds": 0.0, + "limit": 10.0, + "period": "None" + }, + { + "dimension": "concurrent_fpga_jobs", + "scope": "Workspace", + "providerId": "Microsoft", + "utilization": 0.0, + "holds": 0.0, + "limit": 1.0, + "period": "None" + } + ], + "nextLink": null + } + } + } +} diff --git a/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/storageGet.json b/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/storageGet.json new file mode 100644 index 000000000000..d968ec0660e6 --- /dev/null +++ b/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/examples/storageGet.json @@ -0,0 +1,18 @@ +{ + "parameters": { + "resourceGroupName": "quantumResourcegroup", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "workspaceName": "quantumworkspace1", + "blobDetails": { + "containerName": "some_container", + "blobName": "input_blob" + } + }, + "responses": { + "200": { + "body": { + "sasUri": "https://storage.blob.core.windows.net/some_container/input_blob?sv=2019-02-02&sr=b&sig=cdO24OOoXterLJVM8T6QpSaog3ST4PjQsDj3mLflfJA%3D&se=2020-10-17T10%3A03%3A01Z&sp=rcw" + } + } + } +} diff --git a/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/quantum.json b/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/quantum.json new file mode 100644 index 000000000000..e7638f707106 --- /dev/null +++ b/specification/quantum/data-plane/Microsoft.Quantum/preview/2021-10-01-preview/quantum.json @@ -0,0 +1,815 @@ +{ + "swagger": "2.0", + "info": { + "title": "Quantum Client", + "description": "Azure Quantum REST API client", + "version": "2021-10-01-preview" + }, + "host": "quantum.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/jobs": { + "get": { + "operationId": "Jobs_List", + "description": "List jobs.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/workspaceNameParameter" + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "schema": { + "$ref": "#/definitions/JobDetailsList" + } + } + }, + "x-ms-examples": { + "Get list of jobs in a Quantum Workspace": { + "$ref": "./examples/jobList.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/jobs/{jobId}": { + "get": { + "operationId": "Jobs_Get", + "description": "Get job by id", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/workspaceNameParameter" + }, + { + "$ref": "#/parameters/jobIdParameter" + } + ], + "x-ms-examples": { + "Get a job's metadata": { + "$ref": "./examples/jobGet.json" + } + }, + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/JobDetails" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/RestError" + } + } + } + }, + "put": { + "operationId": "Jobs_Create", + "description": "Create a job.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/workspaceNameParameter" + }, + { + "$ref": "#/parameters/jobIdParameter" + }, + { + "name": "job", + "description": "The complete metadata of the job to submit.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/JobDetails" + } + } + ], + "x-ms-examples": { + "Submit a new job for execution to a Quantum Workspace": { + "$ref": "./examples/jobPut.json" + } + }, + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/JobDetails" + } + }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/JobDetails" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/RestError" + } + } + } + }, + "delete": { + "operationId": "Jobs_Cancel", + "description": "Cancel a job.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/workspaceNameParameter" + }, + { + "$ref": "#/parameters/jobIdParameter" + } + ], + "x-ms-examples": { + "Cancel the execution of an existing job": { + "$ref": "./examples/jobDelete.json" + } + }, + "responses": { + "204": { + "description": "NoContent - The job was successfully cancelled." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/RestError" + } + } + } + }, + "patch": { + "operationId": "Jobs_Patch", + "description": "Patch a job.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/workspaceNameParameter" + }, + { + "$ref": "#/parameters/jobIdParameter" + }, + { + "name": "patchJob", + "description": "The json patch document containing the patch operations.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PatchRequest" + } + } + ], + "x-ms-examples": { + "Patch an existing job to a Quantum Workspace": { + "$ref": "./examples/jobPatch.json" + } + }, + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/JobDetails" + } + }, + "204": { + "description": "No Content - the patch body was empty or had no operations." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/RestError" + } + } + } + } + }, + "/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/providerStatus": { + "get": { + "operationId": "Providers_GetStatus", + "description": "Get provider status.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/workspaceNameParameter" + } + ], + "x-ms-examples": { + "Get list of of providers and their status for a Quantum Workspace": { + "$ref": "./examples/providerStatus.json" + } + }, + "responses": { + "200": { + "description": "The operation completed successfully.", + "schema": { + "$ref": "#/definitions/ProviderStatusList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/RestError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/storage/sasUri": { + "post": { + "operationId": "Storage_SasUri", + "description": "Gets a URL with SAS token for a container/blob in the storage account associated with the workspace. The SAS URL can be used to upload job input and/or download job output.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/workspaceNameParameter" + }, + { + "name": "blobDetails", + "description": "The details (name and container) of the blob to store or download data.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BlobDetails" + } + } + ], + "x-ms-examples": { + "Get a SAS token to upload data for a Quantum Workspace": { + "$ref": "./examples/storageGet.json" + } + }, + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SasUriResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/RestError" + } + } + } + } + }, + "/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/quotas": { + "get": { + "operationId": "Quotas_List", + "description": "List quotas for the given workspace.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/workspaceNameParameter" + } + ], + "x-ms-examples": { + "Get a list of quotas for a particular quantum workspace.": { + "$ref": "./examples/quotaList.json" + } + }, + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/QuotaList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/RestError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + } + }, + "definitions": { + "JobDetailsList": { + "description": "List of job details.", + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/JobDetails" + } + }, + "count": { + "type": "integer", + "format": "int64", + "description": "Total records count number." + }, + "nextLink": { + "type": "string", + "readOnly": true, + "description": "Link to the next page of results." + } + } + }, + "JobDetails": { + "description": "Job details.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The job id." + }, + "name": { + "type": "string", + "description": "The job name. Is not required for the name to be unique and it's only used for display purposes." + }, + "containerUri": { + "type": "string", + "description": "The blob container SAS uri, the container is used to host job data." + }, + "inputDataUri": { + "type": "string", + "description": "The input blob SAS uri, if specified, it will override the default input blob in the container." + }, + "inputDataFormat": { + "type": "string", + "description": "The format of the input data." + }, + "inputParams": { + "type": "object", + "description": "The input parameters for the job. JSON object used by the target solver. It is expected that the size of this object is small and only used to specify parameters for the execution target, not the input data." + }, + "providerId": { + "type": "string", + "description": "The unique identifier for the provider." + }, + "target": { + "type": "string", + "description": "The target identifier to run the job." + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "The job metadata. Metadata provides client the ability to store client-specific information" + }, + "outputDataUri": { + "type": "string", + "description": "The output blob SAS uri. When a job finishes successfully, results will be uploaded to this blob." + }, + "outputDataFormat": { + "type": "string", + "description": "The format of the output data." + }, + "status": { + "type": "string", + "description": "The job status.", + "readOnly": true, + "enum": [ + "Waiting", + "Executing", + "Succeeded", + "Failed", + "Cancelled" + ], + "x-ms-enum": { + "name": "JobStatus", + "modelAsString": true + } + }, + "creationTime": { + "type": "string", + "readOnly": true, + "format": "date-time", + "description": "The creation time of the job." + }, + "beginExecutionTime": { + "type": "string", + "readOnly": true, + "format": "date-time", + "description": "The time when the job began execution." + }, + "endExecutionTime": { + "type": "string", + "readOnly": true, + "format": "date-time", + "description": "The time when the job finished execution." + }, + "cancellationTime": { + "type": "string", + "readOnly": true, + "format": "date-time", + "description": "The time when a job was successfully cancelled." + }, + "costEstimate": { + "$ref": "#/definitions/CostEstimate", + "readOnly": true, + "description": "The job billing data." + }, + "errorData": { + "$ref": "#/definitions/ErrorData", + "readOnly": true, + "description": "The error data for the job. This is expected only when Status 'Failed'." + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of user-supplied tags associated with the job." + } + }, + "required": [ + "containerUri", + "inputDataFormat", + "providerId", + "target" + ] + }, + "BlobDetails": { + "description": "Blob details.", + "type": "object", + "properties": { + "containerName": { + "type": "string", + "description": "The container name." + }, + "blobName": { + "type": "string", + "description": "The blob name." + } + }, + "required": [ + "containerName" + ] + }, + "SasUriResponse": { + "description": "Get SAS URL operation response.", + "type": "object", + "properties": { + "sasUri": { + "type": "string", + "description": "A URL with a SAS token to upload a blob for execution in the given workspace." + } + } + }, + "ProviderStatusList": { + "description": "Providers status.", + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/ProviderStatus" + } + }, + "nextLink": { + "type": "string", + "readOnly": true, + "description": "Link to the next page of results." + } + } + }, + "ProviderStatus": { + "description": "Providers status.", + "properties": { + "id": { + "type": "string", + "readOnly": true, + "description": "Provider id." + }, + "currentAvailability": { + "type": "string", + "readOnly": true, + "description": "Provider availability.", + "enum": [ + "Available", + "Degraded", + "Unavailable" + ], + "x-ms-enum": { + "name": "ProviderAvailability", + "modelAsString": true + } + }, + "targets": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/TargetStatus" + } + } + } + }, + "TargetStatus": { + "description": "Target status.", + "properties": { + "id": { + "type": "string", + "readOnly": true, + "description": "Target id." + }, + "currentAvailability": { + "type": "string", + "readOnly": true, + "description": "Target availability.", + "enum": [ + "Available", + "Degraded", + "Unavailable" + ], + "x-ms-enum": { + "name": "TargetAvailability", + "modelAsString": true + } + }, + "averageQueueTime": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "Average queue time in seconds." + }, + "statusPage": { + "type": "string", + "readOnly": true, + "description": "A page with detailed status of the provider." + } + } + }, + "QuotaList": { + "description": "List of quotas.", + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/Quota" + } + }, + "nextLink": { + "type": "string", + "readOnly": true, + "description": "Link to the next page of results." + } + } + }, + "Quota": { + "description": "Quota information.", + "type": "object", + "properties": { + "dimension": { + "type": "string", + "description": "The name of the dimension associated with the quota." + }, + "scope": { + "type": "string", + "description": "The scope at which the quota is applied.", + "enum": [ + "Workspace", + "Subscription" + ], + "x-ms-enum": { + "name": "DimensionScope", + "modelAsString": true + } + }, + "providerId": { + "type": "string", + "description": "The unique identifier for the provider." + }, + "utilization": { + "type": "number", + "description": "The amount of the usage that has been applied for the current period." + }, + "holds": { + "type": "number", + "description": "The amount of the usage that has been reserved but not applied for the current period." + }, + "limit": { + "type": "number", + "description": "The maximum amount of usage allowed for the current period." + }, + "period": { + "type": "string", + "description": "The time period in which the quota's underlying meter is accumulated. Based on calendar year. 'None' is used for concurrent quotas.", + "enum": [ + "None", + "Monthly" + ], + "x-ms-enum": { + "name": "MeterPeriod", + "modelAsString": true + } + } + } + }, + "CostEstimate": { + "properties": { + "currency": { + "type": "string", + "description": "The estimated cost currency." + }, + "events": { + "type": "array", + "description": "List of usage events", + "items": { + "$ref": "#/definitions/UsageEvent" + } + }, + "estimatedTotal": { + "type": "number", + "description": "The estimated total." + } + }, + "description": "A job cost estimate." + }, + "UsageEvent": { + "properties": { + "dimensionId": { + "type": "string", + "description": "The dimension id." + }, + "dimensionName": { + "type": "string", + "description": "The dimension name." + }, + "measureUnit": { + "type": "string", + "description": "The unit of measure." + }, + "amountBilled": { + "type": "number", + "description": "The amount billed." + }, + "amountConsumed": { + "type": "number", + "description": "The amount consumed." + }, + "unitPrice": { + "type": "number", + "description": "The unit price." + } + }, + "description": "Usage event details." + }, + "RestError": { + "type": "object", + "description": "Error information returned by the API", + "properties": { + "error": { + "$ref": "#/definitions/ErrorData" + } + } + }, + "ErrorData": { + "properties": { + "code": { + "type": "string", + "description": "An identifier for the error. Codes are invariant and are intended to be consumed programmatically." + }, + "message": { + "type": "string", + "description": "A message describing the error, intended to be suitable for displaying in a user interface." + } + }, + "description": "An error response from Azure." + }, + "PatchRequest": { + "type": "array", + "items": { + "$ref": "#/definitions/JsonPatchDocument" + } + }, + "JsonPatchDocument": { + "description": "A JSONPatch document as defined by RFC 6902", + "required": [ + "op", + "path" + ], + "properties": { + "op": { + "type": "string", + "description": "The operation to be performed.", + "enum": [ + "add", + "remove", + "replace", + "move", + "copy", + "test" + ], + "x-ms-enum": { + "name": "JsonPatchOperation", + "modelAsString": true + } + }, + "path": { + "type": "string", + "description": "A JSON-Pointer." + }, + "value": { + "type": "object", + "description": "A value to be used in the operation on the path." + }, + "from": { + "type": "string", + "description": "Optional field used in copy and move operations." + } + } + } + }, + "parameters": { + "subscriptionIdParameter": { + "name": "subscriptionId", + "description": "The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)", + "in": "path", + "required": true, + "x-ms-parameter-location": "client", + "type": "string" + }, + "resourceGroupNameParameter": { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "client", + "description": "Name of an Azure resource group." + }, + "workspaceNameParameter": { + "name": "workspaceName", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "client", + "description": "Name of the workspace." + }, + "jobIdParameter": { + "name": "jobId", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Id of the job." + } + } +} diff --git a/specification/quantum/data-plane/readme.md b/specification/quantum/data-plane/readme.md index 15e635b44dc5..aa765b465ce3 100644 --- a/specification/quantum/data-plane/readme.md +++ b/specification/quantum/data-plane/readme.md @@ -47,6 +47,14 @@ input-file: - Microsoft.Quantum/preview/2021-05-06-preview/quantum.json ``` +### Tag: package-2021-10-01-preview + +These settings apply only when `--tag=package-2021-10-01-preview` is specified on the command line. + +```yaml $(tag) == 'package-2021-10-01-preview' +input-file: + - Microsoft.Quantum/preview/2021-10-01-preview/quantum.json +``` ---