connectivity_test.proto 8.9 KB

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