reachability.proto 11 KB

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