xref: /aosp_15_r20/external/googleapis/google/cloud/networkconnectivity/v1alpha1/hub.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2020 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.networkconnectivity.v1alpha1;
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/field_mask.proto";
25import "google/protobuf/timestamp.proto";
26
27option csharp_namespace = "Google.Cloud.NetworkConnectivity.V1Alpha1";
28option go_package = "cloud.google.com/go/networkconnectivity/apiv1alpha1/networkconnectivitypb;networkconnectivitypb";
29option java_multiple_files = true;
30option java_outer_classname = "HubProto";
31option java_package = "com.google.cloud.networkconnectivity.v1alpha1";
32option php_namespace = "Google\\Cloud\\NetworkConnectivity\\V1alpha1";
33option ruby_package = "Google::Cloud::NetworkConnectivity::V1alpha1";
34option (google.api.resource_definition) = {
35  type: "compute.googleapis.com/VpnTunnel"
36  pattern: "projects/{project}/regions/{region}/vpnTunnels/{resource_id}"
37};
38option (google.api.resource_definition) = {
39  type: "compute.googleapis.com/InterconnectAttachment"
40  pattern: "projects/{project}/regions/{region}/interconnectAttachments/{resource_id}"
41};
42option (google.api.resource_definition) = {
43  type: "compute.googleapis.com/Instance"
44  pattern: "projects/{project}/zones/{zone}/instances/{instance}"
45};
46
47// Network Connectivity Center is a hub-and-spoke abstraction for
48// network connectivity management in Google Cloud. It reduces
49// operational complexity through a simple, centralized connectivity management
50// model.
51service HubService {
52  option (google.api.default_host) = "networkconnectivity.googleapis.com";
53  option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
54
55  // Lists Hubs in a given project and location.
56  rpc ListHubs(ListHubsRequest) returns (ListHubsResponse) {
57    option (google.api.http) = {
58      get: "/v1alpha1/{parent=projects/*/locations/global}/hubs"
59    };
60    option (google.api.method_signature) = "parent";
61  }
62
63  // Gets details of a single Hub.
64  rpc GetHub(GetHubRequest) returns (Hub) {
65    option (google.api.http) = {
66      get: "/v1alpha1/{name=projects/*/locations/global/hubs/*}"
67    };
68    option (google.api.method_signature) = "name";
69  }
70
71  // Creates a new Hub in a given project and location.
72  rpc CreateHub(CreateHubRequest) returns (google.longrunning.Operation) {
73    option (google.api.http) = {
74      post: "/v1alpha1/{parent=projects/*/locations/global}/hubs"
75      body: "hub"
76    };
77    option (google.api.method_signature) = "parent,hub,hub_id";
78    option (google.longrunning.operation_info) = {
79      response_type: "Hub"
80      metadata_type: "OperationMetadata"
81    };
82  }
83
84  // Updates the parameters of a single Hub.
85  rpc UpdateHub(UpdateHubRequest) returns (google.longrunning.Operation) {
86    option (google.api.http) = {
87      patch: "/v1alpha1/{hub.name=projects/*/locations/global/hubs/*}"
88      body: "hub"
89    };
90    option (google.api.method_signature) = "hub,update_mask";
91    option (google.longrunning.operation_info) = {
92      response_type: "Hub"
93      metadata_type: "OperationMetadata"
94    };
95  }
96
97  // Deletes a single Hub.
98  rpc DeleteHub(DeleteHubRequest) returns (google.longrunning.Operation) {
99    option (google.api.http) = {
100      delete: "/v1alpha1/{name=projects/*/locations/global/hubs/*}"
101    };
102    option (google.api.method_signature) = "name";
103    option (google.longrunning.operation_info) = {
104      response_type: "google.protobuf.Empty"
105      metadata_type: "OperationMetadata"
106    };
107  }
108
109  // Lists Spokes in a given project and location.
110  rpc ListSpokes(ListSpokesRequest) returns (ListSpokesResponse) {
111    option (google.api.http) = {
112      get: "/v1alpha1/{parent=projects/*/locations/*}/spokes"
113    };
114    option (google.api.method_signature) = "parent";
115  }
116
117  // Gets details of a single Spoke.
118  rpc GetSpoke(GetSpokeRequest) returns (Spoke) {
119    option (google.api.http) = {
120      get: "/v1alpha1/{name=projects/*/locations/*/spokes/*}"
121    };
122    option (google.api.method_signature) = "name";
123  }
124
125  // Creates a new Spoke in a given project and location.
126  rpc CreateSpoke(CreateSpokeRequest) returns (google.longrunning.Operation) {
127    option (google.api.http) = {
128      post: "/v1alpha1/{parent=projects/*/locations/*}/spokes"
129      body: "spoke"
130    };
131    option (google.api.method_signature) = "parent,spoke,spoke_id";
132    option (google.longrunning.operation_info) = {
133      response_type: "Spoke"
134      metadata_type: "OperationMetadata"
135    };
136  }
137
138  // Updates the parameters of a single Spoke.
139  rpc UpdateSpoke(UpdateSpokeRequest) returns (google.longrunning.Operation) {
140    option (google.api.http) = {
141      patch: "/v1alpha1/{spoke.name=projects/*/locations/*/spokes/*}"
142      body: "spoke"
143    };
144    option (google.api.method_signature) = "spoke,update_mask";
145    option (google.longrunning.operation_info) = {
146      response_type: "Spoke"
147      metadata_type: "OperationMetadata"
148    };
149  }
150
151  // Deletes a single Spoke.
152  rpc DeleteSpoke(DeleteSpokeRequest) returns (google.longrunning.Operation) {
153    option (google.api.http) = {
154      delete: "/v1alpha1/{name=projects/*/locations/*/spokes/*}"
155    };
156    option (google.api.method_signature) = "name";
157    option (google.longrunning.operation_info) = {
158      response_type: "google.protobuf.Empty"
159      metadata_type: "OperationMetadata"
160    };
161  }
162}
163
164// Network Connectivity Center is a hub-and-spoke abstraction for
165// network connectivity management in Google Cloud. It reduces
166// operational complexity through a simple, centralized connectivity management
167// model. Following is the resource message of a hub.
168message Hub {
169  option (google.api.resource) = {
170    type: "networkconnectivity.googleapis.com/Hub"
171    pattern: "projects/{project}/locations/global/hubs/{hub}"
172  };
173
174  // Immutable. The name of a Hub resource.
175  string name = 1 [(google.api.field_behavior) = IMMUTABLE];
176
177  // Time when the Hub was created.
178  google.protobuf.Timestamp create_time = 2;
179
180  // Time when the Hub was updated.
181  google.protobuf.Timestamp update_time = 3;
182
183  // User-defined labels.
184  map<string, string> labels = 4;
185
186  // Short description of the hub resource.
187  string description = 5;
188
189  // Output only. A list of the URIs of all attached spokes
190  repeated string spokes = 6 [
191    (google.api.field_behavior) = OUTPUT_ONLY,
192    (google.api.resource_reference) = {
193      type: "networkconnectivity.googleapis.com/Spoke"
194    }
195  ];
196
197  // Output only. Google-generated UUID for this resource. This is unique across all Hub
198  // resources. If a Hub resource is deleted and another with the same name is
199  // created, it gets a different unique_id.
200  string unique_id = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
201
202  // Output only. The current lifecycle state of this Hub.
203  State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
204}
205
206// A Spoke is an  abstraction of a network attachment being attached
207// to a Hub. A Spoke can be underlying a VPN tunnel, a
208// VLAN (interconnect) attachment, a Router appliance, etc.
209message Spoke {
210  option (google.api.resource) = {
211    type: "networkconnectivity.googleapis.com/Spoke"
212    pattern: "projects/{project}/locations/{location}/spokes/{spoke}"
213  };
214
215  // Immutable. The name of a Spoke resource.
216  string name = 1 [(google.api.field_behavior) = IMMUTABLE];
217
218  // The time when the Spoke was created.
219  google.protobuf.Timestamp create_time = 2;
220
221  // The time when the Spoke was updated.
222  google.protobuf.Timestamp update_time = 3;
223
224  // User-defined labels.
225  map<string, string> labels = 4;
226
227  // Short description of the spoke resource
228  string description = 5;
229
230  // The resource URL of the hub resource that the spoke is attached to
231  string hub = 6 [(google.api.resource_reference) = {
232                    type: "networkconnectivity.googleapis.com/Hub"
233                  }];
234
235  // The URIs of linked VPN tunnel resources
236  repeated string linked_vpn_tunnels = 12 [(google.api.resource_reference) = {
237                                             type: "compute.googleapis.com/VpnTunnel"
238                                           }];
239
240  // The URIs of linked interconnect attachment resources
241  repeated string linked_interconnect_attachments = 13 [(google.api.resource_reference) = {
242                                                          type: "compute.googleapis.com/InterconnectAttachment"
243                                                        }];
244
245  // The URIs of linked Router appliance resources
246  repeated RouterApplianceInstance linked_router_appliance_instances = 14;
247
248  // Output only. Google-generated UUID for this resource. This is unique across all Spoke
249  // resources. If a Spoke resource is deleted and another with the same name is
250  // created, it gets a different unique_id.
251  string unique_id = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
252
253  // Output only. The current lifecycle state of this Hub.
254  State state = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
255}
256
257// Request for [HubService.ListHubs][google.cloud.networkconnectivity.v1alpha1.HubService.ListHubs] method.
258message ListHubsRequest {
259  // Required. The parent resource's name.
260  string parent = 1 [
261    (google.api.field_behavior) = REQUIRED,
262    (google.api.resource_reference) = {
263      type: "locations.googleapis.com/Location"
264    }
265  ];
266
267  // The maximum number of results per page that should be returned.
268  int32 page_size = 2;
269
270  // The page token.
271  string page_token = 3;
272
273  // A filter expression that filters the results listed in the response.
274  string filter = 4;
275
276  // Sort the results by a certain order.
277  string order_by = 5;
278}
279
280// Response for [HubService.ListHubs][google.cloud.networkconnectivity.v1alpha1.HubService.ListHubs] method.
281message ListHubsResponse {
282  // Hubs to be returned.
283  repeated Hub hubs = 1;
284
285  // The next pagination token in the List response. It should be used as
286  // page_token for the following request. An empty value means no more result.
287  string next_page_token = 2;
288
289  // Locations that could not be reached.
290  repeated string unreachable = 3;
291}
292
293// Request for [HubService.GetHub][google.cloud.networkconnectivity.v1alpha1.HubService.GetHub] method.
294message GetHubRequest {
295  // Required. Name of the Hub resource to get.
296  string name = 1 [
297    (google.api.field_behavior) = REQUIRED,
298    (google.api.resource_reference) = {
299      type: "networkconnectivity.googleapis.com/Hub"
300    }
301  ];
302}
303
304// Request for [HubService.CreateHub][google.cloud.networkconnectivity.v1alpha1.HubService.CreateHub] method.
305message CreateHubRequest {
306  // Required. The parent resource's name of the Hub.
307  string parent = 1 [
308    (google.api.field_behavior) = REQUIRED,
309    (google.api.resource_reference) = {
310      type: "locations.googleapis.com/Location"
311    }
312  ];
313
314  // Optional. Unique id for the Hub to create.
315  string hub_id = 2 [(google.api.field_behavior) = OPTIONAL];
316
317  // Required. Initial values for a new Hub.
318  Hub hub = 3 [(google.api.field_behavior) = REQUIRED];
319
320  // Optional. An optional request ID to identify requests. Specify a unique request ID
321  // so that if you must retry your request, the server will know to ignore
322  // the request if it has already been completed. The server will guarantee
323  // that for at least 60 minutes since the first request.
324  //
325  // For example, consider a situation where you make an initial request and t
326  // he request times out. If you make the request again with the same request
327  // ID, the server can check if original operation with the same request ID
328  // was received, and if so, will ignore the second request. This prevents
329  // clients from accidentally creating duplicate commitments.
330  //
331  // The request ID must be a valid UUID with the exception that zero UUID is
332  // not supported (00000000-0000-0000-0000-000000000000).
333  string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
334}
335
336// Request for [HubService.UpdateHub][google.cloud.networkconnectivity.v1alpha1.HubService.UpdateHub] method.
337message UpdateHubRequest {
338  // Optional. Field mask is used to specify the fields to be overwritten in the
339  // Hub resource by the update.
340  // The fields specified in the update_mask are relative to the resource, not
341  // the full request. A field will be overwritten if it is in the mask. If the
342  // user does not provide a mask then all fields will be overwritten.
343  google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL];
344
345  // Required. The state that the Hub should be in after the update.
346  Hub hub = 2 [(google.api.field_behavior) = REQUIRED];
347
348  // Optional. An optional request ID to identify requests. Specify a unique request ID
349  // so that if you must retry your request, the server will know to ignore
350  // the request if it has already been completed. The server will guarantee
351  // that for at least 60 minutes since the first request.
352  //
353  // For example, consider a situation where you make an initial request and t
354  // he request times out. If you make the request again with the same request
355  // ID, the server can check if original operation with the same request ID
356  // was received, and if so, will ignore the second request. This prevents
357  // clients from accidentally creating duplicate commitments.
358  //
359  // The request ID must be a valid UUID with the exception that zero UUID is
360  // not supported (00000000-0000-0000-0000-000000000000).
361  string request_id = 3 [(google.api.field_behavior) = OPTIONAL];
362}
363
364// The request for [HubService.DeleteHub][google.cloud.networkconnectivity.v1alpha1.HubService.DeleteHub].
365message DeleteHubRequest {
366  // Required. The name of the Hub to delete.
367  string name = 1 [
368    (google.api.field_behavior) = REQUIRED,
369    (google.api.resource_reference) = {
370      type: "networkconnectivity.googleapis.com/Hub"
371    }
372  ];
373
374  // Optional. An optional request ID to identify requests. Specify a unique request ID
375  // so that if you must retry your request, the server will know to ignore
376  // the request if it has already been completed. The server will guarantee
377  // that for at least 60 minutes after the first request.
378  //
379  // For example, consider a situation where you make an initial request and t
380  // he request times out. If you make the request again with the same request
381  // ID, the server can check if original operation with the same request ID
382  // was received, and if so, will ignore the second request. This prevents
383  // clients from accidentally creating duplicate commitments.
384  //
385  // The request ID must be a valid UUID with the exception that zero UUID is
386  // not supported (00000000-0000-0000-0000-000000000000).
387  string request_id = 2 [(google.api.field_behavior) = OPTIONAL];
388}
389
390// The request for [HubService.ListSpokes][google.cloud.networkconnectivity.v1alpha1.HubService.ListSpokes].
391message ListSpokesRequest {
392  // Required. The parent's resource name.
393  string parent = 1 [
394    (google.api.field_behavior) = REQUIRED,
395    (google.api.resource_reference) = {
396      type: "locations.googleapis.com/Location"
397    }
398  ];
399
400  // The maximum number of results per page that should be returned.
401  int32 page_size = 2;
402
403  // The page token.
404  string page_token = 3;
405
406  // A filter expression that filters the results listed in the response.
407  string filter = 4;
408
409  // Sort the results by a certain order.
410  string order_by = 5;
411}
412
413// The response for [HubService.ListSpokes][google.cloud.networkconnectivity.v1alpha1.HubService.ListSpokes].
414message ListSpokesResponse {
415  // Spokes to be returned.
416  repeated Spoke spokes = 1;
417
418  // The next pagination token in the List response. It should be used as
419  // page_token for the following request. An empty value means no more result.
420  string next_page_token = 2;
421
422  // Locations that could not be reached.
423  repeated string unreachable = 3;
424}
425
426// The request for [HubService.GetSpoke][google.cloud.networkconnectivity.v1alpha1.HubService.GetSpoke].
427message GetSpokeRequest {
428  // Required. The name of Spoke resource.
429  string name = 1 [
430    (google.api.field_behavior) = REQUIRED,
431    (google.api.resource_reference) = {
432      type: "networkconnectivity.googleapis.com/Spoke"
433    }
434  ];
435}
436
437// The request for [HubService.CreateSpoke][google.cloud.networkconnectivity.v1alpha1.HubService.CreateSpoke].
438message CreateSpokeRequest {
439  // Required. The parent's resource name of the Spoke.
440  string parent = 1 [
441    (google.api.field_behavior) = REQUIRED,
442    (google.api.resource_reference) = {
443      type: "locations.googleapis.com/Location"
444    }
445  ];
446
447  // Optional. Unique id for the Spoke to create.
448  string spoke_id = 2 [(google.api.field_behavior) = OPTIONAL];
449
450  // Required. Initial values for a new Hub.
451  Spoke spoke = 3 [(google.api.field_behavior) = REQUIRED];
452
453  // Optional. An optional request ID to identify requests. Specify a unique request ID
454  // so that if you must retry your request, the server will know to ignore
455  // the request if it has already been completed. The server will guarantee
456  // that for at least 60 minutes since the first request.
457  //
458  // For example, consider a situation where you make an initial request and t
459  // he request times out. If you make the request again with the same request
460  // ID, the server can check if original operation with the same request ID
461  // was received, and if so, will ignore the second request. This prevents
462  // clients from accidentally creating duplicate commitments.
463  //
464  // The request ID must be a valid UUID with the exception that zero UUID is
465  // not supported (00000000-0000-0000-0000-000000000000).
466  string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
467}
468
469// Request for [HubService.UpdateSpoke][google.cloud.networkconnectivity.v1alpha1.HubService.UpdateSpoke] method.
470message UpdateSpokeRequest {
471  // Optional. Field mask is used to specify the fields to be overwritten in the
472  // Spoke resource by the update.
473  // The fields specified in the update_mask are relative to the resource, not
474  // the full request. A field will be overwritten if it is in the mask. If the
475  // user does not provide a mask then all fields will be overwritten.
476  google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL];
477
478  // Required. The state that the Spoke should be in after the update.
479  Spoke spoke = 2 [(google.api.field_behavior) = REQUIRED];
480
481  // Optional. An optional request ID to identify requests. Specify a unique request ID
482  // so that if you must retry your request, the server will know to ignore
483  // the request if it has already been completed. The server will guarantee
484  // that for at least 60 minutes since the first request.
485  //
486  // For example, consider a situation where you make an initial request and t
487  // he request times out. If you make the request again with the same request
488  // ID, the server can check if original operation with the same request ID
489  // was received, and if so, will ignore the second request. This prevents
490  // clients from accidentally creating duplicate commitments.
491  //
492  // The request ID must be a valid UUID with the exception that zero UUID is
493  // not supported (00000000-0000-0000-0000-000000000000).
494  string request_id = 3 [(google.api.field_behavior) = OPTIONAL];
495}
496
497// The request for [HubService.DeleteSpoke][google.cloud.networkconnectivity.v1alpha1.HubService.DeleteSpoke].
498message DeleteSpokeRequest {
499  // Required. The name of the Spoke to delete.
500  string name = 1 [
501    (google.api.field_behavior) = REQUIRED,
502    (google.api.resource_reference) = {
503      type: "networkconnectivity.googleapis.com/Spoke"
504    }
505  ];
506
507  // Optional. An optional request ID to identify requests. Specify a unique request ID
508  // so that if you must retry your request, the server will know to ignore
509  // the request if it has already been completed. The server will guarantee
510  // that for at least 60 minutes after the first request.
511  //
512  // For example, consider a situation where you make an initial request and t
513  // he request times out. If you make the request again with the same request
514  // ID, the server can check if original operation with the same request ID
515  // was received, and if so, will ignore the second request. This prevents
516  // clients from accidentally creating duplicate commitments.
517  //
518  // The request ID must be a valid UUID with the exception that zero UUID is
519  // not supported (00000000-0000-0000-0000-000000000000).
520  string request_id = 2 [(google.api.field_behavior) = OPTIONAL];
521}
522
523// RouterAppliance represents a Router appliance which is specified by a VM URI
524// and a NIC address.
525message RouterApplianceInstance {
526  // The URI of the virtual machine resource
527  string virtual_machine = 1 [(google.api.resource_reference) = {
528                                type: "compute.googleapis.com/Instance"
529                              }];
530
531  // The IP address of the network interface to use for peering.
532  string ip_address = 3;
533
534  string network_interface = 2 [deprecated = true];
535}
536
537// The State enum represents the lifecycle of a Network Connectivity Center
538// resource.
539enum State {
540  // No state information available
541  STATE_UNSPECIFIED = 0;
542
543  // The resource's create operation is in progress
544  CREATING = 1;
545
546  // The resource is active
547  ACTIVE = 2;
548
549  // The resource's Delete operation is in progress
550  DELETING = 3;
551}
552