xref: /aosp_15_r20/external/googleapis/google/cloud/backupdr/v1/backupdr.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
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
15syntax = "proto3";
16
17package google.cloud.backupdr.v1;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/api/resource.proto";
23import "google/longrunning/operations.proto";
24import "google/protobuf/empty.proto";
25import "google/protobuf/timestamp.proto";
26
27option csharp_namespace = "Google.Cloud.BackupDR.V1";
28option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb";
29option java_multiple_files = true;
30option java_outer_classname = "BackupDRProto";
31option java_package = "com.google.cloud.backupdr.v1";
32option php_namespace = "Google\\Cloud\\BackupDR\\V1";
33option ruby_package = "Google::Cloud::BackupDR::V1";
34
35// The BackupDR Service
36service BackupDR {
37  option (google.api.default_host) = "backupdr.googleapis.com";
38  option (google.api.oauth_scopes) =
39      "https://www.googleapis.com/auth/cloud-platform";
40
41  // Lists ManagementServers in a given project and location.
42  rpc ListManagementServers(ListManagementServersRequest)
43      returns (ListManagementServersResponse) {
44    option (google.api.http) = {
45      get: "/v1/{parent=projects/*/locations/*}/managementServers"
46    };
47    option (google.api.method_signature) = "parent";
48  }
49
50  // Gets details of a single ManagementServer.
51  rpc GetManagementServer(GetManagementServerRequest)
52      returns (ManagementServer) {
53    option (google.api.http) = {
54      get: "/v1/{name=projects/*/locations/*/managementServers/*}"
55    };
56    option (google.api.method_signature) = "name";
57  }
58
59  // Creates a new ManagementServer in a given project and location.
60  rpc CreateManagementServer(CreateManagementServerRequest)
61      returns (google.longrunning.Operation) {
62    option (google.api.http) = {
63      post: "/v1/{parent=projects/*/locations/*}/managementServers"
64      body: "management_server"
65    };
66    option (google.api.method_signature) =
67        "parent,management_server,management_server_id";
68    option (google.longrunning.operation_info) = {
69      response_type: "ManagementServer"
70      metadata_type: "OperationMetadata"
71    };
72  }
73
74  // Deletes a single ManagementServer.
75  rpc DeleteManagementServer(DeleteManagementServerRequest)
76      returns (google.longrunning.Operation) {
77    option (google.api.http) = {
78      delete: "/v1/{name=projects/*/locations/*/managementServers/*}"
79    };
80    option (google.api.method_signature) = "name";
81    option (google.longrunning.operation_info) = {
82      response_type: "google.protobuf.Empty"
83      metadata_type: "OperationMetadata"
84    };
85  }
86}
87
88// Network configuration for ManagementServer instance.
89message NetworkConfig {
90  // VPC peering modes supported by Cloud BackupDR.
91  enum PeeringMode {
92    // Peering mode not set.
93    PEERING_MODE_UNSPECIFIED = 0;
94
95    // Connect using Private Service Access to the Management Server. Private
96    // services access provides an IP address range for multiple Google Cloud
97    // services, including Cloud BackupDR.
98    PRIVATE_SERVICE_ACCESS = 1;
99  }
100
101  // Optional. The resource name of the Google Compute Engine VPC network to
102  // which the ManagementServer instance is connected.
103  string network = 1 [(google.api.field_behavior) = OPTIONAL];
104
105  // Optional. The network connect mode of the ManagementServer instance. For
106  // this version, only PRIVATE_SERVICE_ACCESS is supported.
107  PeeringMode peering_mode = 2 [(google.api.field_behavior) = OPTIONAL];
108}
109
110// ManagementURI for the Management Server resource.
111message ManagementURI {
112  // Output only. The ManagementServer AGM/RD WebUI URL.
113  string web_ui = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
114
115  // Output only. The ManagementServer AGM/RD API URL.
116  string api = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
117}
118
119// ManagementURI depending on the Workforce Identity i.e. either 1p or 3p.
120message WorkforceIdentityBasedManagementURI {
121  // Output only. First party Management URI for Google Identities.
122  string first_party_management_uri = 1
123      [(google.api.field_behavior) = OUTPUT_ONLY];
124
125  // Output only. Third party Management URI for External Identity Providers.
126  string third_party_management_uri = 2
127      [(google.api.field_behavior) = OUTPUT_ONLY];
128}
129
130// OAuth Client ID depending on the Workforce Identity i.e. either 1p or 3p,
131message WorkforceIdentityBasedOAuth2ClientID {
132  // Output only. First party OAuth Client ID for Google Identities.
133  string first_party_oauth2_client_id = 1
134      [(google.api.field_behavior) = OUTPUT_ONLY];
135
136  // Output only. Third party OAuth Client ID for External Identity Providers.
137  string third_party_oauth2_client_id = 2
138      [(google.api.field_behavior) = OUTPUT_ONLY];
139}
140
141// ManagementServer describes a single BackupDR ManagementServer instance.
142message ManagementServer {
143  option (google.api.resource) = {
144    type: "backupdr.googleapis.com/ManagementServer"
145    pattern: "projects/{project}/locations/{location}/managementServers/{managementserver}"
146    plural: "managementServers"
147    singular: "managementServer"
148  };
149
150  // Type of backup service resource.
151  enum InstanceType {
152    // Instance type is not mentioned.
153    INSTANCE_TYPE_UNSPECIFIED = 0;
154
155    // Instance for backup and restore management (i.e., AGM).
156    BACKUP_RESTORE = 1;
157  }
158
159  // State of Management server instance.
160  enum InstanceState {
161    // State not set.
162    INSTANCE_STATE_UNSPECIFIED = 0;
163
164    // The instance is being created.
165    CREATING = 1;
166
167    // The instance has been created and is fully usable.
168    READY = 2;
169
170    // The instance configuration is being updated. Certain kinds of updates
171    // may cause the instance to become unusable while the update is in
172    // progress.
173    UPDATING = 3;
174
175    // The instance is being deleted.
176    DELETING = 4;
177
178    // The instance is being repaired and may be unstable.
179    REPAIRING = 5;
180
181    // Maintenance is being performed on this instance.
182    MAINTENANCE = 6;
183
184    // The instance is experiencing an issue and might be unusable. You can get
185    // further details from the statusMessage field of Instance resource.
186    ERROR = 7;
187  }
188
189  // Output only. Identifier. The resource name.
190  string name = 1 [
191    (google.api.field_behavior) = OUTPUT_ONLY,
192    (google.api.field_behavior) = IDENTIFIER
193  ];
194
195  // Optional. The description of the ManagementServer instance (2048 characters
196  // or less).
197  string description = 9 [(google.api.field_behavior) = OPTIONAL];
198
199  // Optional. Resource labels to represent user provided metadata.
200  // Labels currently defined:
201  // 1. migrate_from_go=<false|true>
202  //    If set to true, the MS is created in migration ready mode.
203  map<string, string> labels = 4 [(google.api.field_behavior) = OPTIONAL];
204
205  // Output only. The time when the instance was created.
206  google.protobuf.Timestamp create_time = 2
207      [(google.api.field_behavior) = OUTPUT_ONLY];
208
209  // Output only. The time when the instance was updated.
210  google.protobuf.Timestamp update_time = 3
211      [(google.api.field_behavior) = OUTPUT_ONLY];
212
213  // Optional. The type of the ManagementServer resource.
214  InstanceType type = 14 [(google.api.field_behavior) = OPTIONAL];
215
216  // Output only. The hostname or ip address of the exposed AGM endpoints, used
217  // by clients to connect to AGM/RD graphical user interface and APIs.
218  ManagementURI management_uri = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
219
220  // Output only. The hostnames of the exposed AGM endpoints for both types of
221  // user i.e. 1p and 3p, used to connect AGM/RM UI.
222  WorkforceIdentityBasedManagementURI workforce_identity_based_management_uri =
223      16 [(google.api.field_behavior) = OUTPUT_ONLY];
224
225  // Output only. The ManagementServer state.
226  InstanceState state = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
227
228  // Required. VPC networks to which the ManagementServer instance is connected.
229  // For this version, only a single network is supported.
230  repeated NetworkConfig networks = 8 [(google.api.field_behavior) = REQUIRED];
231
232  // Optional. Server specified ETag for the ManagementServer resource to
233  // prevent simultaneous updates from overwiting each other.
234  string etag = 13 [(google.api.field_behavior) = OPTIONAL];
235
236  // Output only. The OAuth 2.0 client id is required to make API calls to the
237  // BackupDR instance API of this ManagementServer. This is the value that
238  // should be provided in the ‘aud’ field of the OIDC ID Token (see openid
239  // specification
240  // https://openid.net/specs/openid-connect-core-1_0.html#IDToken).
241  string oauth2_client_id = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
242
243  // Output only. The OAuth client IDs for both types of user i.e. 1p and 3p.
244  WorkforceIdentityBasedOAuth2ClientID
245      workforce_identity_based_oauth2_client_id = 17
246      [(google.api.field_behavior) = OUTPUT_ONLY];
247
248  // Output only. The hostname or ip address of the exposed AGM endpoints, used
249  // by BAs to connect to BA proxy.
250  repeated string ba_proxy_uri = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
251}
252
253// Request message for listing management servers.
254message ListManagementServersRequest {
255  // Required. The project and location for which to retrieve management servers
256  // information, in the format `projects/{project_id}/locations/{location}`. In
257  // Cloud BackupDR, locations map to GCP regions, for example **us-central1**.
258  // To retrieve management servers for all locations, use "-" for the
259  // `{location}` value.
260  string parent = 1 [
261    (google.api.field_behavior) = REQUIRED,
262    (google.api.resource_reference) = {
263      child_type: "backupdr.googleapis.com/ManagementServer"
264    }
265  ];
266
267  // Optional. Requested page size. Server may return fewer items than
268  // requested. If unspecified, server will pick an appropriate default.
269  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
270
271  // Optional. A token identifying a page of results the server should return.
272  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
273
274  // Optional. Filtering results.
275  optional string filter = 4 [(google.api.field_behavior) = OPTIONAL];
276
277  // Optional. Hint for how to order the results.
278  optional string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
279}
280
281// Response message for listing management servers.
282message ListManagementServersResponse {
283  // The list of ManagementServer instances in the project for the specified
284  // location.
285  //
286  // If the `{location}` value in the request is "-", the response contains a
287  // list of instances from all locations. In case any location is unreachable,
288  // the response will only return management servers in reachable locations and
289  // the 'unreachable' field will be populated with a list of unreachable
290  // locations.
291  repeated ManagementServer management_servers = 1;
292
293  // A token identifying a page of results the server should return.
294  string next_page_token = 2;
295
296  // Locations that could not be reached.
297  repeated string unreachable = 3;
298}
299
300// Request message for getting a management server instance.
301message GetManagementServerRequest {
302  // Required. Name of the management server resource name, in the format
303  // `projects/{project_id}/locations/{location}/managementServers/{resource_name}`
304  string name = 1 [
305    (google.api.field_behavior) = REQUIRED,
306    (google.api.resource_reference) = {
307      type: "backupdr.googleapis.com/ManagementServer"
308    }
309  ];
310}
311
312// Request message for creating a management server instance.
313message CreateManagementServerRequest {
314  // Required. The management server project and location in the format
315  // `projects/{project_id}/locations/{location}`. In Cloud Backup and DR
316  // locations map to GCP regions, for example **us-central1**.
317  string parent = 1 [
318    (google.api.field_behavior) = REQUIRED,
319    (google.api.resource_reference) = {
320      child_type: "backupdr.googleapis.com/ManagementServer"
321    }
322  ];
323
324  // Required. The name of the management server to create. The name must be
325  // unique for the specified project and location.
326  string management_server_id = 2 [(google.api.field_behavior) = REQUIRED];
327
328  // Required. A [management server
329  // resource][google.cloud.backupdr.v1.ManagementServer]
330  ManagementServer management_server = 3
331      [(google.api.field_behavior) = REQUIRED];
332
333  // Optional. An optional request ID to identify requests. Specify a unique
334  // request ID so that if you must retry your request, the server will know to
335  // ignore the request if it has already been completed. The server will
336  // guarantee that for at least 60 minutes since the first request.
337  //
338  // For example, consider a situation where you make an initial request and
339  // the request times out. If you make the request again with the same request
340  // ID, the server can check if original operation with the same request ID
341  // was received, and if so, will ignore the second request. This prevents
342  // clients from accidentally creating duplicate commitments.
343  //
344  // The request ID must be a valid UUID with the exception that zero UUID is
345  // not supported (00000000-0000-0000-0000-000000000000).
346  string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
347}
348
349// Request message for deleting a management server instance.
350message DeleteManagementServerRequest {
351  // Required. Name of the resource
352  string name = 1 [
353    (google.api.field_behavior) = REQUIRED,
354    (google.api.resource_reference) = {
355      type: "backupdr.googleapis.com/ManagementServer"
356    }
357  ];
358
359  // Optional. An optional request ID to identify requests. Specify a unique
360  // request ID so that if you must retry your request, the server will know to
361  // ignore the request if it has already been completed. The server will
362  // guarantee that for at least 60 minutes after the first request.
363  //
364  // For example, consider a situation where you make an initial request and
365  // the request times out. If you make the request again with the same request
366  // ID, the server can check if original operation with the same request ID
367  // was received, and if so, will ignore the second request. This prevents
368  // clients from accidentally creating duplicate commitments.
369  //
370  // The request ID must be a valid UUID with the exception that zero UUID is
371  // not supported (00000000-0000-0000-0000-000000000000).
372  string request_id = 2 [(google.api.field_behavior) = OPTIONAL];
373}
374
375// Represents the metadata of the long-running operation.
376message OperationMetadata {
377  // Output only. The time the operation was created.
378  google.protobuf.Timestamp create_time = 1
379      [(google.api.field_behavior) = OUTPUT_ONLY];
380
381  // Output only. The time the operation finished running.
382  google.protobuf.Timestamp end_time = 2
383      [(google.api.field_behavior) = OUTPUT_ONLY];
384
385  // Output only. Server-defined resource path for the target of the operation.
386  string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
387
388  // Output only. Name of the verb executed by the operation.
389  string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
390
391  // Output only. Human-readable status of the operation, if any.
392  string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
393
394  // Output only. Identifies whether the user has requested cancellation
395  // of the operation. Operations that have successfully been cancelled
396  // have [Operation.error][] value with a
397  // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
398  // `Code.CANCELLED`.
399  bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
400
401  // Output only. API version used to start the operation.
402  string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
403
404  // Output only. AdditionalInfo contains additional Info related to backup plan
405  // association resource.
406  map<string, string> additional_info = 8
407      [(google.api.field_behavior) = OUTPUT_ONLY];
408}
409