@google-cloud/storage-control 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/LICENSE +202 -0
- package/README.md +179 -0
- package/build/protos/google/storage/control/v2/storage_control.proto +430 -0
- package/build/protos/protos.d.ts +9819 -0
- package/build/protos/protos.js +26052 -0
- package/build/protos/protos.json +2745 -0
- package/build/src/index.d.ts +11 -0
- package/build/src/index.js +28 -0
- package/build/src/index.js.map +1 -0
- package/build/src/v2/index.d.ts +1 -0
- package/build/src/v2/index.js +23 -0
- package/build/src/v2/index.js.map +1 -0
- package/build/src/v2/storage_control_client.d.ts +671 -0
- package/build/src/v2/storage_control_client.js +946 -0
- package/build/src/v2/storage_control_client.js.map +1 -0
- package/build/src/v2/storage_control_client_config.json +72 -0
- package/package.json +70 -0
@@ -0,0 +1,430 @@
|
|
1
|
+
// Copyright 2023 Google LLC
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
syntax = "proto3";
|
16
|
+
|
17
|
+
package google.storage.control.v2;
|
18
|
+
|
19
|
+
import "google/api/client.proto";
|
20
|
+
import "google/api/field_behavior.proto";
|
21
|
+
import "google/api/field_info.proto";
|
22
|
+
import "google/api/resource.proto";
|
23
|
+
import "google/api/routing.proto";
|
24
|
+
import "google/longrunning/operations.proto";
|
25
|
+
import "google/protobuf/empty.proto";
|
26
|
+
import "google/protobuf/timestamp.proto";
|
27
|
+
|
28
|
+
option csharp_namespace = "Google.Cloud.Storage.Control.V2";
|
29
|
+
option go_package = "cloud.google.com/go/storage/control/apiv2/controlpb;controlpb";
|
30
|
+
option java_multiple_files = true;
|
31
|
+
option java_outer_classname = "StorageControlProto";
|
32
|
+
option java_package = "com.google.storage.control.v2";
|
33
|
+
option php_namespace = "Google\\Cloud\\Storage\\Control\\V2";
|
34
|
+
option ruby_package = "Google::Cloud::Storage::Control::V2";
|
35
|
+
option (google.api.resource_definition) = {
|
36
|
+
type: "storage.googleapis.com/Bucket"
|
37
|
+
pattern: "projects/{project}/buckets/{bucket}"
|
38
|
+
};
|
39
|
+
|
40
|
+
// StorageControl service includes selected control plane operations.
|
41
|
+
service StorageControl {
|
42
|
+
option (google.api.default_host) = "storage.googleapis.com";
|
43
|
+
option (google.api.oauth_scopes) =
|
44
|
+
"https://www.googleapis.com/auth/cloud-platform,"
|
45
|
+
"https://www.googleapis.com/auth/cloud-platform.read-only,"
|
46
|
+
"https://www.googleapis.com/auth/devstorage.full_control,"
|
47
|
+
"https://www.googleapis.com/auth/devstorage.read_only,"
|
48
|
+
"https://www.googleapis.com/auth/devstorage.read_write";
|
49
|
+
|
50
|
+
// Creates a new folder.
|
51
|
+
rpc CreateFolder(CreateFolderRequest) returns (Folder) {
|
52
|
+
option (google.api.routing) = {
|
53
|
+
routing_parameters { field: "parent" path_template: "{bucket=**}" }
|
54
|
+
};
|
55
|
+
option (google.api.method_signature) = "parent,folder,folder_id";
|
56
|
+
}
|
57
|
+
|
58
|
+
// Permanently deletes an empty folder.
|
59
|
+
rpc DeleteFolder(DeleteFolderRequest) returns (google.protobuf.Empty) {
|
60
|
+
option (google.api.routing) = {
|
61
|
+
routing_parameters {
|
62
|
+
field: "name"
|
63
|
+
path_template: "{bucket=projects/*/buckets/*}/**"
|
64
|
+
}
|
65
|
+
};
|
66
|
+
option (google.api.method_signature) = "name";
|
67
|
+
}
|
68
|
+
|
69
|
+
// Returns metadata for the specified folder.
|
70
|
+
rpc GetFolder(GetFolderRequest) returns (Folder) {
|
71
|
+
option (google.api.routing) = {
|
72
|
+
routing_parameters {
|
73
|
+
field: "name"
|
74
|
+
path_template: "{bucket=projects/*/buckets/*}/**"
|
75
|
+
}
|
76
|
+
};
|
77
|
+
option (google.api.method_signature) = "name";
|
78
|
+
}
|
79
|
+
|
80
|
+
// Retrieves a list of folders for a given bucket.
|
81
|
+
rpc ListFolders(ListFoldersRequest) returns (ListFoldersResponse) {
|
82
|
+
option (google.api.routing) = {
|
83
|
+
routing_parameters { field: "parent" path_template: "{bucket=**}" }
|
84
|
+
};
|
85
|
+
option (google.api.method_signature) = "parent";
|
86
|
+
}
|
87
|
+
|
88
|
+
// Renames a source folder to a destination folder. During a rename, the
|
89
|
+
// source and destination folders are locked until the long running operation
|
90
|
+
// completes.
|
91
|
+
rpc RenameFolder(RenameFolderRequest) returns (google.longrunning.Operation) {
|
92
|
+
option (google.api.routing) = {
|
93
|
+
routing_parameters {
|
94
|
+
field: "name"
|
95
|
+
path_template: "{bucket=projects/*/buckets/*}/**"
|
96
|
+
}
|
97
|
+
};
|
98
|
+
option (google.api.method_signature) = "name,destination_folder_id";
|
99
|
+
option (google.longrunning.operation_info) = {
|
100
|
+
response_type: "Folder"
|
101
|
+
metadata_type: "RenameFolderMetadata"
|
102
|
+
};
|
103
|
+
}
|
104
|
+
|
105
|
+
// Returns the storage layout configuration for a given bucket.
|
106
|
+
rpc GetStorageLayout(GetStorageLayoutRequest) returns (StorageLayout) {
|
107
|
+
option (google.api.routing) = {
|
108
|
+
routing_parameters {
|
109
|
+
field: "name"
|
110
|
+
path_template: "{bucket=projects/*/buckets/*}/**"
|
111
|
+
}
|
112
|
+
};
|
113
|
+
option (google.api.method_signature) = "name";
|
114
|
+
}
|
115
|
+
}
|
116
|
+
|
117
|
+
// Contains information about a pending rename operation.
|
118
|
+
message PendingRenameInfo {
|
119
|
+
// Output only. The name of the rename operation.
|
120
|
+
string operation = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
|
121
|
+
}
|
122
|
+
|
123
|
+
// A folder.
|
124
|
+
message Folder {
|
125
|
+
option (google.api.resource) = {
|
126
|
+
type: "storage.googleapis.com/Folder"
|
127
|
+
pattern: "projects/{project}/buckets/{bucket}/folders/{folder=**}"
|
128
|
+
plural: "folders"
|
129
|
+
singular: "folder"
|
130
|
+
};
|
131
|
+
|
132
|
+
// Identifier. The name of this folder.
|
133
|
+
// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
|
134
|
+
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
|
135
|
+
|
136
|
+
// Output only. The version of the metadata for this folder. Used for
|
137
|
+
// preconditions and for detecting changes in metadata.
|
138
|
+
int64 metageneration = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
|
139
|
+
|
140
|
+
// Output only. The creation time of the folder.
|
141
|
+
google.protobuf.Timestamp create_time = 4
|
142
|
+
[(google.api.field_behavior) = OUTPUT_ONLY];
|
143
|
+
|
144
|
+
// Output only. The modification time of the folder.
|
145
|
+
google.protobuf.Timestamp update_time = 5
|
146
|
+
[(google.api.field_behavior) = OUTPUT_ONLY];
|
147
|
+
|
148
|
+
// Output only. Only present if the folder is part of an ongoing RenameFolder
|
149
|
+
// operation. Contains information which can be used to query the operation
|
150
|
+
// status. The presence of this field also indicates all write operations are
|
151
|
+
// blocked for this folder, including folder, managed folder, and object
|
152
|
+
// operations.
|
153
|
+
PendingRenameInfo pending_rename_info = 7
|
154
|
+
[(google.api.field_behavior) = OUTPUT_ONLY];
|
155
|
+
}
|
156
|
+
|
157
|
+
// Request message for GetFolder.
|
158
|
+
message GetFolderRequest {
|
159
|
+
// Required. Name of the folder.
|
160
|
+
// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
|
161
|
+
string name = 6 [
|
162
|
+
(google.api.field_behavior) = REQUIRED,
|
163
|
+
(google.api.resource_reference) = { type: "storage.googleapis.com/Folder" }
|
164
|
+
];
|
165
|
+
|
166
|
+
// Makes the operation only succeed conditional on whether the folder's
|
167
|
+
// current metageneration matches the given value.
|
168
|
+
optional int64 if_metageneration_match = 3;
|
169
|
+
|
170
|
+
// Makes the operation only succeed conditional on whether the folder's
|
171
|
+
// current metageneration does not match the given value.
|
172
|
+
optional int64 if_metageneration_not_match = 4;
|
173
|
+
|
174
|
+
// Optional. A unique identifier for this request. UUID is the recommended
|
175
|
+
// format, but other formats are still accepted.
|
176
|
+
string request_id = 5 [
|
177
|
+
(google.api.field_info).format = UUID4,
|
178
|
+
(google.api.field_behavior) = OPTIONAL
|
179
|
+
];
|
180
|
+
}
|
181
|
+
|
182
|
+
// Request message for CreateFolder.
|
183
|
+
message CreateFolderRequest {
|
184
|
+
// Required. Name of the bucket in which the folder will reside.
|
185
|
+
string parent = 1 [
|
186
|
+
(google.api.field_behavior) = REQUIRED,
|
187
|
+
(google.api.resource_reference) = {
|
188
|
+
child_type: "storage.googleapis.com/Folder"
|
189
|
+
}
|
190
|
+
];
|
191
|
+
|
192
|
+
// Required. Properties of the new folder being created.
|
193
|
+
// The bucket and name of the folder are specified in the parent and folder_id
|
194
|
+
// fields, respectively. Populating those fields in `folder` will result in an
|
195
|
+
// error.
|
196
|
+
Folder folder = 2 [(google.api.field_behavior) = REQUIRED];
|
197
|
+
|
198
|
+
// Required. The absolute path of the folder, using a single `/` as delimiter.
|
199
|
+
string folder_id = 3 [(google.api.field_behavior) = REQUIRED];
|
200
|
+
|
201
|
+
// Optional. If true, parent folder doesn't have to be present and all missing
|
202
|
+
// ancestor folders will be created atomically.
|
203
|
+
bool recursive = 4 [(google.api.field_behavior) = OPTIONAL];
|
204
|
+
|
205
|
+
// Optional. A unique identifier for this request. UUID is the recommended
|
206
|
+
// format, but other formats are still accepted. This request is only
|
207
|
+
// idempotent if a `request_id` is provided.
|
208
|
+
string request_id = 5 [
|
209
|
+
(google.api.field_info).format = UUID4,
|
210
|
+
(google.api.field_behavior) = OPTIONAL
|
211
|
+
];
|
212
|
+
}
|
213
|
+
|
214
|
+
// Request message for DeleteFolder.
|
215
|
+
message DeleteFolderRequest {
|
216
|
+
// Required. Name of the folder.
|
217
|
+
// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
|
218
|
+
string name = 6 [
|
219
|
+
(google.api.field_behavior) = REQUIRED,
|
220
|
+
(google.api.resource_reference) = { type: "storage.googleapis.com/Folder" }
|
221
|
+
];
|
222
|
+
|
223
|
+
// Makes the operation only succeed conditional on whether the folder's
|
224
|
+
// current metageneration matches the given value.
|
225
|
+
optional int64 if_metageneration_match = 3;
|
226
|
+
|
227
|
+
// Makes the operation only succeed conditional on whether the folder's
|
228
|
+
// current metageneration does not match the given value.
|
229
|
+
optional int64 if_metageneration_not_match = 4;
|
230
|
+
|
231
|
+
// Optional. A unique identifier for this request. UUID is the recommended
|
232
|
+
// format, but other formats are still accepted. This request is only
|
233
|
+
// idempotent if a `request_id` is provided.
|
234
|
+
string request_id = 5 [
|
235
|
+
(google.api.field_info).format = UUID4,
|
236
|
+
(google.api.field_behavior) = OPTIONAL
|
237
|
+
];
|
238
|
+
}
|
239
|
+
|
240
|
+
// Request message for ListFolders.
|
241
|
+
message ListFoldersRequest {
|
242
|
+
// Required. Name of the bucket in which to look for folders.
|
243
|
+
string parent = 1 [
|
244
|
+
(google.api.field_behavior) = REQUIRED,
|
245
|
+
(google.api.resource_reference) = {
|
246
|
+
child_type: "storage.googleapis.com/Folder"
|
247
|
+
}
|
248
|
+
];
|
249
|
+
|
250
|
+
// Optional. Maximum number of folders to return in a single response. The
|
251
|
+
// service will use this parameter or 1,000 items, whichever is smaller.
|
252
|
+
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
|
253
|
+
|
254
|
+
// Optional. A previously-returned page token representing part of the larger
|
255
|
+
// set of results to view.
|
256
|
+
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
|
257
|
+
|
258
|
+
// Optional. Filter results to folders whose names begin with this prefix.
|
259
|
+
// If set, the value must either be an empty string or end with a '/'.
|
260
|
+
string prefix = 4 [(google.api.field_behavior) = OPTIONAL];
|
261
|
+
|
262
|
+
// Optional. If set, returns results in a directory-like mode. The results
|
263
|
+
// will only include folders that either exactly match the above prefix, or
|
264
|
+
// are one level below the prefix. The only supported value is '/'.
|
265
|
+
string delimiter = 8 [(google.api.field_behavior) = OPTIONAL];
|
266
|
+
|
267
|
+
// Optional. Filter results to folders whose names are lexicographically equal
|
268
|
+
// to or after lexicographic_start. If lexicographic_end is also set, the
|
269
|
+
// folders listed have names between lexicographic_start (inclusive) and
|
270
|
+
// lexicographic_end (exclusive).
|
271
|
+
string lexicographic_start = 6 [(google.api.field_behavior) = OPTIONAL];
|
272
|
+
|
273
|
+
// Optional. Filter results to folders whose names are lexicographically
|
274
|
+
// before lexicographic_end. If lexicographic_start is also set, the folders
|
275
|
+
// listed have names between lexicographic_start (inclusive) and
|
276
|
+
// lexicographic_end (exclusive).
|
277
|
+
string lexicographic_end = 7 [(google.api.field_behavior) = OPTIONAL];
|
278
|
+
|
279
|
+
// Optional. A unique identifier for this request. UUID is the recommended
|
280
|
+
// format, but other formats are still accepted.
|
281
|
+
string request_id = 9 [
|
282
|
+
(google.api.field_info).format = UUID4,
|
283
|
+
(google.api.field_behavior) = OPTIONAL
|
284
|
+
];
|
285
|
+
}
|
286
|
+
|
287
|
+
// Response message for ListFolders.
|
288
|
+
message ListFoldersResponse {
|
289
|
+
// The list of child folders
|
290
|
+
repeated Folder folders = 1;
|
291
|
+
|
292
|
+
// The continuation token, used to page through large result sets. Provide
|
293
|
+
// this value in a subsequent request to return the next page of results.
|
294
|
+
string next_page_token = 2;
|
295
|
+
}
|
296
|
+
|
297
|
+
// Request message for RenameFolder.
|
298
|
+
message RenameFolderRequest {
|
299
|
+
// Required. Name of the source folder being renamed.
|
300
|
+
// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
|
301
|
+
string name = 7 [
|
302
|
+
(google.api.field_behavior) = REQUIRED,
|
303
|
+
(google.api.resource_reference) = { type: "storage.googleapis.com/Folder" }
|
304
|
+
];
|
305
|
+
|
306
|
+
// Required. The destination folder ID, e.g. `foo/bar/`.
|
307
|
+
string destination_folder_id = 8 [(google.api.field_behavior) = REQUIRED];
|
308
|
+
|
309
|
+
// Makes the operation only succeed conditional on whether the source
|
310
|
+
// folder's current metageneration matches the given value.
|
311
|
+
optional int64 if_metageneration_match = 4;
|
312
|
+
|
313
|
+
// Makes the operation only succeed conditional on whether the source
|
314
|
+
// folder's current metageneration does not match the given value.
|
315
|
+
optional int64 if_metageneration_not_match = 5;
|
316
|
+
|
317
|
+
// Optional. A unique identifier for this request. UUID is the recommended
|
318
|
+
// format, but other formats are still accepted. This request is only
|
319
|
+
// idempotent if a `request_id` is provided.
|
320
|
+
string request_id = 6 [
|
321
|
+
(google.api.field_info).format = UUID4,
|
322
|
+
(google.api.field_behavior) = OPTIONAL
|
323
|
+
];
|
324
|
+
}
|
325
|
+
|
326
|
+
// The message contains metadata that is common to all Storage Control
|
327
|
+
// long-running operations, present in its `google.longrunning.Operation`
|
328
|
+
// messages, and accessible via `metadata.common_metadata`.
|
329
|
+
message CommonLongRunningOperationMetadata {
|
330
|
+
// Output only. The time the operation was created.
|
331
|
+
google.protobuf.Timestamp create_time = 1
|
332
|
+
[(google.api.field_behavior) = OUTPUT_ONLY];
|
333
|
+
|
334
|
+
// Output only. The time the operation finished running.
|
335
|
+
google.protobuf.Timestamp end_time = 2
|
336
|
+
[(google.api.field_behavior) = OUTPUT_ONLY];
|
337
|
+
|
338
|
+
// Output only. The time the operation was last modified.
|
339
|
+
google.protobuf.Timestamp update_time = 3
|
340
|
+
[(google.api.field_behavior) = OUTPUT_ONLY];
|
341
|
+
|
342
|
+
// Output only. The type of operation invoked.
|
343
|
+
string type = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
|
344
|
+
|
345
|
+
// Output only. Identifies whether the user has requested cancellation.
|
346
|
+
bool requested_cancellation = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
|
347
|
+
|
348
|
+
// Output only. The estimated progress of the operation in percentage [0,
|
349
|
+
// 100]. The value -1 means the progress is unknown.
|
350
|
+
int32 progress_percent = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
|
351
|
+
}
|
352
|
+
|
353
|
+
// Message returned in the metadata field of the Operation resource for
|
354
|
+
// RenameFolder operations.
|
355
|
+
message RenameFolderMetadata {
|
356
|
+
// Generic metadata for the long running operation.
|
357
|
+
CommonLongRunningOperationMetadata common_metadata = 1;
|
358
|
+
|
359
|
+
// The path of the source folder.
|
360
|
+
string source_folder_id = 2;
|
361
|
+
|
362
|
+
// The path of the destination folder.
|
363
|
+
string destination_folder_id = 3;
|
364
|
+
}
|
365
|
+
|
366
|
+
// The storage layout configuration of a bucket.
|
367
|
+
message StorageLayout {
|
368
|
+
option (google.api.resource) = {
|
369
|
+
type: "storage.googleapis.com/StorageLayout"
|
370
|
+
pattern: "projects/{project}/buckets/{bucket}/storageLayout"
|
371
|
+
};
|
372
|
+
|
373
|
+
// Configuration for Custom Dual Regions. It should specify precisely two
|
374
|
+
// eligible regions within the same Multiregion. More information on regions
|
375
|
+
// may be found [https://cloud.google.com/storage/docs/locations][here].
|
376
|
+
message CustomPlacementConfig {
|
377
|
+
// List of locations to use for data placement.
|
378
|
+
repeated string data_locations = 1;
|
379
|
+
}
|
380
|
+
|
381
|
+
// Configuration for a bucket's hierarchical namespace feature.
|
382
|
+
message HierarchicalNamespace {
|
383
|
+
// Enables the hierarchical namespace feature.
|
384
|
+
bool enabled = 1;
|
385
|
+
}
|
386
|
+
|
387
|
+
// Output only. The name of the StorageLayout resource.
|
388
|
+
// Format: `projects/{project}/buckets/{bucket}/storageLayout`
|
389
|
+
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
|
390
|
+
|
391
|
+
// Output only. The location of the bucket.
|
392
|
+
string location = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
|
393
|
+
|
394
|
+
// Output only. The location type of the bucket (region, dual-region,
|
395
|
+
// multi-region, etc).
|
396
|
+
string location_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
|
397
|
+
|
398
|
+
// Output only. The data placement configuration for custom dual region. If
|
399
|
+
// there is no configuration, this is not a custom dual region bucket.
|
400
|
+
CustomPlacementConfig custom_placement_config = 4
|
401
|
+
[(google.api.field_behavior) = OUTPUT_ONLY];
|
402
|
+
|
403
|
+
// Output only. The bucket's hierarchical namespace configuration. If there is
|
404
|
+
// no configuration, the hierarchical namespace is disabled.
|
405
|
+
HierarchicalNamespace hierarchical_namespace = 5
|
406
|
+
[(google.api.field_behavior) = OUTPUT_ONLY];
|
407
|
+
}
|
408
|
+
|
409
|
+
// Request message for GetStorageLayout.
|
410
|
+
message GetStorageLayoutRequest {
|
411
|
+
// Required. The name of the StorageLayout resource.
|
412
|
+
// Format: `projects/{project}/buckets/{bucket}/storageLayout`
|
413
|
+
string name = 1 [
|
414
|
+
(google.api.field_behavior) = REQUIRED,
|
415
|
+
(google.api.resource_reference) = {
|
416
|
+
type: "storage.googleapis.com/StorageLayout"
|
417
|
+
}
|
418
|
+
];
|
419
|
+
|
420
|
+
// An optional prefix used for permission check. It is useful when the caller
|
421
|
+
// only has limited permissions under a specific prefix.
|
422
|
+
string prefix = 2;
|
423
|
+
|
424
|
+
// Optional. A unique identifier for this request. UUID is the recommended
|
425
|
+
// format, but other formats are still accepted.
|
426
|
+
string request_id = 3 [
|
427
|
+
(google.api.field_info).format = UUID4,
|
428
|
+
(google.api.field_behavior) = OPTIONAL
|
429
|
+
];
|
430
|
+
}
|