reachability.proto 11 KB

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