reachability.proto 11 KB

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