aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/yandex-cloud-api-protos/yandex/cloud/mdb/mysql/v1/user_service.proto
blob: 5422357cbef951fb3d8204d566d63e7abe74ac7b (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
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
syntax = "proto3";

package yandex.cloud.mdb.mysql.v1;

import "google/api/annotations.proto";
import "google/protobuf/field_mask.proto";
import "yandex/cloud/api/operation.proto";
import "yandex/cloud/operation/operation.proto";
import "yandex/cloud/validation.proto";
import "yandex/cloud/mdb/mysql/v1/user.proto";

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

// A set of methods for managing MySQL users.
//
// See [the documentation](/docs/managed-mysql/operations/cluster-users) for details.
service UserService {

  // Retrieves information about the specified user.
  rpc Get (GetUserRequest) returns (User) {
    option (google.api.http) = { get: "/managed-mysql/v1/clusters/{cluster_id}/users/{user_name}" };
  }

  // Retrieves the list of users in a cluster.
  rpc List (ListUsersRequest) returns (ListUsersResponse) {
    option (google.api.http) = { get: "/managed-mysql/v1/clusters/{cluster_id}/users" };
  }

  // Creates a user in a cluster.
  rpc Create (CreateUserRequest) returns (operation.Operation) {
    option (google.api.http) = { post: "/managed-mysql/v1/clusters/{cluster_id}/users" body: "*" };
    option (yandex.cloud.api.operation) = {
      metadata: "CreateUserMetadata"
      response: "User"
    };
  }

  // Updates a user in a cluster.
  rpc Update (UpdateUserRequest) returns (operation.Operation) {
    option (google.api.http) = { patch: "/managed-mysql/v1/clusters/{cluster_id}/users/{user_name}" body: "*" };
    option (yandex.cloud.api.operation) = {
      metadata: "UpdateUserMetadata"
      response: "User"
    };
  }

  // Deletes a user in a cluster.
  rpc Delete (DeleteUserRequest) returns (operation.Operation) {
    option (google.api.http) = { delete: "/managed-mysql/v1/clusters/{cluster_id}/users/{user_name}" };
    option (yandex.cloud.api.operation) = {
      metadata: "DeleteUserMetadata"
      response: "google.protobuf.Empty"
    };
  }

  // Grants permission to access a database to a user in a cluster.
  rpc GrantPermission (GrantUserPermissionRequest) returns (operation.Operation) {
    option (google.api.http) = { post: "/managed-mysql/v1/clusters/{cluster_id}/users/{user_name}:grantPermission" body: "*" };
    option (yandex.cloud.api.operation) = {
      metadata: "GrantUserPermissionMetadata"
      response: "User"
    };
  }

  // Revokes permission to access a database from a user in a cluster.
  rpc RevokePermission (RevokeUserPermissionRequest) returns (operation.Operation) {
    option (google.api.http) = { post: "/managed-mysql/v1/clusters/{cluster_id}/users/{user_name}:revokePermission" body: "*" };
    option (yandex.cloud.api.operation) = {
      metadata: "RevokeUserPermissionMetadata"
      response: "User"
    };
  }
}

message GetUserRequest {

  // ID of the cluster the user belongs to.
  //
  // To get this ID, make a [ClusterService.List] request.
  string cluster_id = 1 [(required) = true, (length) = "<=50"];

  // Name of the user to return information about.
  //
  // To get this name, make a [UserService.List] request.
  string user_name = 2 [(required) = true, (length) = "<=63", (pattern) = "[a-zA-Z0-9_-]*"];
}

message ListUsersRequest {

  // ID of the cluster to list the users in.
  //
  // To get this ID, make 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 API returns a [ListUsersResponse.next_page_token] that can be used to get the next page of results in the subsequent [UserService.List] requests.
  int64 page_size = 2 [(value) = "0-1000"];

  // Page token that can be used to iterate through multiple pages of results.
  //
  // To get the next page of results, set [page_token] to the [ListUsersResponse.next_page_token] returned by the previous [UserService.List] request.
  string page_token = 3 [(length) = "<=100"];
}

message ListUsersResponse {

  // List of users.
  repeated User users = 1;

  // The token that can be used to get the next page of results.
  //
  // If the number of results is larger than [ListUsersRequest.page_size], use the [next_page_token] as the value for the [ListUsersRequest.page_token] in the subsequent [UserService.List] request to iterate through multiple pages of results.
  //
  // Each of the subsequent [UserService.List] requests should use the [next_page_token] value returned by the previous request to continue paging through the results.
  string next_page_token = 2;
}

message CreateUserRequest {

  // ID of the cluster to create the user in.
  //
  // To get this ID, make a [ClusterService.List] request.
  string cluster_id = 1 [(required) = true, (length) = "<=50"];

  // Configuration of the user.
  UserSpec user_spec = 2 [(required) = true];
}

message CreateUserMetadata {

  // ID of the cluster the user is being created in.
  string cluster_id = 1;

  // Name of the user that is being created.
  string user_name = 2;
}

message UpdateUserRequest {

  // ID of the cluster to update the user in.
  //
  // To get this ID, make a [ClusterService.List] request.
  string cluster_id = 1 [(required) = true, (length) = "<=50"];

  // Name of the user to update.
  //
  // To get this name, make a [UserService.List] request.
  string user_name = 2 [(required) = true, (length) = "<=63", (pattern) = "[a-zA-Z0-9_-]*"];

  // Field mask that specifies which settings of the user should be updated.
  google.protobuf.FieldMask update_mask = 3;

  // New password for the user.
  string password = 4 [(length) = "8-128"];

  // A new set of permissions that should be granted to the user.
  repeated Permission permissions = 5;

  // New set of global permissions to grant to the user.
  repeated GlobalPermission global_permissions = 6;

  // Set of changed user connection limits.
  ConnectionLimits connection_limits = 7;

  // New user authentication plugin.
  AuthPlugin authentication_plugin = 8;
}

message UpdateUserMetadata {

  // ID of the cluster the user is being updated in.
  string cluster_id = 1;

  // Name of the user that is being updated.
  string user_name = 2;
}

message DeleteUserRequest {

  // ID of the cluster to delete the user from.
  //
  // To get this ID, make a [ClusterService.List] request.
  string cluster_id = 1 [(required) = true, (length) = "<=50"];

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

message DeleteUserMetadata {

  // ID of the cluster the user is being deleted from.
  string cluster_id = 1;

  // Name of the user that is being deleted.
  string user_name = 2;
}

message GrantUserPermissionRequest {

  // ID of the cluster to grant permission to the user in.
  //
  // To get this ID, make a [ClusterService.List] request.
  string cluster_id = 1 [(required) = true, (length) = "<=50"];

  // Name of the user to grant permission to.
  //
  // To get this name, make a [UserService.List] request.
  string user_name = 2 [(required) = true, (length) = "<=63", (pattern) = "[a-zA-Z0-9_-]*"];

  // Permission that should be granted to the specified user.
  Permission permission = 3 [(required) = true];
}

message GrantUserPermissionMetadata {

  // ID of the cluster the user is being granted a permission in.
  string cluster_id = 1;

  // Name of the user that is being granted a permission.
  string user_name = 2;
}

message RevokeUserPermissionRequest {

  // ID of the cluster to revoke permission from the user in.
  //
  // To get this ID, make a [ClusterService.List] request.
  string cluster_id = 1 [(required) = true, (length) = "<=50"];

  // Name of the user to revoke permission from.
  //
  // To get this name, make a [UserService.List] request.
  string user_name = 2 [(required) = true, (length) = "<=63", (pattern) = "[a-zA-Z0-9_-]*"];

  // Permission that should be revoked from the user.
  Permission permission = 3 [(required) = true];
}

message RevokeUserPermissionMetadata {

  // ID of the cluster the user is being revoked a permission in.
  string cluster_id = 1;

  // Name of the user whose permission is being revoked.
  string user_name = 2;
}