xref: /aosp_15_r20/external/googleapis/google/cloud/networkmanagement/v1beta1/reachability.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.networkmanagement.v1beta1;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/api/resource.proto";
23import "google/cloud/networkmanagement/v1beta1/connectivity_test.proto";
24import "google/longrunning/operations.proto";
25import "google/protobuf/empty.proto";
26import "google/protobuf/field_mask.proto";
27import "google/protobuf/timestamp.proto";
28
29option csharp_namespace = "Google.Cloud.NetworkManagement.V1Beta1";
30option go_package = "cloud.google.com/go/networkmanagement/apiv1beta1/networkmanagementpb;networkmanagementpb";
31option java_multiple_files = true;
32option java_outer_classname = "ReachabilityServiceProto";
33option java_package = "com.google.cloud.networkmanagement.v1beta1";
34option php_namespace = "Google\\Cloud\\NetworkManagement\\V1beta1";
35option ruby_package = "Google::Cloud::NetworkManagement::V1beta1";
36
37// The Reachability service in Google Cloud Network Management API
38
39// The Reachability service in the Google Cloud Network Management API provides
40// services that analyze the reachability within a single Google Virtual Private
41// Cloud (VPC) network, between peered VPC networks, between VPC and on-premises
42// networks, or between VPC networks and internet hosts. A reachability analysis
43// is based on Google Cloud network configurations.
44//
45// You can use the analysis results to verify these configurations and
46// to troubleshoot connectivity issues.
47service ReachabilityService {
48  option (google.api.default_host) = "networkmanagement.googleapis.com";
49  option (google.api.oauth_scopes) =
50      "https://www.googleapis.com/auth/cloud-platform";
51
52  // Lists all Connectivity Tests owned by a project.
53  rpc ListConnectivityTests(ListConnectivityTestsRequest)
54      returns (ListConnectivityTestsResponse) {
55    option (google.api.http) = {
56      get: "/v1beta1/{parent=projects/*/locations/global}/connectivityTests"
57    };
58  }
59
60  // Gets the details of a specific Connectivity Test.
61  rpc GetConnectivityTest(GetConnectivityTestRequest)
62      returns (ConnectivityTest) {
63    option (google.api.http) = {
64      get: "/v1beta1/{name=projects/*/locations/global/connectivityTests/*}"
65    };
66  }
67
68  // Creates a new Connectivity Test.
69  // After you create a test, the reachability analysis is performed as part
70  // of the long running operation, which completes when the analysis completes.
71  //
72  // If the endpoint specifications in `ConnectivityTest` are invalid
73  // (for example, containing non-existent resources in the network, or you
74  // don't have read permissions to the network configurations of listed
75  // projects), then the reachability result returns a value of `UNKNOWN`.
76  //
77  // If the endpoint specifications in `ConnectivityTest` are
78  // incomplete, the reachability result returns a value of
79  // <code>AMBIGUOUS</code>. For more information,
80  // see the Connectivity Test documentation.
81  rpc CreateConnectivityTest(CreateConnectivityTestRequest)
82      returns (google.longrunning.Operation) {
83    option (google.api.http) = {
84      post: "/v1beta1/{parent=projects/*/locations/global}/connectivityTests"
85      body: "resource"
86    };
87    option (google.longrunning.operation_info) = {
88      response_type: "google.cloud.networkmanagement.v1beta1.ConnectivityTest"
89      metadata_type: "OperationMetadata"
90    };
91  }
92
93  // Updates the configuration of an existing `ConnectivityTest`.
94  // After you update a test, the reachability analysis is performed as part
95  // of the long running operation, which completes when the analysis completes.
96  // The Reachability state in the test resource is updated with the new result.
97  //
98  // If the endpoint specifications in `ConnectivityTest` are invalid
99  // (for example, they contain non-existent resources in the network, or the
100  // user does not have read permissions to the network configurations of
101  // listed projects), then the reachability result returns a value of
102  // <code>UNKNOWN</code>.
103  //
104  // If the endpoint specifications in `ConnectivityTest` are incomplete, the
105  // reachability result returns a value of `AMBIGUOUS`. See the documentation
106  // in `ConnectivityTest` for for more details.
107  rpc UpdateConnectivityTest(UpdateConnectivityTestRequest)
108      returns (google.longrunning.Operation) {
109    option (google.api.http) = {
110      patch: "/v1beta1/{resource.name=projects/*/locations/global/connectivityTests/*}"
111      body: "resource"
112    };
113    option (google.longrunning.operation_info) = {
114      response_type: "google.cloud.networkmanagement.v1beta1.ConnectivityTest"
115      metadata_type: "OperationMetadata"
116    };
117  }
118
119  // Rerun an existing `ConnectivityTest`.
120  // After the user triggers the rerun, the reachability analysis is performed
121  // as part of the long running operation, which completes when the analysis
122  // completes.
123  //
124  // Even though the test configuration remains the same, the reachability
125  // result may change due to underlying network configuration changes.
126  //
127  // If the endpoint specifications in `ConnectivityTest` become invalid (for
128  // example, specified resources are deleted in the network, or you lost
129  // read permissions to the network configurations of listed projects), then
130  // the reachability result returns a value of `UNKNOWN`.
131  rpc RerunConnectivityTest(RerunConnectivityTestRequest)
132      returns (google.longrunning.Operation) {
133    option (google.api.http) = {
134      post: "/v1beta1/{name=projects/*/locations/global/connectivityTests/*}:rerun"
135      body: "*"
136    };
137    option (google.longrunning.operation_info) = {
138      response_type: "google.cloud.networkmanagement.v1beta1.ConnectivityTest"
139      metadata_type: "OperationMetadata"
140    };
141  }
142
143  // Deletes a specific `ConnectivityTest`.
144  rpc DeleteConnectivityTest(DeleteConnectivityTestRequest)
145      returns (google.longrunning.Operation) {
146    option (google.api.http) = {
147      delete: "/v1beta1/{name=projects/*/locations/global/connectivityTests/*}"
148    };
149    option (google.longrunning.operation_info) = {
150      response_type: "google.protobuf.Empty"
151      metadata_type: "OperationMetadata"
152    };
153  }
154}
155
156// Request for the `ListConnectivityTests` method.
157message ListConnectivityTestsRequest {
158  // Required. The parent resource of the Connectivity Tests:
159  //     `projects/{project_id}/locations/global`
160  string parent = 1 [(google.api.field_behavior) = REQUIRED];
161
162  // Number of `ConnectivityTests` to return.
163  int32 page_size = 2;
164
165  // Page token from an earlier query, as returned in `next_page_token`.
166  string page_token = 3;
167
168  // Lists the `ConnectivityTests` that match the filter expression. A filter
169  // expression filters the resources listed in the response. The expression
170  // must be of the form `<field> <operator> <value>` where operators: `<`, `>`,
171  // `<=`,
172  // `>=`,
173  // `!=`, `=`, `:` are supported (colon `:` represents a HAS operator which is
174  // roughly synonymous with equality). <field> can refer to a proto or JSON
175  // field, or a synthetic field. Field names can be camelCase or snake_case.
176  //
177  // Examples:
178  // - Filter by name:
179  //   name = "projects/proj-1/locations/global/connectivityTests/test-1
180  //
181  // - Filter by labels:
182  //   - Resources that have a key called `foo`
183  //     labels.foo:*
184  //   - Resources that have a key called `foo` whose value is `bar`
185  //     labels.foo = bar
186  string filter = 4;
187
188  // Field to use to sort the list.
189  string order_by = 5;
190}
191
192// Response for the `ListConnectivityTests` method.
193message ListConnectivityTestsResponse {
194  // List of Connectivity Tests.
195  repeated ConnectivityTest resources = 1;
196
197  // Page token to fetch the next set of Connectivity Tests.
198  string next_page_token = 2;
199
200  // Locations that could not be reached (when querying all locations with `-`).
201  repeated string unreachable = 3;
202}
203
204// Request for the `GetConnectivityTest` method.
205message GetConnectivityTestRequest {
206  // Required. `ConnectivityTest` resource name using the form:
207  //     `projects/{project_id}/locations/global/connectivityTests/{test_id}`
208  string name = 1 [(google.api.field_behavior) = REQUIRED];
209}
210
211// Request for the `CreateConnectivityTest` method.
212message CreateConnectivityTestRequest {
213  // Required. The parent resource of the Connectivity Test to create:
214  //     `projects/{project_id}/locations/global`
215  string parent = 1 [(google.api.field_behavior) = REQUIRED];
216
217  // Required. The logical name of the Connectivity Test in your project
218  // with the following restrictions:
219  //
220  // * Must contain only lowercase letters, numbers, and hyphens.
221  // * Must start with a letter.
222  // * Must be between 1-40 characters.
223  // * Must end with a number or a letter.
224  // * Must be unique within the customer project
225  string test_id = 2 [(google.api.field_behavior) = REQUIRED];
226
227  // Required. A `ConnectivityTest` resource
228  ConnectivityTest resource = 3 [(google.api.field_behavior) = REQUIRED];
229}
230
231// Request for the `UpdateConnectivityTest` method.
232message UpdateConnectivityTestRequest {
233  // Required. Mask of fields to update. At least one path must be supplied in
234  // this field.
235  google.protobuf.FieldMask update_mask = 1
236      [(google.api.field_behavior) = REQUIRED];
237
238  // Required. Only fields specified in update_mask are updated.
239  ConnectivityTest resource = 2 [(google.api.field_behavior) = REQUIRED];
240}
241
242// Request for the `DeleteConnectivityTest` method.
243message DeleteConnectivityTestRequest {
244  // Required. Connectivity Test resource name using the form:
245  //     `projects/{project_id}/locations/global/connectivityTests/{test_id}`
246  string name = 1 [(google.api.field_behavior) = REQUIRED];
247}
248
249// Request for the `RerunConnectivityTest` method.
250message RerunConnectivityTestRequest {
251  // Required. Connectivity Test resource name using the form:
252  //     `projects/{project_id}/locations/global/connectivityTests/{test_id}`
253  string name = 1 [(google.api.field_behavior) = REQUIRED];
254}
255
256// Metadata describing an [Operation][google.longrunning.Operation]
257message OperationMetadata {
258  // The time the operation was created.
259  google.protobuf.Timestamp create_time = 1;
260
261  // The time the operation finished running.
262  google.protobuf.Timestamp end_time = 2;
263
264  // Target of the operation - for example
265  // projects/project-1/locations/global/connectivityTests/test-1
266  string target = 3;
267
268  // Name of the verb executed by the operation.
269  string verb = 4;
270
271  // Human-readable status of the operation, if any.
272  string status_detail = 5;
273
274  // Specifies if cancellation was requested for the operation.
275  bool cancel_requested = 6;
276
277  // API version.
278  string api_version = 7;
279}
280