Skip to content

Commit

Permalink
http-service: create restore for a cluster (#5356)
Browse files Browse the repository at this point in the history
  • Loading branch information
csuzhangxc authored Oct 24, 2023
1 parent 91fbecb commit bc2eedd
Show file tree
Hide file tree
Showing 5 changed files with 558 additions and 234 deletions.
9 changes: 9 additions & 0 deletions cmd/http-service/examples/create-restore.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"cluster_id":"tidb-cluster-123",
"restore_id":"restore-123",
"access_key":"access_key",
"secret_key":"secret_key",
"endpoint":"https://s3.compatible.com",
"bucket":"tidb-backup",
"prefix":"prefix-to-backup"
}
41 changes: 39 additions & 2 deletions cmd/http-service/idl/api/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -834,17 +834,54 @@ message CreateRestoreReq {
json_schema: {
title: "CreateRestoreReq"
description: "CreateRestoreReq is the request for creating restore."
required: ["cluster_id"]
required: [
"cluster_id"
"restore_id"
]
}
};

string cluster_id = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
description: "The unique ID or name of the cluster.",
example: "\"tidb-clsuter-123\""
}];
string restore_id = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
description: "The unique ID of the restore for this cluster.",
example: "\"restore-123\""
}];
string access_key = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
description: "The access key of the backup storage.",
example: "\"access-key-123\""
}];
string secret_key = 4 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "The secret key of the backup storage."}];
optional string endpoint = 5 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
description: "The endpoint of the backup storage.",
example: "\"https://s3.compatible.com\""
}];
string bucket = 6 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
description: "The bucket of the backup storage.",
example: "\"backup-bucket-123\""
}];
string prefix = 7 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
description: "The prefix of the backup storage.",
example: "\"path-prefix-to-backup\""
}];
}

message CreateRestoreResp {}
message CreateRestoreResp {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
json_schema: {
title: "CreateRestoreResp"
description: "CreateRestoreResp is the response for creating restore."
}
};

bool success = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
description: "Whether the request is successful.",
example: "true"
}];
optional string message = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "The message of the response."}];
}

message GetBackupReq {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
Expand Down
Loading

0 comments on commit bc2eedd

Please sign in to comment.