Skip to content

Commit ccc331d

Browse files
fix yc_public
1 parent f59a578 commit ccc331d

20 files changed

+1273
-13
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
syntax = "proto3";
2+
3+
package yandex.cloud.access;
4+
5+
import "ydb/public/api/client/yc_public/common/validation.proto";
6+
7+
option go_package = "github.com/ydb-platform/ydb/ydb/public/api/client/yc_public/access;access";
8+
option java_package = "yandex.cloud.api.access";
9+
10+
message Subject {
11+
// ID of the subject.
12+
//
13+
// It can contain one of the following values:
14+
// * `allAuthenticatedUsers`: A special system identifier that represents anyone
15+
// who is authenticated. It can be used only if the [type] is `system`.
16+
// * `allUsers`: A special system identifier that represents anyone. No authentication is required.
17+
// For example, you don't need to specify the IAM token in an API query.
18+
// * `<cloud generated id>`: An identifier that represents a user account.
19+
// It can be used only if the [type] is `userAccount`, `federatedUser` or `serviceAccount`.
20+
string id = 1 [(required) = true, (length) = "<=50"];
21+
22+
// Type of the subject.
23+
//
24+
// It can contain one of the following values:
25+
// * `userAccount`: An account on Yandex or Yandex Connect, added to Yandex Cloud.
26+
// * `serviceAccount`: A service account. This type represents the [yandex.cloud.iam.v1.ServiceAccount] resource.
27+
// * `federatedUser`: A federated account. This type represents a user from an identity federation, like Active Directory.
28+
// * `system`: System group. This type represents several accounts with a common system identifier.
29+
//
30+
// For more information, see [Subject to which the role is assigned](/docs/iam/concepts/access-control/#subject).
31+
string type = 2 [(required) = true, (length) = "<=100"];
32+
}
33+
34+
message AccessBinding {
35+
// ID of the [yandex.cloud.iam.v1.Role] that is assigned to the [subject].
36+
string role_id = 1 [(required) = true, (length) = "<=50"];
37+
38+
// Identity for which access binding is being created.
39+
// It can represent an account with a unique ID or several accounts with a system identifier.
40+
Subject subject = 2 [(required) = true];
41+
}
42+
43+
message ListAccessBindingsRequest {
44+
// ID of the resource to list access bindings for.
45+
//
46+
// To get the resource ID, use a corresponding List request.
47+
// For example, use the [yandex.cloud.resourcemanager.v1.CloudService.List] request to get the Cloud resource ID.
48+
string resource_id = 1 [(required) = true, (length) = "<=50"];
49+
50+
// The maximum number of results per page that should be returned. If the number of available
51+
// results is larger than [page_size],
52+
// the service returns a [ListAccessBindingsResponse.next_page_token]
53+
// that can be used to get the next page of results in subsequent list requests.
54+
// Default value: 100.
55+
int64 page_size = 2 [(value) = "<=1000"];
56+
57+
// Page token. Set [page_token]
58+
// to the [ListAccessBindingsResponse.next_page_token]
59+
// returned by a previous list request to get the next page of results.
60+
string page_token = 3 [(length) = "<=100"];
61+
}
62+
63+
message ListAccessBindingsResponse {
64+
// List of access bindings for the specified resource.
65+
repeated AccessBinding access_bindings = 1;
66+
67+
// This token allows you to get the next page of results for list requests. If the number of results
68+
// is larger than [ListAccessBindingsRequest.page_size], use
69+
// the [next_page_token] as the value
70+
// for the [ListAccessBindingsRequest.page_token] query parameter
71+
// in the next list request. Each subsequent list request will have its own
72+
// [next_page_token] to continue paging through the results.
73+
string next_page_token = 2;
74+
}
75+
76+
message SetAccessBindingsRequest {
77+
// ID of the resource for which access bindings are being set.
78+
//
79+
// To get the resource ID, use a corresponding List request.
80+
string resource_id = 1 [(required) = true, (length) = "<=50"];
81+
82+
// Access bindings to be set. For more information, see [Access Bindings](/docs/iam/concepts/access-control/#access-bindings).
83+
repeated AccessBinding access_bindings = 2 [(size) = "<=1000"];
84+
}
85+
86+
message SetAccessBindingsMetadata {
87+
// ID of the resource for which access bindings are being set.
88+
string resource_id = 1;
89+
}
90+
91+
message UpdateAccessBindingsRequest {
92+
// ID of the resource for which access bindings are being updated.
93+
string resource_id = 1 [(required) = true, (length) = "<=50"];
94+
95+
// Updates to access bindings.
96+
repeated AccessBindingDelta access_binding_deltas = 2 [(size) = "1-1000"];
97+
}
98+
99+
message UpdateAccessBindingsMetadata {
100+
// ID of the resource for which access bindings are being updated.
101+
string resource_id = 1;
102+
}
103+
104+
enum AccessBindingAction {
105+
ACCESS_BINDING_ACTION_UNSPECIFIED = 0;
106+
107+
// Addition of an access binding.
108+
ADD = 1;
109+
110+
// Removal of an access binding.
111+
REMOVE = 2;
112+
}
113+
114+
message AccessBindingDelta {
115+
// The action that is being performed on an access binding.
116+
AccessBindingAction action = 1 [(required) = true];
117+
118+
// Access binding. For more information, see [Access Bindings](/docs/iam/concepts/access-control/#access-bindings).
119+
AccessBinding access_binding = 2 [(required) = true];
120+
}
121+
122+
message AccessBindingsOperationResult {
123+
// Result access binding deltas.
124+
repeated AccessBindingDelta effective_deltas = 1;
125+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
PROTO_LIBRARY()
2+
3+
EXCLUDE_TAGS(GO_PROTO)
4+
5+
GRPC()
6+
SRCS(
7+
access.proto
8+
)
9+
10+
USE_COMMON_GOOGLE_APIS(
11+
api/annotations
12+
rpc/code
13+
rpc/errdetails
14+
rpc/status
15+
type/timeofday
16+
type/dayofweek
17+
)
18+
19+
PEERDIR(
20+
ydb/public/api/client/yc_public/common
21+
)
22+
END()
23+

ydb/public/api/client/yc_public/events/backup.proto

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ syntax = "proto3";
33
package yandex.cloud.events.ydb;
44

55
import "google/protobuf/timestamp.proto";
6-
import "yandex/cloud/ydb/backup.proto";
7-
import "yandex/cloud/events/common.proto";
8-
import "yandex/cloud/validation.proto";
9-
import "yandex/cloud/events/options.proto";
6+
import "ydb/public/api/client/yc_public/ydb/backup.proto";
7+
import "ydb/public/api/client/yc_public/events/common.proto";
8+
import "ydb/public/api/client/yc_public/common/validation.proto";
9+
import "ydb/public/api/client/yc_public/events/options.proto";
1010
import "google/rpc/status.proto";
1111

12-
option go_package = "a.yandex-team.ru/cloud/bitbucket/public-api/yandex/cloud/events/ydb;ydb";
12+
option go_package = "github.com/ydb-platform/ydb/ydb/public/api/client/yc_public/events/ydb;ydb";
1313
option java_package = "yandex.cloud.api.events.ydb";
1414

1515
message DeleteBackup {

ydb/public/api/client/yc_public/events/database.proto

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ syntax = "proto3";
33
package yandex.cloud.events.ydb;
44

55
import "google/protobuf/timestamp.proto";
6-
import "yandex/cloud/events/common.proto";
7-
import "yandex/cloud/validation.proto";
8-
import "yandex/cloud/ydb/database.proto";
9-
import "yandex/cloud/ydb/backup.proto";
10-
import "yandex/cloud/events/options.proto";
6+
import "ydb/public/api/client/yc_public/events/common.proto";
7+
import "ydb/public/api/client/yc_public/common/validation.proto";
8+
import "ydb/public/api/client/yc_public/ydb/database.proto";
9+
import "ydb/public/api/client/yc_public/ydb/backup.proto";
10+
import "ydb/public/api/client/yc_public/events/options.proto";
1111
import "google/rpc/status.proto";
1212
import "google/protobuf/field_mask.proto";
1313

1414

15-
option go_package = "a.yandex-team.ru/cloud/bitbucket/public-api/yandex/cloud/events/ydb;ydb";
15+
option go_package = "github.com/ydb-platform/ydb/ydb/public/api/client/yc_public/events/ydb;ydb";
1616
option java_package = "yandex.cloud.api.events.ydb";
1717

1818
message CreateDatabase {

ydb/public/api/client/yc_public/iam/iam_token_service.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import "google/api/annotations.proto";
66
import "google/protobuf/timestamp.proto";
77
import "ydb/public/api/client/yc_public/common/validation.proto";
88

9-
option go_package = "github.com/yandex-cloud/go-genproto/yandex/cloud/iam/v1;iam";
9+
option go_package = "github.com/yandex-cloud/go-genproto/ydb/public/api/client/yc_public/iam/v1;iam";
1010
option java_package = "yandex.cloud.api.iam.v1";
1111

1212
// A set of methods for managing IAM tokens.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
syntax = "proto3";
2+
3+
package yandex.cloud.operation;
4+
5+
import "google/protobuf/any.proto";
6+
import "google/rpc/status.proto";
7+
import "google/protobuf/timestamp.proto";
8+
9+
10+
option go_package = "github.com/ydb-platform/ydb/ydb/public/api/client/yc_public/operation;operation";
11+
option java_package = "yandex.cloud.api.operation";
12+
13+
// An Operation resource. For more information, see [Operation](/docs/api-design-guide/concepts/operation).
14+
message Operation {
15+
// ID of the operation.
16+
string id = 1;
17+
18+
// Description of the operation. 0-256 characters long.
19+
string description = 2; // ex: Create VM, Stop VM, Delete Disk, Snapshot Disk, etc
20+
21+
// Creation timestamp.
22+
google.protobuf.Timestamp created_at = 3;
23+
24+
// ID of the user or service account who initiated the operation.
25+
string created_by = 4;
26+
27+
// The time when the Operation resource was last modified.
28+
google.protobuf.Timestamp modified_at = 5;
29+
30+
// If the value is `false`, it means the operation is still in progress.
31+
// If `true`, the operation is completed, and either `error` or `response` is available.
32+
bool done = 6;
33+
34+
// Service-specific metadata associated with the operation.
35+
// It typically contains the ID of the target resource that the operation is performed on.
36+
// Any method that returns a long-running operation should document the metadata type, if any.
37+
google.protobuf.Any metadata = 7;
38+
39+
// The operation result.
40+
// If `done == false` and there was no failure detected, neither `error` nor `response` is set.
41+
// If `done == false` and there was a failure detected, `error` is set.
42+
// If `done == true`, exactly one of `error` or `response` is set.
43+
oneof result {
44+
// The error result of the operation in case of failure or cancellation.
45+
google.rpc.Status error = 8;
46+
47+
// The normal response of the operation in case of success.
48+
// If the original method returns no data on success, such as Delete,
49+
// the response is [google.protobuf.Empty].
50+
// If the original method is the standard Create/Update,
51+
// the response should be the target resource of the operation.
52+
// Any method that returns a long-running operation should document the response type, if any.
53+
google.protobuf.Any response = 9;
54+
}
55+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
syntax = "proto3";
2+
3+
package yandex.cloud.operation;
4+
5+
import "google/api/annotations.proto";
6+
import "ydb/public/api/client/yc_public/api/tools/options.proto";
7+
import "ydb/public/api/client/yc_public/operation/operation.proto";
8+
import "ydb/public/api/client/yc_public/common/validation.proto";
9+
10+
option go_package = "github.com/ydb-platform/ydb/ydb/public/api/client/yc_public/operation;operation";
11+
option java_package = "yandex.cloud.api.operation";
12+
13+
// A set of methods for managing operations for asynchronous API requests.
14+
service OperationService {
15+
// Returns the specified Operation resource.
16+
rpc Get (GetOperationRequest) returns (Operation) {
17+
option (google.api.http) = { get: "/operations/{operation_id}" };
18+
}
19+
20+
// Cancels the specified operation.
21+
//
22+
// Note that currently Object Storage API does not support cancelling operations.
23+
rpc Cancel (CancelOperationRequest) returns (Operation) {
24+
option (google.api.http) = { get: "/operations/{operation_id}:cancel" };
25+
option (yandex.cloud.api.tools.method).lint_skip.http_verb = true;
26+
}
27+
}
28+
29+
message GetOperationRequest {
30+
// ID of the Operation resource to return.
31+
string operation_id = 1 [(required) = true];
32+
}
33+
34+
message CancelOperationRequest {
35+
// ID of the operation to cancel.
36+
string operation_id = 1 [(required) = true];
37+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
PROTO_LIBRARY()
2+
3+
EXCLUDE_TAGS(GO_PROTO)
4+
5+
GRPC()
6+
SRCS(
7+
operation.proto
8+
operation_service.proto
9+
)
10+
11+
USE_COMMON_GOOGLE_APIS(
12+
api/annotations
13+
rpc/code
14+
rpc/errdetails
15+
rpc/status
16+
type/timeofday
17+
type/dayofweek
18+
)
19+
20+
PEERDIR(
21+
ydb/public/api/client/yc_common/api/tools
22+
ydb/public/api/client/yc_public/common
23+
)
24+
END()
25+
+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
RECURSE(
2+
access
3+
common
24
iam
35
events
46
logging
5-
common
7+
operation
8+
ydb
69
)
710

0 commit comments

Comments
 (0)