forked from apigee/registry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_service.proto
238 lines (209 loc) · 8.39 KB
/
admin_service.proto
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
// Copyright 2021 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.apigeeregistry.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/apigeeregistry/v1/admin_models.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
option java_package = "com.google.cloud.apigeeregistry.v1";
option java_multiple_files = true;
option java_outer_classname = "AdminServiceProto";
option go_package = "github.com/apigee/registry/rpc;rpc";
// The Admin service supports setup and operation of an API registry.
// It is typically not included in hosted versions of the API.
service Admin {
option (google.api.default_host) = "apigeeregistry.googleapis.com";
// GetStatus returns the status of the service.
// (-- api-linter: core::0131::request-message-name=disabled
// aip.dev/not-precedent: Not in the official API. --)
// (-- api-linter: core::0131::method-signature=disabled
// aip.dev/not-precedent: Not in the official API. --)
// (-- api-linter: core::0131::http-uri-name=disabled
// aip.dev/not-precedent: Not in the official API. --)
rpc GetStatus(protobuf.Empty) returns (Status) {
option (google.api.http) = {
get: "/v1/status"
};
}
// GetStorage returns information about the storage used by the service.
// (-- api-linter: core::0131::request-message-name=disabled
// aip.dev/not-precedent: Not in the official API. --)
// (-- api-linter: core::0131::method-signature=disabled
// aip.dev/not-precedent: Not in the official API. --)
// (-- api-linter: core::0131::http-uri-name=disabled
// aip.dev/not-precedent: Not in the official API. --)
rpc GetStorage(protobuf.Empty) returns (Storage) {
option (google.api.http) = {
get: "/v1/storage"
};
}
// MigrateDatabase attempts to migrate the database to the current schema.
rpc MigrateDatabase(MigrateDatabaseRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/migrateDatabase"
};
option (google.longrunning.operation_info) = {
response_type : "MigrateDatabaseResponse",
metadata_type : "MigrateDatabaseMetadata"
};
}
// ListProjects returns matching projects.
// (-- api-linter: standard-methods=disabled --)
// (-- api-linter: core::0132::method-signature=disabled
// aip.dev/not-precedent: projects are top-level resources. --)
rpc ListProjects(ListProjectsRequest) returns (ListProjectsResponse) {
option (google.api.http) = {
get: "/v1/projects"
};
}
// GetProject returns a specified project.
rpc GetProject(GetProjectRequest) returns (Project) {
option (google.api.http) = {
get: "/v1/{name=projects/*}"
};
option (google.api.method_signature) = "name";
}
// CreateProject creates a specified project.
// (-- api-linter: standard-methods=disabled --)
// (-- api-linter: core::0133::http-uri-parent=disabled
// aip.dev/not-precedent: Project has an implicit parent. --)
// (-- api-linter: core::0133::method-signature=disabled
// aip.dev/not-precedent: Project has an implicit parent. --)
rpc CreateProject(CreateProjectRequest) returns (Project) {
option (google.api.http) = {
post: "/v1/projects"
body: "project"
};
option (google.api.method_signature) = "project,project_id";
}
// UpdateProject can be used to modify a specified project.
rpc UpdateProject(UpdateProjectRequest) returns (Project) {
option (google.api.http) = {
patch: "/v1/{project.name=projects/*}"
body: "project"
};
option (google.api.method_signature) = "project,update_mask";
}
// DeleteProject removes a specified project and all of the resources that it
// owns.
rpc DeleteProject(DeleteProjectRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/{name=projects/*}"
};
option (google.api.method_signature) = "name";
}
}
// Request message for MigrateDatabase.
message MigrateDatabaseRequest {
// A string describing the kind of migration to perform.
// Currently only "auto" is recognized (and is the default if omitted).
string kind = 1;
}
// Metadata message for MigrateDatabase.
message MigrateDatabaseMetadata {
}
// Response message for MigrateDatabase.
message MigrateDatabaseResponse {
// A string describing the result of the migration.
string message = 1;
}
// Request message for ListProjects.
// (-- api-linter: core::0132::request-parent-required=disabled
// aip.dev/not-precedent: the parent of Project is implicit. --)
message ListProjectsRequest {
// The maximum number of projects to return.
// The service may return fewer than this value.
// If unspecified, at most 50 values will be returned.
// The maximum is 1000; values above 1000 will be coerced to 1000.
int32 page_size = 1;
// A page token, received from a previous `ListProjects` call.
// Provide this to retrieve the subsequent page.
//
// When paginating, all other parameters provided to `ListProjects` must match
// the call that provided the page token.
string page_token = 2;
// An expression that can be used to filter the list. Filters use the Common
// Expression Language and can refer to all message fields.
string filter = 3;
// A comma-separated list of fields, e.g. "foo,bar"
// Fields can be sorted in descending order using the "desc" identifier, e.g. "foo desc,bar"
string order_by = 4;
}
// Response message for ListProjects.
message ListProjectsResponse {
// The projects from the specified publisher.
repeated Project projects = 1;
// A token, which can be sent as `page_token` to retrieve the next page.
// If this field is omitted, there are no subsequent pages.
string next_page_token = 2;
}
// Request message for GetProject.
message GetProjectRequest {
// The name of the project to retrieve.
// Format: projects/*
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "apigeeregistry.googleapis.com/Project"
}
];
}
// Request message for CreateProject.
// (-- api-linter: core::0133::request-parent-required=disabled
// aip.dev/not-precedent: the parent of Project is implicit. --)
message CreateProjectRequest {
// The project to create.
Project project = 1 [(google.api.field_behavior) = REQUIRED];
// The ID to use for the project, which will become the final component of
// the project's resource name.
//
// This value should be at most 80 characters, and valid characters
// are /[a-z][0-9]-./.
string project_id = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request message for UpdateProject.
message UpdateProjectRequest {
// The project to update.
//
// The `name` field is used to identify the project to update.
// Format: projects/*
Project project = 1 [(google.api.field_behavior) = REQUIRED];
// The list of fields to be updated. If omitted, all fields are updated that
// are set in the request message (fields set to default values are ignored).
// If a "*" is specified, all fields are updated, including fields that are
// unspecified/default in the request.
google.protobuf.FieldMask update_mask = 2;
// If set to true, and the project is not found, a new project will be created.
// In this situation, `update_mask` is ignored.
bool allow_missing = 3;
}
// Request message for DeleteProject.
message DeleteProjectRequest {
// The name of the project to delete.
// Format: projects/*
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "apigeeregistry.googleapis.com/Project"
}
];
// If set to true, any child resources will also be deleted.
// (Otherwise, the request will only work if there are no child resources.)
bool force = 2;
}