connectivity_test.proto 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  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/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/networkmanagement/v1beta1/trace.proto";
  19. import "google/protobuf/timestamp.proto";
  20. import "google/rpc/status.proto";
  21. option csharp_namespace = "Google.Cloud.NetworkManagement.V1Beta1";
  22. option go_package = "google.golang.org/genproto/googleapis/cloud/networkmanagement/v1beta1;networkmanagement";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "TestOuterClass";
  25. option java_package = "com.google.cloud.networkmanagement.v1beta1";
  26. option php_namespace = "Google\\Cloud\\NetworkManagement\\V1beta1";
  27. option ruby_package = "Google::Cloud::NetworkManagement::V1beta1";
  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}`
  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
  93. [(google.api.field_behavior) = OUTPUT_ONLY];
  94. // Output only. The time the test's configuration was updated.
  95. google.protobuf.Timestamp update_time = 11
  96. [(google.api.field_behavior) = OUTPUT_ONLY];
  97. // Output only. The reachability details of this test from the latest run.
  98. // The details are updated when creating a new test, updating an
  99. // existing test, or triggering a one-time rerun of an existing test.
  100. ReachabilityDetails reachability_details = 12
  101. [(google.api.field_behavior) = OUTPUT_ONLY];
  102. // Output only. The probing details of this test from the latest run, present
  103. // for applicable tests only. The details are updated when creating a new
  104. // test, updating an existing test, or triggering a one-time rerun of an
  105. // existing test.
  106. ProbingDetails probing_details = 14
  107. [(google.api.field_behavior) = OUTPUT_ONLY];
  108. }
  109. // Source or destination of the Connectivity Test.
  110. message Endpoint {
  111. // The type definition of an endpoint's network. Use one of the
  112. // following choices:
  113. enum NetworkType {
  114. // Default type if unspecified.
  115. NETWORK_TYPE_UNSPECIFIED = 0;
  116. // A network hosted within Google Cloud Platform.
  117. // To receive more detailed output, specify the URI for the source or
  118. // destination network.
  119. GCP_NETWORK = 1;
  120. // A network hosted outside of Google Cloud Platform.
  121. // This can be an on-premises network, or a network hosted by another cloud
  122. // provider.
  123. NON_GCP_NETWORK = 2;
  124. }
  125. // Wrapper for cloud function attributes.
  126. message CloudFunctionEndpoint {
  127. // A [Cloud function](https://cloud.google.com/functions) name.
  128. string uri = 1;
  129. }
  130. // The IP address of the endpoint, which can be an external or internal IP.
  131. // An IPv6 address is only allowed when the test's destination is a
  132. // [global load balancer
  133. // VIP](https://cloud.google.com/load-balancing/docs/load-balancing-overview).
  134. string ip_address = 1;
  135. // The IP protocol port of the endpoint.
  136. // Only applicable when protocol is TCP or UDP.
  137. int32 port = 2;
  138. // A Compute Engine instance URI.
  139. string instance = 3;
  140. // A cluster URI for [Google Kubernetes Engine
  141. // master](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture).
  142. string gke_master_cluster = 7;
  143. // A [Cloud SQL](https://cloud.google.com/sql) instance URI.
  144. string cloud_sql_instance = 8;
  145. // A [Cloud function](https://cloud.google.com/functions).
  146. CloudFunctionEndpoint cloud_function = 10;
  147. // A Compute Engine network URI.
  148. string network = 4;
  149. // Type of the network where the endpoint is located.
  150. // Applicable only to source endpoint, as destination network type can be
  151. // inferred from the source.
  152. NetworkType network_type = 5;
  153. // Project ID where the endpoint is located.
  154. // The Project ID can be derived from the URI if you provide a VM instance or
  155. // network URI.
  156. // The following are two cases where you must provide the project ID:
  157. // 1. Only the IP address is specified, and the IP address is within a GCP
  158. // project.
  159. // 2. When you are using Shared VPC and the IP address that you provide is
  160. // from the service project. In this case, the network that the IP address
  161. // resides in is defined in the host project.
  162. string project_id = 6;
  163. }
  164. // Results of the configuration analysis from the last run of the test.
  165. message ReachabilityDetails {
  166. // The overall result of the test's configuration analysis.
  167. enum Result {
  168. // No result was specified.
  169. RESULT_UNSPECIFIED = 0;
  170. // Possible scenarios are:
  171. //
  172. // * The configuration analysis determined that a packet originating from
  173. // the source is expected to reach the destination.
  174. // * The analysis didn't complete because the user lacks permission for
  175. // some of the resources in the trace. However, at the time the user's
  176. // permission became insufficient, the trace had been successful so far.
  177. REACHABLE = 1;
  178. // A packet originating from the source is expected to be dropped before
  179. // reaching the destination.
  180. UNREACHABLE = 2;
  181. // The source and destination endpoints do not uniquely identify
  182. // the test location in the network, and the reachability result contains
  183. // multiple traces. For some traces, a packet could be delivered, and for
  184. // others, it would not be.
  185. AMBIGUOUS = 4;
  186. // The configuration analysis did not complete. Possible reasons are:
  187. //
  188. // * A permissions error occurred--for example, the user might not have
  189. // read permission for all of the resources named in the test.
  190. // * An internal error occurred.
  191. // * The analyzer received an invalid or unsupported argument or was unable
  192. // to identify a known endpoint.
  193. UNDETERMINED = 5;
  194. }
  195. // The overall result of the test's configuration analysis.
  196. Result result = 1;
  197. // The time of the configuration analysis.
  198. google.protobuf.Timestamp verify_time = 2;
  199. // The details of a failure or a cancellation of reachability analysis.
  200. google.rpc.Status error = 3;
  201. // Result may contain a list of traces if a test has multiple possible
  202. // paths in the network, such as when destination endpoint is a load balancer
  203. // with multiple backends.
  204. repeated Trace traces = 5;
  205. }
  206. // Latency percentile rank and value.
  207. message LatencyPercentile {
  208. // Percentage of samples this data point applies to.
  209. int32 percent = 1;
  210. // percent-th percentile of latency observed, in microseconds.
  211. // Fraction of percent/100 of samples have latency lower or
  212. // equal to the value of this field.
  213. int64 latency_micros = 2;
  214. }
  215. // Describes measured latency distribution.
  216. message LatencyDistribution {
  217. // Representative latency percentiles.
  218. repeated LatencyPercentile latency_percentiles = 1;
  219. }
  220. // Results of active probing from the last run of the test.
  221. message ProbingDetails {
  222. // Overall probing result of the test.
  223. enum ProbingResult {
  224. // No result was specified.
  225. PROBING_RESULT_UNSPECIFIED = 0;
  226. // At least 95% of packets reached the destination.
  227. REACHABLE = 1;
  228. // No packets reached the destination.
  229. UNREACHABLE = 2;
  230. // Less than 95% of packets reached the destination.
  231. REACHABILITY_INCONSISTENT = 3;
  232. // Reachability could not be determined. Possible reasons are:
  233. // * The user lacks permission to access some of the network resources
  234. // required to run the test.
  235. // * No valid source endpoint could be derived from the request.
  236. // * An internal error occurred.
  237. UNDETERMINED = 4;
  238. }
  239. // Abort cause types.
  240. enum ProbingAbortCause {
  241. // No reason was specified.
  242. PROBING_ABORT_CAUSE_UNSPECIFIED = 0;
  243. // The user lacks permission to access some of the
  244. // network resources required to run the test.
  245. PERMISSION_DENIED = 1;
  246. // No valid source endpoint could be derived from the request.
  247. NO_SOURCE_LOCATION = 2;
  248. }
  249. // Representation of a network edge location as per
  250. // https://cloud.google.com/vpc/docs/edge-locations.
  251. message EdgeLocation {
  252. // Name of the metropolitan area.
  253. string metropolitan_area = 1;
  254. }
  255. // The overall result of active probing.
  256. ProbingResult result = 1;
  257. // The time that reachability was assessed through active probing.
  258. google.protobuf.Timestamp verify_time = 2;
  259. // Details about an internal failure or the cancellation of active probing.
  260. google.rpc.Status error = 3;
  261. // The reason probing was aborted.
  262. ProbingAbortCause abort_cause = 4;
  263. // Number of probes sent.
  264. int32 sent_probe_count = 5;
  265. // Number of probes that reached the destination.
  266. int32 successful_probe_count = 6;
  267. // The source and destination endpoints derived from the test input and used
  268. // for active probing.
  269. EndpointInfo endpoint_info = 7;
  270. // Latency as measured by active probing in one direction:
  271. // from the source to the destination endpoint.
  272. LatencyDistribution probing_latency = 8;
  273. // The EdgeLocation from which a packet destined for/originating from the
  274. // internet will egress/ingress the Google network.
  275. // This will only be populated for a connectivity test which has an internet
  276. // destination/source address.
  277. // The absence of this field *must not* be used as an indication that the
  278. // destination/source is part of the Google network.
  279. EdgeLocation destination_egress_location = 9;
  280. }