connectivity_test.proto 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/networkmanagement/v1/trace.proto";
  19. import "google/protobuf/timestamp.proto";
  20. import "google/rpc/status.proto";
  21. option csharp_namespace = "Google.Cloud.NetworkManagement.V1";
  22. option go_package = "google.golang.org/genproto/googleapis/cloud/networkmanagement/v1;networkmanagement";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "TestOuterClass";
  25. option java_package = "com.google.cloud.networkmanagement.v1";
  26. option php_namespace = "Google\\Cloud\\NetworkManagement\\V1";
  27. option ruby_package = "Google::Cloud::NetworkManagement::V1";
  28. // A Connectivity Test for a network reachability analysis.
  29. message ConnectivityTest {
  30. option (google.api.resource) = {
  31. type: "networkmanagement.googleapis.com/ConnectivityTest"
  32. pattern: "projects/{project}/locations/global/connectivityTests/{test}"
  33. };
  34. // Required. Unique name of the resource using the form:
  35. // `projects/{project_id}/locations/global/connectivityTests/{test_id}`
  36. string name = 1 [(google.api.field_behavior) = REQUIRED];
  37. // The user-supplied description of the Connectivity Test.
  38. // Maximum of 512 characters.
  39. string description = 2;
  40. // Required. Source specification of the Connectivity Test.
  41. //
  42. // You can use a combination of source IP address, virtual machine
  43. // (VM) instance, or Compute Engine network to uniquely identify
  44. // the source location.
  45. //
  46. // Examples:
  47. // If the source IP address is an internal IP address within a Google Cloud
  48. // Virtual Private Cloud (VPC) network, then you must also specify the VPC
  49. // network. Otherwise, specify the VM instance, which already contains its
  50. // internal IP address and VPC network information.
  51. //
  52. // If the source of the test is within an on-premises network, then you must
  53. // provide the destination VPC network.
  54. //
  55. // If the source endpoint is a Compute Engine VM instance with multiple
  56. // network interfaces, the instance itself is not sufficient to identify the
  57. // endpoint. So, you must also specify the source IP address or VPC network.
  58. //
  59. // A reachability analysis proceeds even if the source location is
  60. // ambiguous. However, the test result may include endpoints that you don't
  61. // intend to test.
  62. Endpoint source = 3 [(google.api.field_behavior) = REQUIRED];
  63. // Required. Destination specification of the Connectivity Test.
  64. //
  65. // You can use a combination of destination IP address, Compute Engine
  66. // VM instance, or VPC network to uniquely identify the destination
  67. // location.
  68. //
  69. // Even if the destination IP address is not unique, the source IP
  70. // location is unique. Usually, the analysis can infer the destination
  71. // endpoint from route information.
  72. //
  73. // If the destination you specify is a VM instance and the instance has
  74. // multiple network interfaces, then you must also specify either
  75. // a destination IP address or VPC network to identify the destination
  76. // interface.
  77. //
  78. // A reachability analysis proceeds even if the destination location is
  79. // ambiguous. However, the result can include endpoints that you don't
  80. // intend to test.
  81. Endpoint destination = 4 [(google.api.field_behavior) = REQUIRED];
  82. // IP Protocol of the test. When not provided, "TCP" is assumed.
  83. string protocol = 5;
  84. // Other projects that may be relevant for reachability analysis.
  85. // This is applicable to scenarios where a test can cross project boundaries.
  86. repeated string related_projects = 6;
  87. // Output only. The display name of a Connectivity Test.
  88. string display_name = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  89. // Resource labels to represent user-provided metadata.
  90. map<string, string> labels = 8;
  91. // Output only. The time the test was created.
  92. google.protobuf.Timestamp create_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  93. // Output only. The time the test's configuration was updated.
  94. google.protobuf.Timestamp update_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
  95. // Output only. The reachability details of this test from the latest run.
  96. // The details are updated when creating a new test, updating an
  97. // existing test, or triggering a one-time rerun of an existing test.
  98. ReachabilityDetails reachability_details = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
  99. }
  100. // Source or destination of the Connectivity Test.
  101. message Endpoint {
  102. // The type definition of an endpoint's network. Use one of the
  103. // following choices:
  104. enum NetworkType {
  105. // Default type if unspecified.
  106. NETWORK_TYPE_UNSPECIFIED = 0;
  107. // A network hosted within Google Cloud Platform.
  108. // To receive more detailed output, specify the URI for the source or
  109. // destination network.
  110. GCP_NETWORK = 1;
  111. // A network hosted outside of Google Cloud Platform.
  112. // This can be an on-premises network, or a network hosted by another cloud
  113. // provider.
  114. NON_GCP_NETWORK = 2;
  115. }
  116. // The IP address of the endpoint, which can be an external or internal IP.
  117. // An IPv6 address is only allowed when the test's destination is a
  118. // [global load balancer VIP](/load-balancing/docs/load-balancing-overview).
  119. string ip_address = 1;
  120. // The IP protocol port of the endpoint.
  121. // Only applicable when protocol is TCP or UDP.
  122. int32 port = 2;
  123. // A Compute Engine instance URI.
  124. string instance = 3;
  125. // A cluster URI for [Google Kubernetes Engine
  126. // master](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture).
  127. string gke_master_cluster = 7;
  128. // A [Cloud SQL](https://cloud.google.com/sql) instance URI.
  129. string cloud_sql_instance = 8;
  130. // A Compute Engine network URI.
  131. string network = 4;
  132. // Type of the network where the endpoint is located.
  133. // Applicable only to source endpoint, as destination network type can be
  134. // inferred from the source.
  135. NetworkType network_type = 5;
  136. // Project ID where the endpoint is located.
  137. // The Project ID can be derived from the URI if you provide a VM instance or
  138. // network URI.
  139. // The following are two cases where you must provide the project ID:
  140. // 1. Only the IP address is specified, and the IP address is within a GCP
  141. // project.
  142. // 2. When you are using Shared VPC and the IP address that you provide is
  143. // from the service project. In this case, the network that the IP address
  144. // resides in is defined in the host project.
  145. string project_id = 6;
  146. }
  147. // Results of the configuration analysis from the last run of the test.
  148. message ReachabilityDetails {
  149. // The overall result of the test's configuration analysis.
  150. enum Result {
  151. // No result was specified.
  152. RESULT_UNSPECIFIED = 0;
  153. // Possible scenarios are:
  154. //
  155. // * The configuration analysis determined that a packet originating from
  156. // the source is expected to reach the destination.
  157. // * The analysis didn't complete because the user lacks permission for
  158. // some of the resources in the trace. However, at the time the user's
  159. // permission became insufficient, the trace had been successful so far.
  160. REACHABLE = 1;
  161. // A packet originating from the source is expected to be dropped before
  162. // reaching the destination.
  163. UNREACHABLE = 2;
  164. // The source and destination endpoints do not uniquely identify
  165. // the test location in the network, and the reachability result contains
  166. // multiple traces. For some traces, a packet could be delivered, and for
  167. // others, it would not be.
  168. AMBIGUOUS = 4;
  169. // The configuration analysis did not complete. Possible reasons are:
  170. //
  171. // * A permissions error occurred--for example, the user might not have
  172. // read permission for all of the resources named in the test.
  173. // * An internal error occurred.
  174. // * The analyzer received an invalid or unsupported argument or was unable
  175. // to identify a known endpoint.
  176. UNDETERMINED = 5;
  177. }
  178. // The overall result of the test's configuration analysis.
  179. Result result = 1;
  180. // The time of the configuration analysis.
  181. google.protobuf.Timestamp verify_time = 2;
  182. // The details of a failure or a cancellation of reachability analysis.
  183. google.rpc.Status error = 3;
  184. // Result may contain a list of traces if a test has multiple possible
  185. // paths in the network, such as when destination endpoint is a load balancer
  186. // with multiple backends.
  187. repeated Trace traces = 5;
  188. }