Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http-service: create backup for a cluster #5354

Merged
merged 2 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cmd/http-service/examples/create-backup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"cluster_id":"tidb-cluster-123",
"backup_id":"backup-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 @@ -780,17 +780,54 @@ message CreateBackupReq {
json_schema: {
title: "CreateBackupReq"
description: "CreateBackupReq is the request for creating backup."
required: ["cluster_id"]
required: [
"cluster_id"
"backup_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 backup_id = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
description: "The unique ID of the backup for this cluster.",
example: "\"backup-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 CreateBackupResp {}
message CreateBackupResp {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
json_schema: {
title: "CreateBackupResp"
description: "CreateBackupResp is the response for creating backup."
}
};

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 CreateRestoreReq {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
Expand Down
Loading