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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
|
syntax = "proto3";
package yandex.cloud.mdb.sqlserver.v1;
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
import "yandex/cloud/api/operation.proto";
import "yandex/cloud/mdb/sqlserver/v1/database.proto";
import "yandex/cloud/operation/operation.proto";
import "yandex/cloud/validation.proto";
option go_package = "github.com/yandex-cloud/go-genproto/yandex/cloud/mdb/sqlserver/v1;sqlserver";
option java_outer_classname = "PSDS";
option java_package = "yandex.cloud.api.mdb.sqlserver.v1";
// A set of methods for managing SQL Server databases.
service DatabaseService {
// Returns the specified SQL Server database.
//
// To get the list of available SQL Server databases, make a [List] request.
rpc Get(GetDatabaseRequest) returns (Database) {
option (google.api.http) = {get: "/mdb/sqlserver/v1/clusters/{cluster_id}/databases/{database_name}"};
}
// Retrieves the list of SQL Server databases in the specified cluster.
rpc List(ListDatabasesRequest) returns (ListDatabasesResponse) {
option (google.api.http) = {get: "/mdb/sqlserver/v1/clusters/{cluster_id}/databases"};
}
// Creates a new SQL Server database in the specified cluster.
rpc Create(CreateDatabaseRequest) returns (operation.Operation) {
option (google.api.http) = {
post: "/mdb/sqlserver/v1/clusters/{cluster_id}/databases"
body: "*"
};
option (yandex.cloud.api.operation) = {
metadata: "CreateDatabaseMetadata"
response: "Database"
};
}
// Creates a new SQL Server database in the specified cluster from a backup.
rpc Restore(RestoreDatabaseRequest) returns (operation.Operation) {
option (google.api.http) = {
post: "/mdb/sqlserver/v1/clusters/{cluster_id}/databases:restore"
body: "*"
};
option (yandex.cloud.api.operation) = {
metadata: "RestoreDatabaseMetadata"
response: "Database"
};
}
//Imports a new SQL Server database from an external backup.
rpc ImportBackup(ImportDatabaseBackupRequest) returns (operation.Operation) {
option (google.api.http) = {
post: "/mdb/sqlserver/v1/clusters/{cluster_id}/databases:import"
body: "*"
};
option (yandex.cloud.api.operation) = {
metadata: "ImportDatabaseBackupMetadata"
response: "Database"
};
}
//Exports the last database backup to an external backup.
rpc ExportBackup(ExportDatabaseBackupRequest) returns (operation.Operation) {
option (google.api.http) = {
post: "/mdb/sqlserver/v1/clusters/{cluster_id}/databases/{database_name}:export"
body: "*"
};
option (yandex.cloud.api.operation) = {
metadata: "ExportDatabaseBackupMetadata"
response: "Database"
};
}
// Deletes the specified SQL Server database.
rpc Delete(DeleteDatabaseRequest) returns (operation.Operation) {
option (google.api.http) = {delete: "/mdb/sqlserver/v1/clusters/{cluster_id}/databases/{database_name}"};
option (yandex.cloud.api.operation) = {
metadata: "DeleteDatabaseMetadata"
response: "google.protobuf.Empty"
};
}
}
message GetDatabaseRequest {
// ID of the SQL Server cluster 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 SQL Server database 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 SQL Server 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) = "0-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 SQL Server databases.
repeated Database databases = 1;
// Token that 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 has its own [next_page_token] to continue paging through the results.
string next_page_token = 2;
}
message CreateDatabaseRequest {
// ID of the SQL Server 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 SQL Server cluster where the database is being created.
string cluster_id = 1;
// Name of the SQL Server database being created.
string database_name = 2;
}
message DeleteDatabaseRequest {
// ID of the SQL Server 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 SQL Server cluster where the database is being deleted.
string cluster_id = 1;
// Name of the SQL Server database being deleted.
string database_name = 2;
}
message RestoreDatabaseRequest {
reserved 5;
// ID of the SQL Server cluster to restore a database in.
//
// To get the cluster ID, use a [ClusterService.List] request.
string cluster_id = 1 [
(required) = true,
(length) = "<=50"
];
// Name of the SQL Server database that is being restored.
string database_name = 2 [(required) = true];
// Name of the database which backup is used to restore the database.
string from_database = 3 [(required) = true];
// ID of a backup to be used.
string backup_id = 4 [(required) = true];
// Timestamp which is used for Point-in-Time recovery.
google.protobuf.Timestamp time = 6 [(required) = true];
}
message RestoreDatabaseMetadata {
// ID of the SQL Server cluster where a database is being created.
string cluster_id = 1 [(required) = true];
// Name of an SQL Server database that is being created.
string database_name = 2 [(required) = true];
// Name of the database which backup is used to restore the database.
string from_database = 3 [(required) = true];
// ID of a backup to be used.
string backup_id = 4 [(required) = true];
}
message ImportDatabaseBackupRequest {
// ID of the SQL Server cluster to import a database in.
//
// To get the cluster ID, use a [ClusterService.List] request.
string cluster_id = 1 [
(required) = true,
(length) = "<=50"
];
// Name of the SQL Server database that is being imported.
string database_name = 2 [(required) = true];
// Name of object storage bucket to import backups from.
string s3_bucket = 3 [(required) = true];
// Path in object storage bucket to import backups from.
string s3_path = 4;
// List of .bak files in bucket containing database backup.
repeated string files = 5 [(required) = true];
}
message ImportDatabaseBackupMetadata {
// ID of the SQL Server cluster where a database is being imported.
string cluster_id = 1 [(required) = true];
// Name of the SQL Server database that is being imported.
string database_name = 2 [(required) = true];
// Name of object storage bucket to import backups from.
string s3_bucket = 3 [(required) = true];
// Path in object storage bucket to import backups from.
string s3_path = 4;
}
message ExportDatabaseBackupRequest {
// ID of the SQL Server cluster to export a database from.
//
// To get the cluster ID, use a [ClusterService.List] request.
string cluster_id = 1 [
(required) = true,
(length) = "<=50"
];
// Name of the SQL Server database that is being exported.
string database_name = 2 [(required) = true];
// Name of object storage bucket to export backups to.
string s3_bucket = 3 [(required) = true];
// Path in object storage bucket to export backups to.
string s3_path = 4;
// Prefix for .bak files to export.
string prefix = 5;
}
message ExportDatabaseBackupMetadata {
// ID of the SQL Server cluster where a database is being exported.
string cluster_id = 1 [(required) = true];
// Name of the SQL Server database that is being exported.
string database_name = 2 [(required) = true];
// Name of object storage bucket to export backups to.
string s3_bucket = 3 [(required) = true];
// Path in object storage bucket to export backups to.
string s3_path = 4;
}
|