aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/yandex-cloud-api-protos/yandex/cloud/mdb/clickhouse/v1/database_service.proto
blob: 83a27b5e246b8bd6c5bbad7e8cd3a19f0d3419c3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
syntax = "proto3";

package yandex.cloud.mdb.clickhouse.v1;

import "google/api/annotations.proto";
import "yandex/cloud/api/operation.proto";
import "yandex/cloud/operation/operation.proto";
import "yandex/cloud/validation.proto";
import "yandex/cloud/mdb/clickhouse/v1/database.proto";

option go_package = "github.com/yandex-cloud/go-genproto/yandex/cloud/mdb/clickhouse/v1;clickhouse";
option java_package = "yandex.cloud.api.mdb.clickhouse.v1";

// A set of methods for managing ClickHouse Database resources.
// NOTE: these methods are available only if database management through SQL is disabled.
service DatabaseService {
  // Returns the specified ClickHouse Database resource.
  //
  // To get the list of available ClickHouse Database resources, make a [List] request.
  rpc Get (GetDatabaseRequest) returns (Database) {
    option (google.api.http) = { get: "/managed-clickhouse/v1/clusters/{cluster_id}/databases/{database_name}" };
  }

  // Retrieves the list of ClickHouse Database resources in the specified cluster.
  rpc List (ListDatabasesRequest) returns (ListDatabasesResponse) {
    option (google.api.http) = { get: "/managed-clickhouse/v1/clusters/{cluster_id}/databases" };
  }

  // Creates a new ClickHouse database in the specified cluster.
  rpc Create (CreateDatabaseRequest) returns (operation.Operation) {
    option (google.api.http) = { post: "/managed-clickhouse/v1/clusters/{cluster_id}/databases" body: "*" };
    option (yandex.cloud.api.operation) = {
      metadata: "CreateDatabaseMetadata"
      response: "Database"
    };
  }

  // Deletes the specified ClickHouse database.
  rpc Delete (DeleteDatabaseRequest) returns (operation.Operation) {
    option (google.api.http) = { delete: "/managed-clickhouse/v1/clusters/{cluster_id}/databases/{database_name}" };
    option (yandex.cloud.api.operation) = {
      metadata: "DeleteDatabaseMetadata"
      response: "google.protobuf.Empty"
    };
  }
}

message GetDatabaseRequest {
  // ID of the ClickHouse cluster that the database belongs to.
  // To get the cluster ID, use a [ClusterService.List] request.
  string cluster_id = 1 [(required) = true, (length) = "<=50"];

  // Name of the ClickHouse Database resource to return.
  // To get the name of the database, use a [DatabaseService.List] request.
  string database_name = 2 [(required) = true, (length) = "<=63", (pattern) = "[a-zA-Z0-9_-]*"];
}

message ListDatabasesRequest {
  // ID of the ClickHouse cluster to list databases in.
  // To get the cluster ID, use a [ClusterService.List] request.
  string cluster_id = 1 [(required) = true, (length) = "<=50"];

  // The maximum number of results per page to return. If the number of available
  // results is larger than [page_size], the service returns a [ListDatabasesResponse.next_page_token]
  // that can be used to get the next page of results in subsequent list requests.
  int64 page_size = 2 [(value) = "<=1000"];

  // Page token.  to get the next page of results, set [page_token] to the [ListDatabasesResponse.next_page_token]
  // returned by the previous list request.
  string page_token = 3 [(length) = "<=100"];
}

message ListDatabasesResponse {
  // List of ClickHouse databases.
  repeated Database databases = 1;

  // This token allows you to get the next page of results for list requests. If the number of results
  // is larger than [ListDatabasesRequest.page_size], use the [next_page_token] as the value
  // for the [ListDatabasesRequest.page_token] parameter in the next list request. Each subsequent
  // list request will have its own [next_page_token] to continue paging through the results.
  string next_page_token = 2;
}

message CreateDatabaseRequest {
  // ID of the ClickHouse cluster to create a database in.
  // To get the cluster ID, use a [ClusterService.List] request.
  string cluster_id = 1 [(required) = true, (length) = "<=50"];

  // Configuration of the database to create.
  DatabaseSpec database_spec = 2 [(required) = true];
}

message CreateDatabaseMetadata {
  // ID of the ClickHouse cluster where a database is being created.
  string cluster_id = 1;

  // Name of the ClickHouse database that is being created.
  string database_name = 2;
}

message DeleteDatabaseRequest {
  // ID of the ClickHouse cluster to delete a database in.
  // To get the cluster ID, use a [ClusterService.List] request.
  string cluster_id = 1 [(required) = true, (length) = "<=50"];

  // Name of the database to delete.
  // To get the name of the database, use a [DatabaseService.List] request.
  string database_name = 2 [(required) = true, (length) = "<=63", (pattern) = "[a-zA-Z0-9_-]*"];
}

message DeleteDatabaseMetadata {
  // ID of the ClickHouse cluster where a database is being deleted.
  string cluster_id = 1;

  // Name of the ClickHouse database that is being deleted.
  string database_name = 2;
}