From ad1a0bee0c5b9db6c7954e702de87fd24192bfe7 Mon Sep 17 00:00:00 2001 From: Nitesh Vijay Date: Tue, 26 Apr 2022 07:57:48 +0530 Subject: [PATCH] Add Pause Resume API (#18803) * Add Pause Resume API * Fix LintDiff * Fix responses * Fix prettier --- .../dataTransferService.json | 137 +++++++++++++++++- .../CosmosDBDataTransferJobCancel.json | 34 +++++ .../CosmosDBDataTransferJobCreate.json | 7 +- .../CosmosDBDataTransferJobFeed.json | 5 +- .../CosmosDBDataTransferJobGet.json | 5 +- .../CosmosDBDataTransferJobPause.json | 34 +++++ .../CosmosDBDataTransferJobResume.json | 34 +++++ 7 files changed, 246 insertions(+), 10 deletions(-) create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCancel.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobPause.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobResume.json diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/dataTransferService.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/dataTransferService.json index 384fc16891f4..1da0611a5dec 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/dataTransferService.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/dataTransferService.json @@ -69,7 +69,7 @@ } ], "responses": { - "201": { + "200": { "description": "Successful CreateJob response", "schema": { "$ref": "#/definitions/DataTransferJobGetResults" @@ -124,6 +124,132 @@ } } }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/pause": { + "post": { + "operationId": "DataTransferJobs_Pause", + "description": "Pause a Data Transfer Job.", + "x-ms-examples": { + "CosmosDBDataTransferJobPause": { + "$ref": "./examples/data-transfer-service/CosmosDBDataTransferJobPause.json" + } + }, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "./cosmos-db.json#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/JobNameParameter" + } + ], + "responses": { + "200": { + "description": "Successful Pause Job response", + "schema": { + "$ref": "#/definitions/DataTransferJobGetResults" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "cosmos-db.json#/definitions/CloudError" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/resume": { + "post": { + "operationId": "DataTransferJobs_Resume", + "description": "Resumes a Data Transfer Job.", + "x-ms-examples": { + "CosmosDBDataTransferJobCreate": { + "$ref": "./examples/data-transfer-service/CosmosDBDataTransferJobResume.json" + } + }, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "./cosmos-db.json#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/JobNameParameter" + } + ], + "responses": { + "200": { + "description": "Successful Resume Job response", + "schema": { + "$ref": "#/definitions/DataTransferJobGetResults" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "cosmos-db.json#/definitions/CloudError" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/cancel": { + "post": { + "operationId": "DataTransferJobs_Cancel", + "description": "Cancels a Data Transfer Job.", + "x-ms-examples": { + "CosmosDBDataTransferJobCreate": { + "$ref": "./examples/data-transfer-service/CosmosDBDataTransferJobCancel.json" + } + }, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "./cosmos-db.json#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/JobNameParameter" + } + ], + "responses": { + "200": { + "description": "Successful Cancel Job response", + "schema": { + "$ref": "#/definitions/DataTransferJobGetResults" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "cosmos-db.json#/definitions/CloudError" + } + } + } + } + }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs": { "get": { "operationId": "DataTransferJobs_ListByDatabaseAccount", @@ -278,10 +404,15 @@ "type": "string", "description": "Job Status" }, - "percentageComplete": { + "processedCount": { + "readOnly": true, + "type": "number", + "description": "Processed Count." + }, + "totalCount": { "readOnly": true, "type": "number", - "description": "Percentage of completion." + "description": "Total Count." }, "lastUpdatedUtcTime": { "readOnly": true, diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCancel.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCancel.json new file mode 100644 index 000000000000..dc00ebfb478f --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCancel.json @@ -0,0 +1,34 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2022-02-15-preview", + "subscriptionId": "subid", + "jobName": "j1" + }, + "responses": { + "200": { + "body": { + "id": "ab1b6f34-b33c-46b1-98c7-3a0a63fd0d16", + "type": "Microsoft.DocumentDB/databaseAccounts/dataTransferJobs", + "properties": { + "jobName": "j1", + "source": { + "tableName": "table", + "keyspaceName": "keyspace", + "component": "CosmosDBCassandra" + }, + "destination": { + "component": "AzureBlobStorage", + "containerName": "blob_container", + "endpointUrl": "https://blob.windows.net" + }, + "status": "Cancelled", + "processedCount": 20, + "totalCount": 100, + "lastUpdatedUtcTime": "2021-06-12T11:10:55.2780000Z" + } + } + } + } +} diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json index 8b4c9185bbc9..29d7c96959df 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json @@ -2,7 +2,7 @@ "parameters": { "accountName": "ddb1", "resourceGroupName": "rg1", - "api-version": "2020-10-15-preview", + "api-version": "2022-02-15-preview", "subscriptionId": "subid", "jobName": "j1", "jobCreateParameters": { @@ -21,7 +21,7 @@ } }, "responses": { - "201": { + "200": { "body": { "id": "ab1b6f34-b33c-46b1-98c7-3a0a63fd0d16", "type": "Microsoft.DocumentDB/databaseAccounts/dataTransferJobs", @@ -38,7 +38,8 @@ "endpointUrl": "https://blob.windows.net" }, "status": "Running", - "percentageComplete": 20, + "processedCount": 0, + "totalCount": 0, "lastUpdatedUtcTime": "2021-06-12T11:10:55.2780000Z" } } diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobFeed.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobFeed.json index acde9eaad111..236f1eaab2c4 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobFeed.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobFeed.json @@ -2,7 +2,7 @@ "parameters": { "accountName": "ddb1", "resourceGroupName": "rg1", - "api-version": "2020-10-15-preview", + "api-version": "2022-02-15-preview", "subscriptionId": "subid" }, "responses": { @@ -25,7 +25,8 @@ "containerName": "blob_container" }, "status": "Completed", - "percentageComplete": 100, + "processedCount": 100, + "totalCount": 100, "lastUpdatedUtcTime": "2021-06-12T12:04:23.1530000Z" } } diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json index 391734048ca1..114a2cf1f97f 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json @@ -2,7 +2,7 @@ "parameters": { "accountName": "ddb1", "resourceGroupName": "rg1", - "api-version": "2020-10-15-preview", + "api-version": "2022-02-15-preview", "subscriptionId": "subid", "jobName": "j1" }, @@ -24,7 +24,8 @@ "containerName": "blob_container" }, "status": "Completed", - "percentageComplete": 100, + "processedCount": 50, + "totalCount": 50, "lastUpdatedUtcTime": "2021-06-12T12:04:23.1530000Z" } } diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobPause.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobPause.json new file mode 100644 index 000000000000..1bf649de1d83 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobPause.json @@ -0,0 +1,34 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2022-02-15-preview", + "subscriptionId": "subid", + "jobName": "j1" + }, + "responses": { + "200": { + "body": { + "id": "ab1b6f34-b33c-46b1-98c7-3a0a63fd0d16", + "type": "Microsoft.DocumentDB/databaseAccounts/dataTransferJobs", + "properties": { + "jobName": "j1", + "source": { + "tableName": "table", + "keyspaceName": "keyspace", + "component": "CosmosDBCassandra" + }, + "destination": { + "component": "AzureBlobStorage", + "containerName": "blob_container", + "endpointUrl": "https://blob.windows.net" + }, + "status": "Paused", + "processedCount": 20, + "totalCount": 100, + "lastUpdatedUtcTime": "2021-06-12T11:10:55.2780000Z" + } + } + } + } +} diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobResume.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobResume.json new file mode 100644 index 000000000000..50fc4a6f8d1d --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobResume.json @@ -0,0 +1,34 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2022-04-15-preview", + "subscriptionId": "subid", + "jobName": "j1" + }, + "responses": { + "200": { + "body": { + "id": "ab1b6f34-b33c-46b1-98c7-3a0a63fd0d16", + "type": "Microsoft.DocumentDB/databaseAccounts/dataTransferJobs", + "properties": { + "jobName": "j1", + "source": { + "tableName": "table", + "keyspaceName": "keyspace", + "component": "CosmosDBCassandra" + }, + "destination": { + "component": "AzureBlobStorage", + "containerName": "blob_container", + "endpointUrl": "https://blob.windows.net" + }, + "status": "Pending", + "processedCount": 20, + "totalCount": 100, + "lastUpdatedUtcTime": "2021-06-12T11:10:55.2780000Z" + } + } + } + } +}