feat: Network Management public protos

Committer: @alexander-fenster
PiperOrigin-RevId: 381277241
This commit is contained in:
Google APIs 2021-06-24 09:55:41 -07:00 committed by Copybara-Service
parent 6425b1d468
commit 125b03cd35
12 changed files with 3787 additions and 0 deletions

View file

@ -0,0 +1,341 @@
# This file was automatically generated by BuildFileGenerator
# https://github.com/googleapis/rules_gapic/tree/master/bazel
# Most of the manual changes to this file will be overwritten.
# It's **only** allowed to change the following rule attribute values:
# - names of *_gapic_assembly_* rules
# - certain parameters of *_gapic_library rules, including but not limited to:
# * extra_protoc_parameters
# * extra_protoc_file_parameters
# The complete list of preserved parameters can be found in the source code.
# This is an API workspace, having public visibility by default makes perfect sense.
package(default_visibility = ["//visibility:public"])
##############################################################################
# Common
##############################################################################
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
proto_library(
name = "networkmanagement_proto",
srcs = [
"connectivity_test.proto",
"reachability.proto",
"trace.proto",
],
deps = [
"//google/api:annotations_proto",
"//google/api:client_proto",
"//google/api:field_behavior_proto",
"//google/api:resource_proto",
"//google/longrunning:operations_proto",
"//google/rpc:status_proto",
"@com_google_protobuf//:field_mask_proto",
"@com_google_protobuf//:timestamp_proto",
],
)
proto_library_with_info(
name = "networkmanagement_proto_with_info",
deps = [
":networkmanagement_proto",
"//google/cloud:common_resources_proto",
],
)
##############################################################################
# Java
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"java_gapic_assembly_gradle_pkg",
"java_gapic_library",
"java_gapic_test",
"java_grpc_library",
"java_proto_library",
)
java_proto_library(
name = "networkmanagement_java_proto",
deps = [":networkmanagement_proto"],
)
java_grpc_library(
name = "networkmanagement_java_grpc",
srcs = [":networkmanagement_proto"],
deps = [":networkmanagement_java_proto"],
)
java_gapic_library(
name = "networkmanagement_java_gapic",
srcs = [":networkmanagement_proto_with_info"],
grpc_service_config = "networkmanagement_grpc_service_config.json",
test_deps = [
":networkmanagement_java_grpc",
],
deps = [
":networkmanagement_java_proto",
],
)
java_gapic_test(
name = "networkmanagement_java_gapic_test_suite",
test_classes = [
"com.google.cloud.networkmanagement.v1.ReachabilityServiceClientTest",
],
runtime_deps = [":networkmanagement_java_gapic_test"],
)
# Open Source Packages
java_gapic_assembly_gradle_pkg(
name = "google-cloud-networkmanagement-v1-java",
deps = [
":networkmanagement_java_gapic",
":networkmanagement_java_grpc",
":networkmanagement_java_proto",
":networkmanagement_proto",
],
)
##############################################################################
# Go
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"go_gapic_assembly_pkg",
"go_gapic_library",
"go_proto_library",
"go_test",
)
go_proto_library(
name = "networkmanagement_go_proto",
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
importpath = "google.golang.org/genproto/googleapis/cloud/networkmanagement/v1",
protos = [":networkmanagement_proto"],
deps = [
"//google/api:annotations_go_proto",
"//google/longrunning:longrunning_go_proto",
"//google/rpc:status_go_proto",
],
)
go_gapic_library(
name = "networkmanagement_go_gapic",
srcs = [":networkmanagement_proto_with_info"],
grpc_service_config = "networkmanagement_grpc_service_config.json",
importpath = "cloud.google.com/go/networkmanagement/apiv1;networkmanagement",
metadata = True,
service_yaml = "networkmanagement_v1.yaml",
deps = [
":networkmanagement_go_proto",
"//google/longrunning:longrunning_go_proto",
"@com_google_cloud_go//longrunning:go_default_library",
"@com_google_cloud_go//longrunning/autogen:go_default_library",
],
)
go_test(
name = "networkmanagement_go_gapic_test",
srcs = [":networkmanagement_go_gapic_srcjar_test"],
embed = [":networkmanagement_go_gapic"],
importpath = "cloud.google.com/go/networkmanagement/apiv1",
)
# Open Source Packages
go_gapic_assembly_pkg(
name = "gapi-cloud-networkmanagement-v1-go",
deps = [
":networkmanagement_go_gapic",
":networkmanagement_go_gapic_srcjar-metadata.srcjar",
":networkmanagement_go_gapic_srcjar-test.srcjar",
":networkmanagement_go_proto",
],
)
##############################################################################
# Python
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"py_gapic_assembly_pkg",
"py_gapic_library",
)
py_gapic_library(
name = "networkmanagement_py_gapic",
srcs = [":networkmanagement_proto"],
grpc_service_config = "networkmanagement_grpc_service_config.json",
)
# Open Source Packages
py_gapic_assembly_pkg(
name = "networkmanagement-v1-py",
deps = [
":networkmanagement_py_gapic",
],
)
##############################################################################
# PHP
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"php_gapic_assembly_pkg",
"php_gapic_library",
"php_grpc_library",
"php_proto_library",
)
php_proto_library(
name = "networkmanagement_php_proto",
deps = [":networkmanagement_proto"],
)
php_grpc_library(
name = "networkmanagement_php_grpc",
srcs = [":networkmanagement_proto"],
deps = [":networkmanagement_php_proto"],
)
php_gapic_library(
name = "networkmanagement_php_gapic",
srcs = [":networkmanagement_proto_with_info"],
grpc_service_config = "networkmanagement_grpc_service_config.json",
service_yaml = "networkmanagement_v1.yaml",
deps = [
":networkmanagement_php_grpc",
":networkmanagement_php_proto",
],
)
# Open Source Packages
php_gapic_assembly_pkg(
name = "google-cloud-networkmanagement-v1-php",
deps = [
":networkmanagement_php_gapic",
":networkmanagement_php_grpc",
":networkmanagement_php_proto",
],
)
##############################################################################
# Node.js
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"nodejs_gapic_assembly_pkg",
"nodejs_gapic_library",
)
nodejs_gapic_library(
name = "networkmanagement_nodejs_gapic",
package_name = "@google-cloud/networkmanagement",
src = ":networkmanagement_proto_with_info",
extra_protoc_parameters = ["metadata"],
grpc_service_config = "networkmanagement_grpc_service_config.json",
package = "google.cloud.networkmanagement.v1",
service_yaml = "networkmanagement_v1.yaml",
deps = [],
)
nodejs_gapic_assembly_pkg(
name = "networkmanagement-v1-nodejs",
deps = [
":networkmanagement_nodejs_gapic",
":networkmanagement_proto",
],
)
##############################################################################
# Ruby
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"ruby_cloud_gapic_library",
"ruby_gapic_assembly_pkg",
"ruby_grpc_library",
"ruby_proto_library",
)
ruby_proto_library(
name = "networkmanagement_ruby_proto",
deps = [":networkmanagement_proto"],
)
ruby_grpc_library(
name = "networkmanagement_ruby_grpc",
srcs = [":networkmanagement_proto"],
deps = [":networkmanagement_ruby_proto"],
)
ruby_cloud_gapic_library(
name = "networkmanagement_ruby_gapic",
srcs = [":networkmanagement_proto_with_info"],
extra_protoc_parameters = ["ruby-cloud-gem-name=google-cloud-networkmanagement-v1"],
grpc_service_config = "networkmanagement_grpc_service_config.json",
deps = [
":networkmanagement_ruby_grpc",
":networkmanagement_ruby_proto",
],
)
# Open Source Packages
ruby_gapic_assembly_pkg(
name = "google-cloud-networkmanagement-v1-ruby",
deps = [
":networkmanagement_ruby_gapic",
":networkmanagement_ruby_grpc",
":networkmanagement_ruby_proto",
],
)
##############################################################################
# C#
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"csharp_gapic_assembly_pkg",
"csharp_gapic_library",
"csharp_grpc_library",
"csharp_proto_library",
)
csharp_proto_library(
name = "networkmanagement_csharp_proto",
deps = [":networkmanagement_proto"],
)
csharp_grpc_library(
name = "networkmanagement_csharp_grpc",
srcs = [":networkmanagement_proto"],
deps = [":networkmanagement_csharp_proto"],
)
csharp_gapic_library(
name = "networkmanagement_csharp_gapic",
srcs = [":networkmanagement_proto_with_info"],
common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json",
grpc_service_config = "networkmanagement_grpc_service_config.json",
deps = [
":networkmanagement_csharp_grpc",
":networkmanagement_csharp_proto",
],
)
# Open Source Packages
csharp_gapic_assembly_pkg(
name = "google-cloud-networkmanagement-v1-csharp",
deps = [
":networkmanagement_csharp_gapic",
":networkmanagement_csharp_grpc",
":networkmanagement_csharp_proto",
],
)
##############################################################################
# C++
##############################################################################
# Put your C++ rules here

View file

@ -0,0 +1,225 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.networkmanagement.v1;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/networkmanagement/v1/trace.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/status.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Cloud.NetworkManagement.V1";
option go_package = "google.golang.org/genproto/googleapis/cloud/networkmanagement/v1;networkmanagement";
option java_multiple_files = true;
option java_outer_classname = "TestOuterClass";
option java_package = "com.google.cloud.networkmanagement.v1";
option php_namespace = "Google\\Cloud\\NetworkManagement\\V1";
option ruby_package = "Google::Cloud::NetworkManagement::V1";
// A Connectivity Test for a network reachability analysis.
message ConnectivityTest {
option (google.api.resource) = {
type: "networkmanagement.googleapis.com/ConnectivityTest"
pattern: "projects/{project}/locations/global/connectivityTests/{test}"
};
// Required. Unique name of the resource using the form:
// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
string name = 1 [(google.api.field_behavior) = REQUIRED];
// The user-supplied description of the Connectivity Test.
// Maximum of 512 characters.
string description = 2;
// Required. Source specification of the Connectivity Test.
//
// You can use a combination of source IP address, virtual machine
// (VM) instance, or Compute Engine network to uniquely identify
// the source location.
//
// Examples:
// If the source IP address is an internal IP address within a Google Cloud
// Virtual Private Cloud (VPC) network, then you must also specify the VPC
// network. Otherwise, specify the VM instance, which already contains its
// internal IP address and VPC network information.
//
// If the source of the test is within an on-premises network, then you must
// provide the destination VPC network.
//
// If the source endpoint is a Compute Engine VM instance with multiple
// network interfaces, the instance itself is not sufficient to identify the
// endpoint. So, you must also specify the source IP address or VPC network.
//
// A reachability analysis proceeds even if the source location is
// ambiguous. However, the test result may include endpoints that you don't
// intend to test.
Endpoint source = 3 [(google.api.field_behavior) = REQUIRED];
// Required. Destination specification of the Connectivity Test.
//
// You can use a combination of destination IP address, Compute Engine
// VM instance, or VPC network to uniquely identify the destination
// location.
//
// Even if the destination IP address is not unique, the source IP
// location is unique. Usually, the analysis can infer the destination
// endpoint from route information.
//
// If the destination you specify is a VM instance and the instance has
// multiple network interfaces, then you must also specify either
// a destination IP address or VPC network to identify the destination
// interface.
//
// A reachability analysis proceeds even if the destination location is
// ambiguous. However, the result can include endpoints that you don't
// intend to test.
Endpoint destination = 4 [(google.api.field_behavior) = REQUIRED];
// IP Protocol of the test. When not provided, "TCP" is assumed.
string protocol = 5;
// Other projects that may be relevant for reachability analysis.
// This is applicable to scenarios where a test can cross project boundaries.
repeated string related_projects = 6;
// Output only. The display name of a Connectivity Test.
string display_name = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
// Resource labels to represent user-provided metadata.
map<string, string> labels = 8;
// Output only. The time the test was created.
google.protobuf.Timestamp create_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The time the test's configuration was updated.
google.protobuf.Timestamp update_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The reachability details of this test from the latest run.
// The details are updated when creating a new test, updating an
// existing test, or triggering a one-time rerun of an existing test.
ReachabilityDetails reachability_details = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
}
// Source or destination of the Connectivity Test.
message Endpoint {
// The type definition of an endpoint's network. Use one of the
// following choices:
enum NetworkType {
// Default type if unspecified.
NETWORK_TYPE_UNSPECIFIED = 0;
// A network hosted within Google Cloud Platform.
// To receive more detailed output, specify the URI for the source or
// destination network.
GCP_NETWORK = 1;
// A network hosted outside of Google Cloud Platform.
// This can be an on-premises network, or a network hosted by another cloud
// provider.
NON_GCP_NETWORK = 2;
}
// The IP address of the endpoint, which can be an external or internal IP.
// An IPv6 address is only allowed when the test's destination is a
// [global load balancer VIP](/load-balancing/docs/load-balancing-overview).
string ip_address = 1;
// The IP protocol port of the endpoint.
// Only applicable when protocol is TCP or UDP.
int32 port = 2;
// A Compute Engine instance URI.
string instance = 3;
// A cluster URI for [Google Kubernetes Engine
// master](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture).
string gke_master_cluster = 7;
// A [Cloud SQL](https://cloud.google.com/sql) instance URI.
string cloud_sql_instance = 8;
// A Compute Engine network URI.
string network = 4;
// Type of the network where the endpoint is located.
// Applicable only to source endpoint, as destination network type can be
// inferred from the source.
NetworkType network_type = 5;
// Project ID where the endpoint is located.
// The Project ID can be derived from the URI if you provide a VM instance or
// network URI.
// The following are two cases where you must provide the project ID:
// 1. Only the IP address is specified, and the IP address is within a GCP
// project.
// 2. When you are using Shared VPC and the IP address that you provide is
// from the service project. In this case, the network that the IP address
// resides in is defined in the host project.
string project_id = 6;
}
// Results of the configuration analysis from the last run of the test.
message ReachabilityDetails {
// The overall result of the test's configuration analysis.
enum Result {
// No result was specified.
RESULT_UNSPECIFIED = 0;
// Possible scenarios are:
//
// * The configuration analysis determined that a packet originating from
// the source is expected to reach the destination.
// * The analysis didn't complete because the user lacks permission for
// some of the resources in the trace. However, at the time the user's
// permission became insufficient, the trace had been successful so far.
REACHABLE = 1;
// A packet originating from the source is expected to be dropped before
// reaching the destination.
UNREACHABLE = 2;
// The source and destination endpoints do not uniquely identify
// the test location in the network, and the reachability result contains
// multiple traces. For some traces, a packet could be delivered, and for
// others, it would not be.
AMBIGUOUS = 4;
// The configuration analysis did not complete. Possible reasons are:
//
// * A permissions error occurred--for example, the user might not have
// read permission for all of the resources named in the test.
// * An internal error occurred.
// * The analyzer received an invalid or unsupported argument or was unable
// to identify a known endpoint.
UNDETERMINED = 5;
}
// The overall result of the test's configuration analysis.
Result result = 1;
// The time of the configuration analysis.
google.protobuf.Timestamp verify_time = 2;
// The details of a failure or a cancellation of reachability analysis.
google.rpc.Status error = 3;
// Result may contain a list of traces if a test has multiple possible
// paths in the network, such as when destination endpoint is a load balancer
// with multiple backends.
repeated Trace traces = 5;
}

View file

@ -0,0 +1,12 @@
{
"methodConfig": [
{
"name": [
{
"service": "google.cloud.networkmanagement.v1.ReachabilityService"
}
],
"timeout": "60s"
}
]
}

View file

@ -0,0 +1,108 @@
type: google.api.Service
config_version: 3
name: networkmanagement.googleapis.com
title: Network Management API
apis:
- name: google.cloud.networkmanagement.v1.ReachabilityService
types:
- name: google.cloud.networkmanagement.v1.OperationMetadata
documentation:
summary: |-
The Network Management API provides a collection of network performance
monitoring and diagnostic capabilities.
rules:
- selector: google.cloud.location.Locations.GetLocation
description: Gets information about a location.
- selector: google.cloud.location.Locations.ListLocations
description: Lists information about the supported locations for this service.
- selector: google.iam.v1.IAMPolicy.GetIamPolicy
description: |-
Gets the access control policy for a resource. Returns an empty policy
if the resource exists and does not have a policy set.
- selector: google.iam.v1.IAMPolicy.SetIamPolicy
description: |-
Sets the access control policy on the specified resource. Replaces
any existing policy.
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
errors.
- selector: google.iam.v1.IAMPolicy.TestIamPermissions
description: |-
Returns permissions that a caller has on the specified resource. If the
resource does not exist, this will return an empty set of
permissions, not a `NOT_FOUND` error.
Note: This operation is designed to be used for building
permission-aware UIs and command-line tools, not for authorization
checking. This operation may "fail open" without warning.
backend:
rules:
- selector: google.cloud.location.Locations.GetLocation
deadline: 60.0
- selector: google.cloud.location.Locations.ListLocations
deadline: 60.0
- selector: google.cloud.networkmanagement.v1.ReachabilityService.GetConnectivityTest
deadline: 60.0
- selector: google.cloud.networkmanagement.v1.ReachabilityService.ListConnectivityTests
deadline: 60.0
- selector: 'google.iam.v1.IAMPolicy.*'
deadline: 60.0
- selector: 'google.longrunning.Operations.*'
deadline: 60.0
- selector: google.longrunning.Operations.GetOperation
deadline: 10.0
http:
rules:
- selector: google.cloud.location.Locations.GetLocation
get: '/v1/{name=projects/*/locations/*}'
- selector: google.cloud.location.Locations.ListLocations
get: '/v1/{name=projects/*}/locations'
- selector: google.iam.v1.IAMPolicy.GetIamPolicy
get: '/v1/{resource=projects/*/locations/global/connectivityTests/*}:getIamPolicy'
- selector: google.iam.v1.IAMPolicy.SetIamPolicy
post: '/v1/{resource=projects/*/locations/global/connectivityTests/*}:setIamPolicy'
body: '*'
- selector: google.iam.v1.IAMPolicy.TestIamPermissions
post: '/v1/{resource=projects/*/locations/global/connectivityTests/*}:testIamPermissions'
body: '*'
- selector: google.longrunning.Operations.CancelOperation
post: '/v1/{name=projects/*/locations/global/operations/*}:cancel'
body: '*'
- selector: google.longrunning.Operations.DeleteOperation
delete: '/v1/{name=projects/*/locations/global/operations/*}'
- selector: google.longrunning.Operations.GetOperation
get: '/v1/{name=projects/*/locations/global/operations/*}'
- selector: google.longrunning.Operations.ListOperations
get: '/v1/{name=projects/*/locations/global}/operations'
authentication:
rules:
- selector: google.cloud.location.Locations.GetLocation
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: google.cloud.location.Locations.ListLocations
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: 'google.cloud.networkmanagement.v1.ReachabilityService.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: 'google.iam.v1.IAMPolicy.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: 'google.longrunning.Operations.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform

View file

@ -0,0 +1,275 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.networkmanagement.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/networkmanagement/v1/connectivity_test.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Google.Cloud.NetworkManagement.V1";
option go_package = "google.golang.org/genproto/googleapis/cloud/networkmanagement/v1;networkmanagement";
option java_multiple_files = true;
option java_outer_classname = "ReachabilityServiceProto";
option java_package = "com.google.cloud.networkmanagement.v1";
option php_namespace = "Google\\Cloud\\NetworkManagement\\V1";
option ruby_package = "Google::Cloud::NetworkManagement::V1";
// The Reachability service in Google Cloud Network Management API
// The Reachability service in the Google Cloud Network Management API provides
// services that analyze the reachability within a single Google Virtual Private
// Cloud (VPC) network, between peered VPC networks, between VPC and on-premises
// networks, or between VPC networks and internet hosts. A reachability analysis
// is based on Google Cloud network configurations.
//
// You can use the analysis results to verify these configurations and
// to troubleshoot connectivity issues.
service ReachabilityService {
option (google.api.default_host) = "networkmanagement.googleapis.com";
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
// Lists all Connectivity Tests owned by a project.
rpc ListConnectivityTests(ListConnectivityTestsRequest) returns (ListConnectivityTestsResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/global}/connectivityTests"
};
option (google.api.method_signature) = "parent";
}
// Gets the details of a specific Connectivity Test.
rpc GetConnectivityTest(GetConnectivityTestRequest) returns (ConnectivityTest) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/global/connectivityTests/*}"
};
option (google.api.method_signature) = "name";
}
// Creates a new Connectivity Test.
// After you create a test, the reachability analysis is performed as part
// of the long running operation, which completes when the analysis completes.
//
// If the endpoint specifications in `ConnectivityTest` are invalid
// (for example, containing non-existent resources in the network, or you
// don't have read permissions to the network configurations of listed
// projects), then the reachability result returns a value of `UNKNOWN`.
//
// If the endpoint specifications in `ConnectivityTest` are
// incomplete, the reachability result returns a value of
// <code>AMBIGUOUS</code>. For more information,
// see the Connectivity Test documentation.
rpc CreateConnectivityTest(CreateConnectivityTestRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/global}/connectivityTests"
body: "resource"
};
option (google.api.method_signature) = "parent,test_id,resource";
option (google.longrunning.operation_info) = {
response_type: "google.cloud.networkmanagement.v1.ConnectivityTest"
metadata_type: "OperationMetadata"
};
}
// Updates the configuration of an existing `ConnectivityTest`.
// After you update a test, the reachability analysis is performed as part
// of the long running operation, which completes when the analysis completes.
// The Reachability state in the test resource is updated with the new result.
//
// If the endpoint specifications in `ConnectivityTest` are invalid
// (for example, they contain non-existent resources in the network, or the
// user does not have read permissions to the network configurations of
// listed projects), then the reachability result returns a value of
// <code>UNKNOWN</code>.
//
// If the endpoint specifications in `ConnectivityTest` are incomplete, the
// reachability result returns a value of `AMBIGUOUS`. See the documentation
// in `ConnectivityTest` for for more details.
rpc UpdateConnectivityTest(UpdateConnectivityTestRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1/{resource.name=projects/*/locations/global/connectivityTests/*}"
body: "resource"
};
option (google.api.method_signature) = "update_mask,resource";
option (google.longrunning.operation_info) = {
response_type: "google.cloud.networkmanagement.v1.ConnectivityTest"
metadata_type: "OperationMetadata"
};
}
// Rerun an existing `ConnectivityTest`.
// After the user triggers the rerun, the reachability analysis is performed
// as part of the long running operation, which completes when the analysis
// completes.
//
// Even though the test configuration remains the same, the reachability
// result may change due to underlying network configuration changes.
//
// If the endpoint specifications in `ConnectivityTest` become invalid (for
// example, specified resources are deleted in the network, or you lost
// read permissions to the network configurations of listed projects), then
// the reachability result returns a value of `UNKNOWN`.
rpc RerunConnectivityTest(RerunConnectivityTestRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/global/connectivityTests/*}:rerun"
body: "*"
};
option (google.longrunning.operation_info) = {
response_type: "google.cloud.networkmanagement.v1.ConnectivityTest"
metadata_type: "OperationMetadata"
};
}
// Deletes a specific `ConnectivityTest`.
rpc DeleteConnectivityTest(DeleteConnectivityTestRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/global/connectivityTests/*}"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "OperationMetadata"
};
}
}
// Request for the `ListConnectivityTests` method.
message ListConnectivityTestsRequest {
// Required. The parent resource of the Connectivity Tests:
// `projects/{project_id}/locations/global`
string parent = 1 [(google.api.field_behavior) = REQUIRED];
// Number of `ConnectivityTests` to return.
int32 page_size = 2;
// Page token from an earlier query, as returned in `next_page_token`.
string page_token = 3;
// Lists the `ConnectivityTests` that match the filter expression. A filter
// expression filters the resources listed in the response. The expression
// must be of the form `<field> <operator> <value>` where operators: `<`, `>`,
// `<=`,
// `>=`,
// `!=`, `=`, `:` are supported (colon `:` represents a HAS operator which is
// roughly synonymous with equality). <field> can refer to a proto or JSON
// field, or a synthetic field. Field names can be camelCase or snake_case.
//
// Examples:
// - Filter by name:
// name = "projects/proj-1/locations/global/connectivityTests/test-1
//
// - Filter by labels:
// - Resources that have a key called `foo`
// labels.foo:*
// - Resources that have a key called `foo` whose value is `bar`
// labels.foo = bar
string filter = 4;
// Field to use to sort the list.
string order_by = 5;
}
// Response for the `ListConnectivityTests` method.
message ListConnectivityTestsResponse {
// List of Connectivity Tests.
repeated ConnectivityTest resources = 1;
// Page token to fetch the next set of Connectivity Tests.
string next_page_token = 2;
// Locations that could not be reached (when querying all locations with `-`).
repeated string unreachable = 3;
}
// Request for the `GetConnectivityTest` method.
message GetConnectivityTestRequest {
// Required. `ConnectivityTest` resource name using the form:
// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
string name = 1 [(google.api.field_behavior) = REQUIRED];
}
// Request for the `CreateConnectivityTest` method.
message CreateConnectivityTestRequest {
// Required. The parent resource of the Connectivity Test to create:
// `projects/{project_id}/locations/global`
string parent = 1 [(google.api.field_behavior) = REQUIRED];
// Required. The logical name of the Connectivity Test in your project
// with the following restrictions:
//
// * Must contain only lowercase letters, numbers, and hyphens.
// * Must start with a letter.
// * Must be between 1-40 characters.
// * Must end with a number or a letter.
// * Must be unique within the customer project
string test_id = 2 [(google.api.field_behavior) = REQUIRED];
// Required. A `ConnectivityTest` resource
ConnectivityTest resource = 3 [(google.api.field_behavior) = REQUIRED];
}
// Request for the `UpdateConnectivityTest` method.
message UpdateConnectivityTestRequest {
// Required. Mask of fields to update. At least one path must be supplied in
// this field.
google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED];
// Required. Only fields specified in update_mask are updated.
ConnectivityTest resource = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request for the `DeleteConnectivityTest` method.
message DeleteConnectivityTestRequest {
// Required. Connectivity Test resource name using the form:
// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
string name = 1 [(google.api.field_behavior) = REQUIRED];
}
// Request for the `RerunConnectivityTest` method.
message RerunConnectivityTestRequest {
// Required. Connectivity Test resource name using the form:
// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
string name = 1 [(google.api.field_behavior) = REQUIRED];
}
// Metadata describing an [Operation][google.longrunning.Operation]
message OperationMetadata {
// The time the operation was created.
google.protobuf.Timestamp create_time = 1;
// The time the operation finished running.
google.protobuf.Timestamp end_time = 2;
// Target of the operation - for example
// projects/project-1/locations/global/connectivityTests/test-1
string target = 3;
// Name of the verb executed by the operation.
string verb = 4;
// Human-readable status of the operation, if any.
string status_detail = 5;
// Specifies if cancellation was requested for the operation.
bool cancel_requested = 6;
// API version.
string api_version = 7;
}

View file

@ -0,0 +1,891 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.networkmanagement.v1;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Cloud.NetworkManagement.V1";
option go_package = "google.golang.org/genproto/googleapis/cloud/networkmanagement/v1;networkmanagement";
option java_multiple_files = true;
option java_outer_classname = "TraceProto";
option java_package = "com.google.cloud.networkmanagement.v1";
option php_namespace = "Google\\Cloud\\NetworkManagement\\V1";
option ruby_package = "Google::Cloud::NetworkManagement::V1";
// Trace represents one simulated packet forwarding path.
//
// * Each trace contains multiple ordered steps.
// * Each step is in a particular state with associated configuration.
// * State is categorized as final or non-final states.
// * Each final state has a reason associated.
// * Each trace must end with a final state (the last step).
// ```
// |---------------------Trace----------------------|
// Step1(State) Step2(State) --- StepN(State(final))
// ```
message Trace {
// Derived from the source and destination endpoints definition specified by
// user request, and validated by the data plane model.
// If there are multiple traces starting from different source locations, then
// the endpoint_info may be different between traces.
EndpointInfo endpoint_info = 1;
// A trace of a test contains multiple steps from the initial state to the
// final state (delivered, dropped, forwarded, or aborted).
//
// The steps are ordered by the processing sequence within the simulated
// network state machine. It is critical to preserve the order of the steps
// and avoid reordering or sorting them.
repeated Step steps = 2;
}
// A simulated forwarding path is composed of multiple steps.
// Each step has a well-defined state and an associated configuration.
message Step {
// Type of states that are defined in the network state machine.
// Each step in the packet trace is in a specific state.
enum State {
// Unspecified state.
STATE_UNSPECIFIED = 0;
// Initial state: packet originating from a Compute Engine instance.
// An InstanceInfo is populated with starting instance information.
START_FROM_INSTANCE = 1;
// Initial state: packet originating from the internet.
// The endpoint information is populated.
START_FROM_INTERNET = 2;
// Initial state: packet originating from a VPC or on-premises network
// with internal source IP.
// If the source is a VPC network visible to the user, a NetworkInfo
// is populated with details of the network.
START_FROM_PRIVATE_NETWORK = 3;
// Initial state: packet originating from a Google Kubernetes Engine cluster
// master. A GKEMasterInfo is populated with starting instance information.
START_FROM_GKE_MASTER = 21;
// Initial state: packet originating from a Cloud SQL instance.
// A CloudSQLInstanceInfo is populated with starting instance information.
START_FROM_CLOUD_SQL_INSTANCE = 22;
// Config checking state: verify ingress firewall rule.
APPLY_INGRESS_FIREWALL_RULE = 4;
// Config checking state: verify egress firewall rule.
APPLY_EGRESS_FIREWALL_RULE = 5;
// Config checking state: verify route.
APPLY_ROUTE = 6;
// Config checking state: match forwarding rule.
APPLY_FORWARDING_RULE = 7;
// Config checking state: packet sent or received under foreign IP
// address and allowed.
SPOOFING_APPROVED = 8;
// Forwarding state: arriving at a Compute Engine instance.
ARRIVE_AT_INSTANCE = 9;
// Forwarding state: arriving at a Compute Engine internal load balancer.
ARRIVE_AT_INTERNAL_LOAD_BALANCER = 10;
// Forwarding state: arriving at a Compute Engine external load balancer.
ARRIVE_AT_EXTERNAL_LOAD_BALANCER = 11;
// Forwarding state: arriving at a Cloud VPN gateway.
ARRIVE_AT_VPN_GATEWAY = 12;
// Forwarding state: arriving at a Cloud VPN tunnel.
ARRIVE_AT_VPN_TUNNEL = 13;
// Transition state: packet header translated.
NAT = 14;
// Transition state: original connection is terminated and a new proxied
// connection is initiated.
PROXY_CONNECTION = 15;
// Final state: packet could be delivered.
DELIVER = 16;
// Final state: packet could be dropped.
DROP = 17;
// Final state: packet could be forwarded to a network with an unknown
// configuration.
FORWARD = 18;
// Final state: analysis is aborted.
ABORT = 19;
// Special state: viewer of the test result does not have permission to
// see the configuration in this step.
VIEWER_PERMISSION_MISSING = 20;
}
// A description of the step. Usually this is a summary of the state.
string description = 1;
// Each step is in one of the pre-defined states.
State state = 2;
// This is a step that leads to the final state Drop.
bool causes_drop = 3;
// Project ID that contains the configuration this step is validating.
string project_id = 4;
// Configuration or metadata associated with each step.
// The configuration is filtered based on viewer's permission. If a viewer
// has no permission to view the configuration in this step, for non-final
// states a special state is populated (VIEWER_PERMISSION_MISSING), and for
// final state the configuration is cleared.
oneof step_info {
// Display information of a Compute Engine instance.
InstanceInfo instance = 5;
// Display information of a Compute Engine firewall rule.
FirewallInfo firewall = 6;
// Display information of a Compute Engine route.
RouteInfo route = 7;
// Display information of the source and destination under analysis.
// The endpoint information in an intermediate state may differ with the
// initial input, as it might be modified by state like NAT,
// or Connection Proxy.
EndpointInfo endpoint = 8;
// Display information of a Compute Engine forwarding rule.
ForwardingRuleInfo forwarding_rule = 9;
// Display information of a Compute Engine VPN gateway.
VpnGatewayInfo vpn_gateway = 10;
// Display information of a Compute Engine VPN tunnel.
VpnTunnelInfo vpn_tunnel = 11;
// Display information of the final state "deliver" and reason.
DeliverInfo deliver = 12;
// Display information of the final state "forward" and reason.
ForwardInfo forward = 13;
// Display information of the final state "abort" and reason.
AbortInfo abort = 14;
// Display information of the final state "drop" and reason.
DropInfo drop = 15;
// Display information of the load balancers.
LoadBalancerInfo load_balancer = 16;
// Display information of a Google Cloud network.
NetworkInfo network = 17;
// Display information of a Google Kubernetes Engine cluster master.
GKEMasterInfo gke_master = 18;
// Display information of a Cloud SQL instance.
CloudSQLInstanceInfo cloud_sql_instance = 19;
}
}
// For display only. Metadata associated with a Compute Engine instance.
message InstanceInfo {
// Name of a Compute Engine instance.
string display_name = 1;
// URI of a Compute Engine instance.
string uri = 2;
// Name of the network interface of a Compute Engine instance.
string interface = 3;
// URI of a Compute Engine network.
string network_uri = 4;
// Internal IP address of the network interface.
string internal_ip = 5;
// External IP address of the network interface.
string external_ip = 6;
// Network tags configured on the instance.
repeated string network_tags = 7;
// Service account authorized for the instance.
string service_account = 8 [deprecated = true];
}
// For display only. Metadata associated with a Compute Engine network.
message NetworkInfo {
// Name of a Compute Engine network.
string display_name = 1;
// URI of a Compute Engine network.
string uri = 2;
// The IP range that matches the test.
string matched_ip_range = 4;
}
// For display only. Metadata associated with a VPC firewall rule, an implied
// VPC firewall rule, or a hierarchical firewall policy rule.
message FirewallInfo {
// The firewall rule's type.
enum FirewallRuleType {
// Unspecified type.
FIREWALL_RULE_TYPE_UNSPECIFIED = 0;
// Hierarchical firewall policy rule. For details, see
// [Hierarchical firewall policies
// overview](https://cloud.google.com/vpc/docs/firewall-policies).
HIERARCHICAL_FIREWALL_POLICY_RULE = 1;
// VPC firewall rule. For details, see
// [VPC firewall rules
// overview](https://cloud.google.com/vpc/docs/firewalls).
VPC_FIREWALL_RULE = 2;
// Implied VPC firewall rule. For details, see
// [Implied
// rules](https://cloud.google.com/vpc/docs/firewalls#default_firewall_rules).
IMPLIED_VPC_FIREWALL_RULE = 3;
}
// The display name of the VPC firewall rule. This field is not applicable
// to hierarchical firewall policy rules.
string display_name = 1;
// The URI of the VPC firewall rule. This field is not applicable to
// implied firewall rules or hierarchical firewall policy rules.
string uri = 2;
// Possible values: INGRESS, EGRESS
string direction = 3;
// Possible values: ALLOW, DENY
string action = 4;
// The priority of the firewall rule.
int32 priority = 5;
// The URI of the VPC network that the firewall rule is associated with.
// This field is not applicable to hierarchical firewall policy rules.
string network_uri = 6;
// The target tags defined by the VPC firewall rule. This field is not
// applicable to hierarchical firewall policy rules.
repeated string target_tags = 7;
// The target service accounts specified by the firewall rule.
repeated string target_service_accounts = 8;
// The hierarchical firewall policy that this rule is associated with.
// This field is not applicable to VPC firewall rules.
string policy = 9;
// The firewall rule's type.
FirewallRuleType firewall_rule_type = 10;
}
// For display only. Metadata associated with a Compute Engine route.
message RouteInfo {
// Type of route:
enum RouteType {
// Unspecified type. Default value.
ROUTE_TYPE_UNSPECIFIED = 0;
// Route is a subnet route automatically created by the system.
SUBNET = 1;
// Static route created by the user, including the default route to the
// internet.
STATIC = 2;
// Dynamic route exchanged between BGP peers.
DYNAMIC = 3;
// A subnet route received from peering network.
PEERING_SUBNET = 4;
// A static route received from peering network.
PEERING_STATIC = 5;
// A dynamic route received from peering network.
PEERING_DYNAMIC = 6;
}
// Type of next hop:
enum NextHopType {
// Unspecified type. Default value.
NEXT_HOP_TYPE_UNSPECIFIED = 0;
// Next hop is an IP address.
NEXT_HOP_IP = 1;
// Next hop is a Compute Engine instance.
NEXT_HOP_INSTANCE = 2;
// Next hop is a VPC network gateway.
NEXT_HOP_NETWORK = 3;
// Next hop is a peering VPC.
NEXT_HOP_PEERING = 4;
// Next hop is an interconnect.
NEXT_HOP_INTERCONNECT = 5;
// Next hop is a VPN tunnel.
NEXT_HOP_VPN_TUNNEL = 6;
// Next hop is a VPN gateway. This scenario only happens when tracing
// connectivity from an on-premises network to Google Cloud through a VPN.
// The analysis simulates a packet departing from the on-premises network
// through a VPN tunnel and arriving at a Cloud VPN gateway.
NEXT_HOP_VPN_GATEWAY = 7;
// Next hop is an internet gateway.
NEXT_HOP_INTERNET_GATEWAY = 8;
// Next hop is blackhole; that is, the next hop either does not exist or is
// not running.
NEXT_HOP_BLACKHOLE = 9;
// Next hop is the forwarding rule of an Internal Load Balancer.
NEXT_HOP_ILB = 10;
}
// Type of route.
RouteType route_type = 8;
// Type of next hop.
NextHopType next_hop_type = 9;
// Name of a Compute Engine route.
string display_name = 1;
// URI of a Compute Engine route.
// Dynamic route from cloud router does not have a URI.
// Advertised route from Google Cloud VPC to on-premises network also does
// not have a URI.
string uri = 2;
// Destination IP range of the route.
string dest_ip_range = 3;
// Next hop of the route.
string next_hop = 4;
// URI of a Compute Engine network.
string network_uri = 5;
// Priority of the route.
int32 priority = 6;
// Instance tags of the route.
repeated string instance_tags = 7;
}
// For display only. Metadata associated with a Compute Engine forwarding rule.
message ForwardingRuleInfo {
// Name of a Compute Engine forwarding rule.
string display_name = 1;
// URI of a Compute Engine forwarding rule.
string uri = 2;
// Protocol defined in the forwarding rule that matches the test.
string matched_protocol = 3;
// Port range defined in the forwarding rule that matches the test.
string matched_port_range = 6;
// VIP of the forwarding rule.
string vip = 4;
// Target type of the forwarding rule.
string target = 5;
// Network URI. Only valid for Internal Load Balancer.
string network_uri = 7;
}
// For display only. Metadata associated with a load balancer.
message LoadBalancerInfo {
// The type definition for a load balancer:
enum LoadBalancerType {
// Type is unspecified.
LOAD_BALANCER_TYPE_UNSPECIFIED = 0;
// Internal TCP/UDP load balancer.
INTERNAL_TCP_UDP = 1;
// Network TCP/UDP load balancer.
NETWORK_TCP_UDP = 2;
// HTTP(S) proxy load balancer.
HTTP_PROXY = 3;
// TCP proxy load balancer.
TCP_PROXY = 4;
// SSL proxy load balancer.
SSL_PROXY = 5;
}
// The type definition for a load balancer backend configuration:
enum BackendType {
// Type is unspecified.
BACKEND_TYPE_UNSPECIFIED = 0;
// Backend Service as the load balancer's backend.
BACKEND_SERVICE = 1;
// Target Pool as the load balancer's backend.
TARGET_POOL = 2;
}
// Type of the load balancer.
LoadBalancerType load_balancer_type = 1;
// URI of the health check for the load balancer.
string health_check_uri = 2;
// Information for the loadbalancer backends.
repeated LoadBalancerBackend backends = 3;
// Type of load balancer's backend configuration.
BackendType backend_type = 4;
// Backend configuration URI.
string backend_uri = 5;
}
// For display only. Metadata associated with a specific load balancer backend.
message LoadBalancerBackend {
// State of a health check firewall configuration:
enum HealthCheckFirewallState {
// State is unspecified. Default state if not populated.
HEALTH_CHECK_FIREWALL_STATE_UNSPECIFIED = 0;
// There are configured firewall rules to allow health check probes to the
// backend.
CONFIGURED = 1;
// There are firewall rules configured to allow partial health check ranges
// or block all health check ranges.
// If a health check probe is sent from denied IP ranges,
// the health check to the backend will fail. Then, the backend will be
// marked unhealthy and will not receive traffic sent to the load balancer.
MISCONFIGURED = 2;
}
// Name of a Compute Engine instance or network endpoint.
string display_name = 1;
// URI of a Compute Engine instance or network endpoint.
string uri = 2;
// State of the health check firewall configuration.
HealthCheckFirewallState health_check_firewall_state = 3;
// A list of firewall rule URIs allowing probes from health check IP ranges.
repeated string health_check_allowing_firewall_rules = 4;
// A list of firewall rule URIs blocking probes from health check IP ranges.
repeated string health_check_blocking_firewall_rules = 5;
}
// For display only. Metadata associated with a Compute Engine VPN gateway.
message VpnGatewayInfo {
// Name of a VPN gateway.
string display_name = 1;
// URI of a VPN gateway.
string uri = 2;
// URI of a Compute Engine network where the VPN gateway is configured.
string network_uri = 3;
// IP address of the VPN gateway.
string ip_address = 4;
// A VPN tunnel that is associated with this VPN gateway.
// There may be multiple VPN tunnels configured on a VPN gateway, and only
// the one relevant to the test is displayed.
string vpn_tunnel_uri = 5;
// Name of a Google Cloud region where this VPN gateway is configured.
string region = 6;
}
// For display only. Metadata associated with a Compute Engine VPN tunnel.
message VpnTunnelInfo {
// Types of VPN routing policy. For details, refer to [Networks and Tunnel
// routing](https://cloud.google.com/network-connectivity/docs/vpn/concepts/choosing-networks-routing/).
enum RoutingType {
// Unspecified type. Default value.
ROUTING_TYPE_UNSPECIFIED = 0;
// Route based VPN.
ROUTE_BASED = 1;
// Policy based routing.
POLICY_BASED = 2;
// Dynamic (BGP) routing.
DYNAMIC = 3;
}
// Name of a VPN tunnel.
string display_name = 1;
// URI of a VPN tunnel.
string uri = 2;
// URI of the VPN gateway at local end of the tunnel.
string source_gateway = 3;
// URI of a VPN gateway at remote end of the tunnel.
string remote_gateway = 4;
// Remote VPN gateway's IP address.
string remote_gateway_ip = 5;
// Local VPN gateway's IP address.
string source_gateway_ip = 6;
// URI of a Compute Engine network where the VPN tunnel is configured.
string network_uri = 7;
// Name of a Google Cloud region where this VPN tunnel is configured.
string region = 8;
// Type of the routing policy.
RoutingType routing_type = 9;
}
// For display only. The specification of the endpoints for the test.
// EndpointInfo is derived from source and destination Endpoint and validated
// by the backend data plane model.
message EndpointInfo {
// Source IP address.
string source_ip = 1;
// Destination IP address.
string destination_ip = 2;
// IP protocol in string format, for example: "TCP", "UDP", "ICMP".
string protocol = 3;
// Source port. Only valid when protocol is TCP or UDP.
int32 source_port = 4;
// Destination port. Only valid when protocol is TCP or UDP.
int32 destination_port = 5;
// URI of the network where this packet originates from.
string source_network_uri = 6;
// URI of the network where this packet is sent to.
string destination_network_uri = 7;
}
// Details of the final state "deliver" and associated resource.
message DeliverInfo {
// Deliver target types:
enum Target {
// Target not specified.
TARGET_UNSPECIFIED = 0;
// Target is a Compute Engine instance.
INSTANCE = 1;
// Target is the internet.
INTERNET = 2;
// Target is a Google API.
GOOGLE_API = 3;
// Target is a Google Kubernetes Engine cluster master.
GKE_MASTER = 4;
// Target is a Cloud SQL instance.
CLOUD_SQL_INSTANCE = 5;
}
// Target type where the packet is delivered to.
Target target = 1;
// URI of the resource that the packet is delivered to.
string resource_uri = 2;
}
// Details of the final state "forward" and associated resource.
message ForwardInfo {
// Forward target types.
enum Target {
// Target not specified.
TARGET_UNSPECIFIED = 0;
// Forwarded to a VPC peering network.
PEERING_VPC = 1;
// Forwarded to a Cloud VPN gateway.
VPN_GATEWAY = 2;
// Forwarded to a Cloud Interconnect connection.
INTERCONNECT = 3;
// Forwarded to a Google Kubernetes Engine Container cluster master.
GKE_MASTER = 4;
// Forwarded to the next hop of a custom route imported from a peering VPC.
IMPORTED_CUSTOM_ROUTE_NEXT_HOP = 5;
// Forwarded to a Cloud SQL instance.
CLOUD_SQL_INSTANCE = 6;
}
// Target type where this packet is forwarded to.
Target target = 1;
// URI of the resource that the packet is forwarded to.
string resource_uri = 2;
}
// Details of the final state "abort" and associated resource.
message AbortInfo {
// Abort cause types:
enum Cause {
// Cause is unspecified.
CAUSE_UNSPECIFIED = 0;
// Aborted due to unknown network.
// The reachability analysis cannot proceed because the user does not have
// access to the host project's network configurations, including firewall
// rules and routes. This happens when the project is a service project and
// the endpoints being traced are in the host project's network.
UNKNOWN_NETWORK = 1;
// Aborted because the IP address(es) are unknown.
UNKNOWN_IP = 2;
// Aborted because no project information can be derived from the test
// input.
UNKNOWN_PROJECT = 3;
// Aborted because the user lacks the permission to access all or part of
// the network configurations required to run the test.
PERMISSION_DENIED = 4;
// Aborted because no valid source endpoint is derived from the input test
// request.
NO_SOURCE_LOCATION = 5;
// Aborted because the source and/or destination endpoint specified in
// the test are invalid. The possible reasons that an endpoint is
// invalid include: malformed IP address; nonexistent instance or
// network URI; IP address not in the range of specified network URI; and
// instance not owning the network interface in the specified network.
INVALID_ARGUMENT = 6;
// Aborted because traffic is sent from a public IP to an instance without
// an external IP.
NO_EXTERNAL_IP = 7;
// Aborted because none of the traces matches destination information
// specified in the input test request.
UNINTENDED_DESTINATION = 8;
// Aborted because the number of steps in the trace exceeding a certain
// limit which may be caused by routing loop.
TRACE_TOO_LONG = 9;
// Aborted due to internal server error.
INTERNAL_ERROR = 10;
// Aborted because the source endpoint could not be found.
SOURCE_ENDPOINT_NOT_FOUND = 11;
// Aborted because the source network does not match the source endpoint.
MISMATCHED_SOURCE_NETWORK = 12;
// Aborted because the destination endpoint could not be found.
DESTINATION_ENDPOINT_NOT_FOUND = 13;
// Aborted because the destination network does not match the destination
// endpoint.
MISMATCHED_DESTINATION_NETWORK = 14;
}
// Causes that the analysis is aborted.
Cause cause = 1;
// URI of the resource that caused the abort.
string resource_uri = 2;
}
// Details of the final state "drop" and associated resource.
message DropInfo {
// Drop cause types:
enum Cause {
// Cause is unspecified.
CAUSE_UNSPECIFIED = 0;
// Destination external address cannot be resolved to a known target. If
// the address is used in a Google Cloud project, provide the project ID
// as test input.
UNKNOWN_EXTERNAL_ADDRESS = 1;
// A Compute Engine instance can only send or receive a packet with a
// foreign IP address if ip_forward is enabled.
FOREIGN_IP_DISALLOWED = 2;
// Dropped due to a firewall rule, unless allowed due to connection
// tracking.
FIREWALL_RULE = 3;
// Dropped due to no routes.
NO_ROUTE = 4;
// Dropped due to invalid route. Route's next hop is a blackhole.
ROUTE_BLACKHOLE = 5;
// Packet is sent to a wrong (unintended) network. Example: you trace a
// packet from VM1:Network1 to VM2:Network2, however, the route configured
// in Network1 sends the packet destined for VM2's IP addresss to Network3.
ROUTE_WRONG_NETWORK = 6;
// Packet with internal destination address sent to the internet gateway.
PRIVATE_TRAFFIC_TO_INTERNET = 7;
// Instance with only an internal IP address tries to access Google API and
// services, but private Google access is not enabled.
PRIVATE_GOOGLE_ACCESS_DISALLOWED = 8;
// Instance with only an internal IP address tries to access external hosts,
// but Cloud NAT is not enabled in the subnet, unless special configurations
// on a VM allow this connection. For more details, see [Special
// configurations for VM
// instances](https://cloud.google.com/vpc/docs/special-configurations).
NO_EXTERNAL_ADDRESS = 9;
// Destination internal address cannot be resolved to a known target. If
// this is a shared VPC scenario, verify if the service project ID is
// provided as test input. Otherwise, verify if the IP address is being
// used in the project.
UNKNOWN_INTERNAL_ADDRESS = 10;
// Forwarding rule's protocol and ports do not match the packet header.
FORWARDING_RULE_MISMATCH = 11;
// Forwarding rule does not have backends configured.
FORWARDING_RULE_NO_INSTANCES = 12;
// Firewalls block the health check probes to the backends and cause
// the backends to be unavailable for traffic from the load balancer.
// For more details, see [Health check firewall
// rules](https://cloud.google.com/load-balancing/docs/health-checks#firewall_rules).
FIREWALL_BLOCKING_LOAD_BALANCER_BACKEND_HEALTH_CHECK = 13;
// Packet is sent from or to a Compute Engine instance that is not in a
// running state.
INSTANCE_NOT_RUNNING = 14;
// The type of traffic is blocked and the user cannot configure a firewall
// rule to enable it. See [Always blocked
// traffic](https://cloud.google.com/vpc/docs/firewalls#blockedtraffic) for
// more details.
TRAFFIC_TYPE_BLOCKED = 15;
// Access to Google Kubernetes Engine cluster master's endpoint is not
// authorized. See [Access to the cluster
// endpoints](https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters#access_to_the_cluster_endpoints)
// for more details.
GKE_MASTER_UNAUTHORIZED_ACCESS = 16;
// Access to the Cloud SQL instance endpoint is not authorized.
// See [Authorizing with authorized
// networks](https://cloud.google.com/sql/docs/mysql/authorize-networks) for
// more details.
CLOUD_SQL_INSTANCE_UNAUTHORIZED_ACCESS = 17;
// Packet was dropped inside Google Kubernetes Engine Service.
DROPPED_INSIDE_GKE_SERVICE = 18;
// Packet was dropped inside Cloud SQL Service.
DROPPED_INSIDE_CLOUD_SQL_SERVICE = 19;
// Packet was dropped because there is no peering between the originating
// network and the Google Managed Services Network.
GOOGLE_MANAGED_SERVICE_NO_PEERING = 20;
// Packet was dropped because the Cloud SQL instance has neither a private
// nor a public IP address.
CLOUD_SQL_INSTANCE_NO_IP_ADDRESS = 21;
}
// Cause that the packet is dropped.
Cause cause = 1;
// URI of the resource that caused the drop.
string resource_uri = 2;
}
// For display only. Metadata associated with a Google Kubernetes Engine (GKE)
// cluster master.
message GKEMasterInfo {
// URI of a GKE cluster.
string cluster_uri = 2;
// URI of a GKE cluster network.
string cluster_network_uri = 4;
// Internal IP address of a GKE cluster master.
string internal_ip = 5;
// External IP address of a GKE cluster master.
string external_ip = 6;
}
// For display only. Metadata associated with a Cloud SQL instance.
message CloudSQLInstanceInfo {
// Name of a Cloud SQL instance.
string display_name = 1;
// URI of a Cloud SQL instance.
string uri = 2;
// URI of a Cloud SQL instance network or empty string if the instance does
// not have one.
string network_uri = 4;
// Internal IP address of a Cloud SQL instance.
string internal_ip = 5;
// External IP address of a Cloud SQL instance.
string external_ip = 6;
// Region in which the Cloud SQL instance is running.
string region = 7;
}

View file

@ -0,0 +1,341 @@
# This file was automatically generated by BuildFileGenerator
# https://github.com/googleapis/rules_gapic/tree/master/bazel
# Most of the manual changes to this file will be overwritten.
# It's **only** allowed to change the following rule attribute values:
# - names of *_gapic_assembly_* rules
# - certain parameters of *_gapic_library rules, including but not limited to:
# * extra_protoc_parameters
# * extra_protoc_file_parameters
# The complete list of preserved parameters can be found in the source code.
# This is an API workspace, having public visibility by default makes perfect sense.
package(default_visibility = ["//visibility:public"])
##############################################################################
# Common
##############################################################################
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
proto_library(
name = "networkmanagement_proto",
srcs = [
"connectivity_test.proto",
"reachability.proto",
"trace.proto",
],
deps = [
"//google/api:annotations_proto",
"//google/api:client_proto",
"//google/api:field_behavior_proto",
"//google/api:resource_proto",
"//google/longrunning:operations_proto",
"//google/rpc:status_proto",
"@com_google_protobuf//:field_mask_proto",
"@com_google_protobuf//:timestamp_proto",
],
)
proto_library_with_info(
name = "networkmanagement_proto_with_info",
deps = [
":networkmanagement_proto",
"//google/cloud:common_resources_proto",
],
)
##############################################################################
# Java
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"java_gapic_assembly_gradle_pkg",
"java_gapic_library",
"java_gapic_test",
"java_grpc_library",
"java_proto_library",
)
java_proto_library(
name = "networkmanagement_java_proto",
deps = [":networkmanagement_proto"],
)
java_grpc_library(
name = "networkmanagement_java_grpc",
srcs = [":networkmanagement_proto"],
deps = [":networkmanagement_java_proto"],
)
java_gapic_library(
name = "networkmanagement_java_gapic",
srcs = [":networkmanagement_proto_with_info"],
grpc_service_config = "networkmanagement_grpc_service_config.json",
test_deps = [
":networkmanagement_java_grpc",
],
deps = [
":networkmanagement_java_proto",
],
)
java_gapic_test(
name = "networkmanagement_java_gapic_test_suite",
test_classes = [
"com.google.cloud.networkmanagement.v1beta1.ReachabilityServiceClientTest",
],
runtime_deps = [":networkmanagement_java_gapic_test"],
)
# Open Source Packages
java_gapic_assembly_gradle_pkg(
name = "google-cloud-networkmanagement-v1beta1-java",
deps = [
":networkmanagement_java_gapic",
":networkmanagement_java_grpc",
":networkmanagement_java_proto",
":networkmanagement_proto",
],
)
##############################################################################
# Go
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"go_gapic_assembly_pkg",
"go_gapic_library",
"go_proto_library",
"go_test",
)
go_proto_library(
name = "networkmanagement_go_proto",
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
importpath = "google.golang.org/genproto/googleapis/cloud/networkmanagement/v1beta1",
protos = [":networkmanagement_proto"],
deps = [
"//google/api:annotations_go_proto",
"//google/longrunning:longrunning_go_proto",
"//google/rpc:status_go_proto",
],
)
go_gapic_library(
name = "networkmanagement_go_gapic",
srcs = [":networkmanagement_proto_with_info"],
grpc_service_config = "networkmanagement_grpc_service_config.json",
importpath = "cloud.google.com/go/networkmanagement/apiv1beta1;networkmanagement",
metadata = True,
service_yaml = "networkmanagement_v1beta1.yaml",
deps = [
":networkmanagement_go_proto",
"//google/longrunning:longrunning_go_proto",
"@com_google_cloud_go//longrunning:go_default_library",
"@com_google_cloud_go//longrunning/autogen:go_default_library",
],
)
go_test(
name = "networkmanagement_go_gapic_test",
srcs = [":networkmanagement_go_gapic_srcjar_test"],
embed = [":networkmanagement_go_gapic"],
importpath = "cloud.google.com/go/networkmanagement/apiv1beta1",
)
# Open Source Packages
go_gapic_assembly_pkg(
name = "gapi-cloud-networkmanagement-v1beta1-go",
deps = [
":networkmanagement_go_gapic",
":networkmanagement_go_gapic_srcjar-metadata.srcjar",
":networkmanagement_go_gapic_srcjar-test.srcjar",
":networkmanagement_go_proto",
],
)
##############################################################################
# Python
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"py_gapic_assembly_pkg",
"py_gapic_library",
)
py_gapic_library(
name = "networkmanagement_py_gapic",
srcs = [":networkmanagement_proto"],
grpc_service_config = "networkmanagement_grpc_service_config.json",
)
# Open Source Packages
py_gapic_assembly_pkg(
name = "networkmanagement-v1beta1-py",
deps = [
":networkmanagement_py_gapic",
],
)
##############################################################################
# PHP
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"php_gapic_assembly_pkg",
"php_gapic_library",
"php_grpc_library",
"php_proto_library",
)
php_proto_library(
name = "networkmanagement_php_proto",
deps = [":networkmanagement_proto"],
)
php_grpc_library(
name = "networkmanagement_php_grpc",
srcs = [":networkmanagement_proto"],
deps = [":networkmanagement_php_proto"],
)
php_gapic_library(
name = "networkmanagement_php_gapic",
srcs = [":networkmanagement_proto_with_info"],
grpc_service_config = "networkmanagement_grpc_service_config.json",
service_yaml = "networkmanagement_v1beta1.yaml",
deps = [
":networkmanagement_php_grpc",
":networkmanagement_php_proto",
],
)
# Open Source Packages
php_gapic_assembly_pkg(
name = "google-cloud-networkmanagement-v1beta1-php",
deps = [
":networkmanagement_php_gapic",
":networkmanagement_php_grpc",
":networkmanagement_php_proto",
],
)
##############################################################################
# Node.js
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"nodejs_gapic_assembly_pkg",
"nodejs_gapic_library",
)
nodejs_gapic_library(
name = "networkmanagement_nodejs_gapic",
package_name = "@google-cloud/networkmanagement",
src = ":networkmanagement_proto_with_info",
extra_protoc_parameters = ["metadata"],
grpc_service_config = "networkmanagement_grpc_service_config.json",
package = "google.cloud.networkmanagement.v1beta1",
service_yaml = "networkmanagement_v1beta1.yaml",
deps = [],
)
nodejs_gapic_assembly_pkg(
name = "networkmanagement-v1beta1-nodejs",
deps = [
":networkmanagement_nodejs_gapic",
":networkmanagement_proto",
],
)
##############################################################################
# Ruby
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"ruby_cloud_gapic_library",
"ruby_gapic_assembly_pkg",
"ruby_grpc_library",
"ruby_proto_library",
)
ruby_proto_library(
name = "networkmanagement_ruby_proto",
deps = [":networkmanagement_proto"],
)
ruby_grpc_library(
name = "networkmanagement_ruby_grpc",
srcs = [":networkmanagement_proto"],
deps = [":networkmanagement_ruby_proto"],
)
ruby_cloud_gapic_library(
name = "networkmanagement_ruby_gapic",
srcs = [":networkmanagement_proto_with_info"],
extra_protoc_parameters = ["ruby-cloud-gem-name=google-cloud-networkmanagement-v1beta1"],
grpc_service_config = "networkmanagement_grpc_service_config.json",
deps = [
":networkmanagement_ruby_grpc",
":networkmanagement_ruby_proto",
],
)
# Open Source Packages
ruby_gapic_assembly_pkg(
name = "google-cloud-networkmanagement-v1beta1-ruby",
deps = [
":networkmanagement_ruby_gapic",
":networkmanagement_ruby_grpc",
":networkmanagement_ruby_proto",
],
)
##############################################################################
# C#
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"csharp_gapic_assembly_pkg",
"csharp_gapic_library",
"csharp_grpc_library",
"csharp_proto_library",
)
csharp_proto_library(
name = "networkmanagement_csharp_proto",
deps = [":networkmanagement_proto"],
)
csharp_grpc_library(
name = "networkmanagement_csharp_grpc",
srcs = [":networkmanagement_proto"],
deps = [":networkmanagement_csharp_proto"],
)
csharp_gapic_library(
name = "networkmanagement_csharp_gapic",
srcs = [":networkmanagement_proto_with_info"],
common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json",
grpc_service_config = "networkmanagement_grpc_service_config.json",
deps = [
":networkmanagement_csharp_grpc",
":networkmanagement_csharp_proto",
],
)
# Open Source Packages
csharp_gapic_assembly_pkg(
name = "google-cloud-networkmanagement-v1beta1-csharp",
deps = [
":networkmanagement_csharp_gapic",
":networkmanagement_csharp_grpc",
":networkmanagement_csharp_proto",
],
)
##############################################################################
# C++
##############################################################################
# Put your C++ rules here

View file

@ -0,0 +1,313 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.networkmanagement.v1beta1;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/networkmanagement/v1beta1/trace.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/status.proto";
import "google/api/annotations.proto";
option csharp_namespace = "Google.Cloud.NetworkManagement.V1Beta1";
option go_package = "google.golang.org/genproto/googleapis/cloud/networkmanagement/v1beta1;networkmanagement";
option java_multiple_files = true;
option java_outer_classname = "TestOuterClass";
option java_package = "com.google.cloud.networkmanagement.v1beta1";
option php_namespace = "Google\\Cloud\\NetworkManagement\\V1beta1";
option ruby_package = "Google::Cloud::NetworkManagement::V1beta1";
// A Connectivity Test for a network reachability analysis.
message ConnectivityTest {
option (google.api.resource) = {
type: "networkmanagement.googleapis.com/ConnectivityTest"
pattern: "projects/{project}/locations/global/connectivityTests/{test}"
};
// Required. Unique name of the resource using the form:
// `projects/{project_id}/locations/global/connectivityTests/{test}`
string name = 1 [(google.api.field_behavior) = REQUIRED];
// The user-supplied description of the Connectivity Test.
// Maximum of 512 characters.
string description = 2;
// Required. Source specification of the Connectivity Test.
//
// You can use a combination of source IP address, virtual machine
// (VM) instance, or Compute Engine network to uniquely identify
// the source location.
//
// Examples:
// If the source IP address is an internal IP address within a Google Cloud
// Virtual Private Cloud (VPC) network, then you must also specify the VPC
// network. Otherwise, specify the VM instance, which already contains its
// internal IP address and VPC network information.
//
// If the source of the test is within an on-premises network, then you must
// provide the destination VPC network.
//
// If the source endpoint is a Compute Engine VM instance with multiple
// network interfaces, the instance itself is not sufficient to identify the
// endpoint. So, you must also specify the source IP address or VPC network.
//
// A reachability analysis proceeds even if the source location is
// ambiguous. However, the test result may include endpoints that you don't
// intend to test.
Endpoint source = 3 [(google.api.field_behavior) = REQUIRED];
// Required. Destination specification of the Connectivity Test.
//
// You can use a combination of destination IP address, Compute Engine
// VM instance, or VPC network to uniquely identify the destination
// location.
//
// Even if the destination IP address is not unique, the source IP
// location is unique. Usually, the analysis can infer the destination
// endpoint from route information.
//
// If the destination you specify is a VM instance and the instance has
// multiple network interfaces, then you must also specify either
// a destination IP address or VPC network to identify the destination
// interface.
//
// A reachability analysis proceeds even if the destination location is
// ambiguous. However, the result can include endpoints that you don't
// intend to test.
Endpoint destination = 4 [(google.api.field_behavior) = REQUIRED];
// IP Protocol of the test. When not provided, "TCP" is assumed.
string protocol = 5;
// Other projects that may be relevant for reachability analysis.
// This is applicable to scenarios where a test can cross project boundaries.
repeated string related_projects = 6;
// Output only. The display name of a Connectivity Test.
string display_name = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
// Resource labels to represent user-provided metadata.
map<string, string> labels = 8;
// Output only. The time the test was created.
google.protobuf.Timestamp create_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The time the test's configuration was updated.
google.protobuf.Timestamp update_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The reachability details of this test from the latest run.
// The details are updated when creating a new test, updating an
// existing test, or triggering a one-time rerun of an existing test.
ReachabilityDetails reachability_details = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The probing details of this test from the latest run, present for
// applicable tests only. The details are updated when creating a new test,
// updating an existing test, or triggering a one-time rerun of an existing
// test.
ProbingDetails probing_details = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
}
// Source or destination of the Connectivity Test.
message Endpoint {
// The type definition of an endpoint's network. Use one of the
// following choices:
enum NetworkType {
// Default type if unspecified.
NETWORK_TYPE_UNSPECIFIED = 0;
// A network hosted within Google Cloud Platform.
// To receive more detailed output, specify the URI for the source or
// destination network.
GCP_NETWORK = 1;
// A network hosted outside of Google Cloud Platform.
// This can be an on-premises network, or a network hosted by another cloud
// provider.
NON_GCP_NETWORK = 2;
}
// The IP address of the endpoint, which can be an external or internal IP.
// An IPv6 address is only allowed when the test's destination is a
// [global load balancer
// VIP](https://cloud.google.com/load-balancing/docs/load-balancing-overview).
string ip_address = 1;
// The IP protocol port of the endpoint.
// Only applicable when protocol is TCP or UDP.
int32 port = 2;
// A Compute Engine instance URI.
string instance = 3;
// A cluster URI for [Google Kubernetes Engine
// master](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture).
string gke_master_cluster = 7;
// A [Cloud SQL](https://cloud.google.com/sql) instance URI.
string cloud_sql_instance = 8;
// A Compute Engine network URI.
string network = 4;
// Type of the network where the endpoint is located.
// Applicable only to source endpoint, as destination network type can be
// inferred from the source.
NetworkType network_type = 5;
// Project ID where the endpoint is located.
// The Project ID can be derived from the URI if you provide a VM instance or
// network URI.
// The following are two cases where you must provide the project ID:
// 1. Only the IP address is specified, and the IP address is within a GCP
// project.
// 2. When you are using Shared VPC and the IP address that you provide is
// from the service project. In this case, the network that the IP address
// resides in is defined in the host project.
string project_id = 6;
}
// Results of the configuration analysis from the last run of the test.
message ReachabilityDetails {
// The overall result of the test's configuration analysis.
enum Result {
// No result was specified.
RESULT_UNSPECIFIED = 0;
// Possible scenarios are:
//
// * The configuration analysis determined that a packet originating from
// the source is expected to reach the destination.
// * The analysis didn't complete because the user lacks permission for
// some of the resources in the trace. However, at the time the user's
// permission became insufficient, the trace had been successful so far.
REACHABLE = 1;
// A packet originating from the source is expected to be dropped before
// reaching the destination.
UNREACHABLE = 2;
// The source and destination endpoints do not uniquely identify
// the test location in the network, and the reachability result contains
// multiple traces. For some traces, a packet could be delivered, and for
// others, it would not be.
AMBIGUOUS = 4;
// The configuration analysis did not complete. Possible reasons are:
//
// * A permissions error occurred--for example, the user might not have
// read permission for all of the resources named in the test.
// * An internal error occurred.
// * The analyzer received an invalid or unsupported argument or was unable
// to identify a known endpoint.
UNDETERMINED = 5;
}
// The overall result of the test's configuration analysis.
Result result = 1;
// The time of the configuration analysis.
google.protobuf.Timestamp verify_time = 2;
// The details of a failure or a cancellation of reachability analysis.
google.rpc.Status error = 3;
// Result may contain a list of traces if a test has multiple possible
// paths in the network, such as when destination endpoint is a load balancer
// with multiple backends.
repeated Trace traces = 5;
}
// Latency percentile rank and value.
message LatencyPercentile {
// Percentage of samples this data point applies to.
int32 percent = 1;
// percent-th percentile of latency observed, in microseconds.
// Fraction of percent/100 of samples have latency lower or
// equal to the value of this field.
int64 latency_micros = 2;
}
// Describes measured latency distribution.
message LatencyDistribution {
// Representative latency percentiles.
repeated LatencyPercentile latency_percentiles = 1;
}
// Results of active probing from the last run of the test.
message ProbingDetails {
// Overall probing result of the test.
enum ProbingResult {
// No result was specified.
PROBING_RESULT_UNSPECIFIED = 0;
// At least 95% of packets reached the destination.
REACHABLE = 1;
// No packets reached the destination.
UNREACHABLE = 2;
// Less than 95% of packets reached the destination.
REACHABILITY_INCONSISTENT = 3;
// Reachability could not be determined. Possible reasons are:
// * The user lacks permission to access some of the network resources
// required to run the test.
// * No valid source endpoint could be derived from the request.
// * An internal error occurred.
UNDETERMINED = 4;
}
// Abort cause types.
enum ProbingAbortCause {
// No reason was specified.
PROBING_ABORT_CAUSE_UNSPECIFIED = 0;
// The user lacks permission to access some of the
// network resources required to run the test.
PERMISSION_DENIED = 1;
// No valid source endpoint could be derived from the request.
NO_SOURCE_LOCATION = 2;
}
// The overall result of active probing.
ProbingResult result = 1;
// The time that reachability was assessed through active probing.
google.protobuf.Timestamp verify_time = 2;
// Details about an internal failure or the cancellation of active probing.
google.rpc.Status error = 3;
// The reason probing was aborted.
ProbingAbortCause abort_cause = 4;
// Number of probes sent.
int32 sent_probe_count = 5;
// Number of probes that reached the destination.
int32 successful_probe_count = 6;
// The source and destination endpoints derived from the test input and used
// for active probing.
EndpointInfo endpoint_info = 7;
// Latency as measured by active probing in one direction:
// from the source to the destination endpoint.
LatencyDistribution probing_latency = 8;
}

View file

@ -0,0 +1,12 @@
{
"methodConfig": [
{
"name": [
{
"service": "google.cloud.networkmanagement.v1beta1.ReachabilityService"
}
],
"timeout": "60s"
}
]
}

View file

@ -0,0 +1,108 @@
type: google.api.Service
config_version: 3
name: networkmanagement.googleapis.com
title: Network Management API
apis:
- name: google.cloud.networkmanagement.v1beta1.ReachabilityService
types:
- name: google.cloud.networkmanagement.v1beta1.OperationMetadata
documentation:
summary: |-
The Network Management API provides a collection of network performance
monitoring and diagnostic capabilities.
rules:
- selector: google.cloud.location.Locations.GetLocation
description: Gets information about a location.
- selector: google.cloud.location.Locations.ListLocations
description: Lists information about the supported locations for this service.
- selector: google.iam.v1.IAMPolicy.GetIamPolicy
description: |-
Gets the access control policy for a resource. Returns an empty policy
if the resource exists and does not have a policy set.
- selector: google.iam.v1.IAMPolicy.SetIamPolicy
description: |-
Sets the access control policy on the specified resource. Replaces
any existing policy.
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
errors.
- selector: google.iam.v1.IAMPolicy.TestIamPermissions
description: |-
Returns permissions that a caller has on the specified resource. If the
resource does not exist, this will return an empty set of
permissions, not a `NOT_FOUND` error.
Note: This operation is designed to be used for building
permission-aware UIs and command-line tools, not for authorization
checking. This operation may "fail open" without warning.
backend:
rules:
- selector: google.cloud.location.Locations.GetLocation
deadline: 60.0
- selector: google.cloud.location.Locations.ListLocations
deadline: 60.0
- selector: google.cloud.networkmanagement.v1beta1.ReachabilityService.GetConnectivityTest
deadline: 60.0
- selector: google.cloud.networkmanagement.v1beta1.ReachabilityService.ListConnectivityTests
deadline: 60.0
- selector: 'google.iam.v1.IAMPolicy.*'
deadline: 60.0
- selector: 'google.longrunning.Operations.*'
deadline: 60.0
- selector: google.longrunning.Operations.GetOperation
deadline: 10.0
http:
rules:
- selector: google.cloud.location.Locations.GetLocation
get: '/v1beta1/{name=projects/*/locations/*}'
- selector: google.cloud.location.Locations.ListLocations
get: '/v1beta1/{name=projects/*}/locations'
- selector: google.iam.v1.IAMPolicy.GetIamPolicy
get: '/v1beta1/{resource=projects/*/locations/global/connectivityTests/*}:getIamPolicy'
- selector: google.iam.v1.IAMPolicy.SetIamPolicy
post: '/v1beta1/{resource=projects/*/locations/global/connectivityTests/*}:setIamPolicy'
body: '*'
- selector: google.iam.v1.IAMPolicy.TestIamPermissions
post: '/v1beta1/{resource=projects/*/locations/global/connectivityTests/*}:testIamPermissions'
body: '*'
- selector: google.longrunning.Operations.CancelOperation
post: '/v1beta1/{name=projects/*/locations/global/operations/*}:cancel'
body: '*'
- selector: google.longrunning.Operations.DeleteOperation
delete: '/v1beta1/{name=projects/*/locations/global/operations/*}'
- selector: google.longrunning.Operations.GetOperation
get: '/v1beta1/{name=projects/*/locations/global/operations/*}'
- selector: google.longrunning.Operations.ListOperations
get: '/v1beta1/{name=projects/*/locations/global}/operations'
authentication:
rules:
- selector: google.cloud.location.Locations.GetLocation
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: google.cloud.location.Locations.ListLocations
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: 'google.cloud.networkmanagement.v1beta1.ReachabilityService.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: 'google.iam.v1.IAMPolicy.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: 'google.longrunning.Operations.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform

View file

@ -0,0 +1,270 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.networkmanagement.v1beta1;
import "google/api/annotations.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/networkmanagement/v1beta1/connectivity_test.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "google/api/client.proto";
option csharp_namespace = "Google.Cloud.NetworkManagement.V1Beta1";
option go_package = "google.golang.org/genproto/googleapis/cloud/networkmanagement/v1beta1;networkmanagement";
option java_multiple_files = true;
option java_outer_classname = "ReachabilityServiceProto";
option java_package = "com.google.cloud.networkmanagement.v1beta1";
option php_namespace = "Google\\Cloud\\NetworkManagement\\V1beta1";
option ruby_package = "Google::Cloud::NetworkManagement::V1beta1";
// The Reachability service in Google Cloud Network Management API
// The Reachability service in the Google Cloud Network Management API provides
// services that analyze the reachability within a single Google Virtual Private
// Cloud (VPC) network, between peered VPC networks, between VPC and on-premises
// networks, or between VPC networks and internet hosts. A reachability analysis
// is based on Google Cloud network configurations.
//
// You can use the analysis results to verify these configurations and
// to troubleshoot connectivity issues.
service ReachabilityService {
option (google.api.default_host) = "networkmanagement.googleapis.com";
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
// Lists all Connectivity Tests owned by a project.
rpc ListConnectivityTests(ListConnectivityTestsRequest) returns (ListConnectivityTestsResponse) {
option (google.api.http) = {
get: "/v1beta1/{parent=projects/*/locations/global}/connectivityTests"
};
}
// Gets the details of a specific Connectivity Test.
rpc GetConnectivityTest(GetConnectivityTestRequest) returns (ConnectivityTest) {
option (google.api.http) = {
get: "/v1beta1/{name=projects/*/locations/global/connectivityTests/*}"
};
}
// Creates a new Connectivity Test.
// After you create a test, the reachability analysis is performed as part
// of the long running operation, which completes when the analysis completes.
//
// If the endpoint specifications in `ConnectivityTest` are invalid
// (for example, containing non-existent resources in the network, or you
// don't have read permissions to the network configurations of listed
// projects), then the reachability result returns a value of `UNKNOWN`.
//
// If the endpoint specifications in `ConnectivityTest` are
// incomplete, the reachability result returns a value of
// <code>AMBIGUOUS</code>. For more information,
// see the Connectivity Test documentation.
rpc CreateConnectivityTest(CreateConnectivityTestRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1beta1/{parent=projects/*/locations/global}/connectivityTests"
body: "resource"
};
option (google.longrunning.operation_info) = {
response_type: "google.cloud.networkmanagement.v1beta1.ConnectivityTest"
metadata_type: "OperationMetadata"
};
}
// Updates the configuration of an existing `ConnectivityTest`.
// After you update a test, the reachability analysis is performed as part
// of the long running operation, which completes when the analysis completes.
// The Reachability state in the test resource is updated with the new result.
//
// If the endpoint specifications in `ConnectivityTest` are invalid
// (for example, they contain non-existent resources in the network, or the
// user does not have read permissions to the network configurations of
// listed projects), then the reachability result returns a value of
// <code>UNKNOWN</code>.
//
// If the endpoint specifications in `ConnectivityTest` are incomplete, the
// reachability result returns a value of `AMBIGUOUS`. See the documentation
// in `ConnectivityTest` for for more details.
rpc UpdateConnectivityTest(UpdateConnectivityTestRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1beta1/{resource.name=projects/*/locations/global/connectivityTests/*}"
body: "resource"
};
option (google.longrunning.operation_info) = {
response_type: "google.cloud.networkmanagement.v1beta1.ConnectivityTest"
metadata_type: "OperationMetadata"
};
}
// Rerun an existing `ConnectivityTest`.
// After the user triggers the rerun, the reachability analysis is performed
// as part of the long running operation, which completes when the analysis
// completes.
//
// Even though the test configuration remains the same, the reachability
// result may change due to underlying network configuration changes.
//
// If the endpoint specifications in `ConnectivityTest` become invalid (for
// example, specified resources are deleted in the network, or you lost
// read permissions to the network configurations of listed projects), then
// the reachability result returns a value of `UNKNOWN`.
rpc RerunConnectivityTest(RerunConnectivityTestRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1beta1/{name=projects/*/locations/global/connectivityTests/*}:rerun"
body: "*"
};
option (google.longrunning.operation_info) = {
response_type: "google.cloud.networkmanagement.v1beta1.ConnectivityTest"
metadata_type: "OperationMetadata"
};
}
// Deletes a specific `ConnectivityTest`.
rpc DeleteConnectivityTest(DeleteConnectivityTestRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1beta1/{name=projects/*/locations/global/connectivityTests/*}"
};
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "OperationMetadata"
};
}
}
// Request for the `ListConnectivityTests` method.
message ListConnectivityTestsRequest {
// Required. The parent resource of the Connectivity Tests:
// `projects/{project_id}/locations/global`
string parent = 1 [(google.api.field_behavior) = REQUIRED];
// Number of `ConnectivityTests` to return.
int32 page_size = 2;
// Page token from an earlier query, as returned in `next_page_token`.
string page_token = 3;
// Lists the `ConnectivityTests` that match the filter expression. A filter
// expression filters the resources listed in the response. The expression
// must be of the form `<field> <operator> <value>` where operators: `<`, `>`,
// `<=`,
// `>=`,
// `!=`, `=`, `:` are supported (colon `:` represents a HAS operator which is
// roughly synonymous with equality). <field> can refer to a proto or JSON
// field, or a synthetic field. Field names can be camelCase or snake_case.
//
// Examples:
// - Filter by name:
// name = "projects/proj-1/locations/global/connectivityTests/test-1
//
// - Filter by labels:
// - Resources that have a key called `foo`
// labels.foo:*
// - Resources that have a key called `foo` whose value is `bar`
// labels.foo = bar
string filter = 4;
// Field to use to sort the list.
string order_by = 5;
}
// Response for the `ListConnectivityTests` method.
message ListConnectivityTestsResponse {
// List of Connectivity Tests.
repeated ConnectivityTest resources = 1;
// Page token to fetch the next set of Connectivity Tests.
string next_page_token = 2;
// Locations that could not be reached (when querying all locations with `-`).
repeated string unreachable = 3;
}
// Request for the `GetConnectivityTest` method.
message GetConnectivityTestRequest {
// Required. `ConnectivityTest` resource name using the form:
// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
string name = 1 [(google.api.field_behavior) = REQUIRED];
}
// Request for the `CreateConnectivityTest` method.
message CreateConnectivityTestRequest {
// Required. The parent resource of the Connectivity Test to create:
// `projects/{project_id}/locations/global`
string parent = 1 [(google.api.field_behavior) = REQUIRED];
// Required. The logical name of the Connectivity Test in your project
// with the following restrictions:
//
// * Must contain only lowercase letters, numbers, and hyphens.
// * Must start with a letter.
// * Must be between 1-40 characters.
// * Must end with a number or a letter.
// * Must be unique within the customer project
string test_id = 2 [(google.api.field_behavior) = REQUIRED];
// Required. A `ConnectivityTest` resource
ConnectivityTest resource = 3 [(google.api.field_behavior) = REQUIRED];
}
// Request for the `UpdateConnectivityTest` method.
message UpdateConnectivityTestRequest {
// Required. Mask of fields to update. At least one path must be supplied in
// this field.
google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED];
// Required. Only fields specified in update_mask are updated.
ConnectivityTest resource = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request for the `DeleteConnectivityTest` method.
message DeleteConnectivityTestRequest {
// Required. Connectivity Test resource name using the form:
// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
string name = 1 [(google.api.field_behavior) = REQUIRED];
}
// Request for the `RerunConnectivityTest` method.
message RerunConnectivityTestRequest {
// Required. Connectivity Test resource name using the form:
// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
string name = 1 [(google.api.field_behavior) = REQUIRED];
}
// Metadata describing an [Operation][google.longrunning.Operation]
message OperationMetadata {
// The time the operation was created.
google.protobuf.Timestamp create_time = 1;
// The time the operation finished running.
google.protobuf.Timestamp end_time = 2;
// Target of the operation - for example
// projects/project-1/locations/global/connectivityTests/test-1
string target = 3;
// Name of the verb executed by the operation.
string verb = 4;
// Human-readable status of the operation, if any.
string status_detail = 5;
// Specifies if cancellation was requested for the operation.
bool cancel_requested = 6;
// API version.
string api_version = 7;
}

View file

@ -0,0 +1,891 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.networkmanagement.v1beta1;
import "google/api/annotations.proto";
option csharp_namespace = "Google.Cloud.NetworkManagement.V1Beta1";
option go_package = "google.golang.org/genproto/googleapis/cloud/networkmanagement/v1beta1;networkmanagement";
option java_multiple_files = true;
option java_outer_classname = "TraceProto";
option java_package = "com.google.cloud.networkmanagement.v1beta1";
option php_namespace = "Google\\Cloud\\NetworkManagement\\V1beta1";
option ruby_package = "Google::Cloud::NetworkManagement::V1beta1";
// Trace represents one simulated packet forwarding path.
//
// * Each trace contains multiple ordered steps.
// * Each step is in a particular state with associated configuration.
// * State is categorized as final or non-final states.
// * Each final state has a reason associated.
// * Each trace must end with a final state (the last step).
// ```
// |---------------------Trace----------------------|
// Step1(State) Step2(State) --- StepN(State(final))
// ```
message Trace {
// Derived from the source and destination endpoints definition specified by
// user request, and validated by the data plane model.
// If there are multiple traces starting from different source locations, then
// the endpoint_info may be different between traces.
EndpointInfo endpoint_info = 1;
// A trace of a test contains multiple steps from the initial state to the
// final state (delivered, dropped, forwarded, or aborted).
//
// The steps are ordered by the processing sequence within the simulated
// network state machine. It is critical to preserve the order of the steps
// and avoid reordering or sorting them.
repeated Step steps = 2;
}
// A simulated forwarding path is composed of multiple steps.
// Each step has a well-defined state and an associated configuration.
message Step {
// Type of states that are defined in the network state machine.
// Each step in the packet trace is in a specific state.
enum State {
// Unspecified state.
STATE_UNSPECIFIED = 0;
// Initial state: packet originating from a Compute Engine instance.
// An InstanceInfo is populated with starting instance information.
START_FROM_INSTANCE = 1;
// Initial state: packet originating from the internet.
// The endpoint information is populated.
START_FROM_INTERNET = 2;
// Initial state: packet originating from a VPC or on-premises network
// with internal source IP.
// If the source is a VPC network visible to the user, a NetworkInfo
// is populated with details of the network.
START_FROM_PRIVATE_NETWORK = 3;
// Initial state: packet originating from a Google Kubernetes Engine cluster
// master. A GKEMasterInfo is populated with starting instance information.
START_FROM_GKE_MASTER = 21;
// Initial state: packet originating from a Cloud SQL instance.
// A CloudSQLInstanceInfo is populated with starting instance information.
START_FROM_CLOUD_SQL_INSTANCE = 22;
// Config checking state: verify ingress firewall rule.
APPLY_INGRESS_FIREWALL_RULE = 4;
// Config checking state: verify egress firewall rule.
APPLY_EGRESS_FIREWALL_RULE = 5;
// Config checking state: verify route.
APPLY_ROUTE = 6;
// Config checking state: match forwarding rule.
APPLY_FORWARDING_RULE = 7;
// Config checking state: packet sent or received under foreign IP
// address and allowed.
SPOOFING_APPROVED = 8;
// Forwarding state: arriving at a Compute Engine instance.
ARRIVE_AT_INSTANCE = 9;
// Forwarding state: arriving at a Compute Engine internal load balancer.
ARRIVE_AT_INTERNAL_LOAD_BALANCER = 10;
// Forwarding state: arriving at a Compute Engine external load balancer.
ARRIVE_AT_EXTERNAL_LOAD_BALANCER = 11;
// Forwarding state: arriving at a Cloud VPN gateway.
ARRIVE_AT_VPN_GATEWAY = 12;
// Forwarding state: arriving at a Cloud VPN tunnel.
ARRIVE_AT_VPN_TUNNEL = 13;
// Transition state: packet header translated.
NAT = 14;
// Transition state: original connection is terminated and a new proxied
// connection is initiated.
PROXY_CONNECTION = 15;
// Final state: packet could be delivered.
DELIVER = 16;
// Final state: packet could be dropped.
DROP = 17;
// Final state: packet could be forwarded to a network with an unknown
// configuration.
FORWARD = 18;
// Final state: analysis is aborted.
ABORT = 19;
// Special state: viewer of the test result does not have permission to
// see the configuration in this step.
VIEWER_PERMISSION_MISSING = 20;
}
// A description of the step. Usually this is a summary of the state.
string description = 1;
// Each step is in one of the pre-defined states.
State state = 2;
// This is a step that leads to the final state Drop.
bool causes_drop = 3;
// Project ID that contains the configuration this step is validating.
string project_id = 4;
// Configuration or metadata associated with each step.
// The configuration is filtered based on viewer's permission. If a viewer
// has no permission to view the configuration in this step, for non-final
// states a special state is populated (VIEWER_PERMISSION_MISSING), and for
// final state the configuration is cleared.
oneof step_info {
// Display information of a Compute Engine instance.
InstanceInfo instance = 5;
// Display information of a Compute Engine firewall rule.
FirewallInfo firewall = 6;
// Display information of a Compute Engine route.
RouteInfo route = 7;
// Display information of the source and destination under analysis.
// The endpoint information in an intermediate state may differ with the
// initial input, as it might be modified by state like NAT,
// or Connection Proxy.
EndpointInfo endpoint = 8;
// Display information of a Compute Engine forwarding rule.
ForwardingRuleInfo forwarding_rule = 9;
// Display information of a Compute Engine VPN gateway.
VpnGatewayInfo vpn_gateway = 10;
// Display information of a Compute Engine VPN tunnel.
VpnTunnelInfo vpn_tunnel = 11;
// Display information of the final state "deliver" and reason.
DeliverInfo deliver = 12;
// Display information of the final state "forward" and reason.
ForwardInfo forward = 13;
// Display information of the final state "abort" and reason.
AbortInfo abort = 14;
// Display information of the final state "drop" and reason.
DropInfo drop = 15;
// Display information of the load balancers.
LoadBalancerInfo load_balancer = 16;
// Display information of a Google Cloud network.
NetworkInfo network = 17;
// Display information of a Google Kubernetes Engine cluster master.
GKEMasterInfo gke_master = 18;
// Display information of a Cloud SQL instance.
CloudSQLInstanceInfo cloud_sql_instance = 19;
}
}
// For display only. Metadata associated with a Compute Engine instance.
message InstanceInfo {
// Name of a Compute Engine instance.
string display_name = 1;
// URI of a Compute Engine instance.
string uri = 2;
// Name of the network interface of a Compute Engine instance.
string interface = 3;
// URI of a Compute Engine network.
string network_uri = 4;
// Internal IP address of the network interface.
string internal_ip = 5;
// External IP address of the network interface.
string external_ip = 6;
// Network tags configured on the instance.
repeated string network_tags = 7;
// Service account authorized for the instance.
string service_account = 8 [deprecated = true];
}
// For display only. Metadata associated with a Compute Engine network.
message NetworkInfo {
// Name of a Compute Engine network.
string display_name = 1;
// URI of a Compute Engine network.
string uri = 2;
// The IP range that matches the test.
string matched_ip_range = 4;
}
// For display only. Metadata associated with a VPC firewall rule, an implied
// VPC firewall rule, or a hierarchical firewall policy rule.
message FirewallInfo {
// The firewall rule's type.
enum FirewallRuleType {
// Unspecified type.
FIREWALL_RULE_TYPE_UNSPECIFIED = 0;
// Hierarchical firewall policy rule. For details, see
// [Hierarchical firewall policies
// overview](https://cloud.google.com/vpc/docs/firewall-policies).
HIERARCHICAL_FIREWALL_POLICY_RULE = 1;
// VPC firewall rule. For details, see
// [VPC firewall rules
// overview](https://cloud.google.com/vpc/docs/firewalls).
VPC_FIREWALL_RULE = 2;
// Implied VPC firewall rule. For details, see
// [Implied
// rules](https://cloud.google.com/vpc/docs/firewalls#default_firewall_rules).
IMPLIED_VPC_FIREWALL_RULE = 3;
}
// The display name of the VPC firewall rule. This field is not applicable
// to hierarchical firewall policy rules.
string display_name = 1;
// The URI of the VPC firewall rule. This field is not applicable to
// implied firewall rules or hierarchical firewall policy rules.
string uri = 2;
// Possible values: INGRESS, EGRESS
string direction = 3;
// Possible values: ALLOW, DENY
string action = 4;
// The priority of the firewall rule.
int32 priority = 5;
// The URI of the VPC network that the firewall rule is associated with.
// This field is not applicable to hierarchical firewall policy rules.
string network_uri = 6;
// The target tags defined by the VPC firewall rule. This field is not
// applicable to hierarchical firewall policy rules.
repeated string target_tags = 7;
// The target service accounts specified by the firewall rule.
repeated string target_service_accounts = 8;
// The hierarchical firewall policy that this rule is associated with.
// This field is not applicable to VPC firewall rules.
string policy = 9;
// The firewall rule's type.
FirewallRuleType firewall_rule_type = 10;
}
// For display only. Metadata associated with a Compute Engine route.
message RouteInfo {
// Type of route:
enum RouteType {
// Unspecified type. Default value.
ROUTE_TYPE_UNSPECIFIED = 0;
// Route is a subnet route automatically created by the system.
SUBNET = 1;
// Static route created by the user, including the default route to the
// internet.
STATIC = 2;
// Dynamic route exchanged between BGP peers.
DYNAMIC = 3;
// A subnet route received from peering network.
PEERING_SUBNET = 4;
// A static route received from peering network.
PEERING_STATIC = 5;
// A dynamic route received from peering network.
PEERING_DYNAMIC = 6;
}
// Type of next hop:
enum NextHopType {
// Unspecified type. Default value.
NEXT_HOP_TYPE_UNSPECIFIED = 0;
// Next hop is an IP address.
NEXT_HOP_IP = 1;
// Next hop is a Compute Engine instance.
NEXT_HOP_INSTANCE = 2;
// Next hop is a VPC network gateway.
NEXT_HOP_NETWORK = 3;
// Next hop is a peering VPC.
NEXT_HOP_PEERING = 4;
// Next hop is an interconnect.
NEXT_HOP_INTERCONNECT = 5;
// Next hop is a VPN tunnel.
NEXT_HOP_VPN_TUNNEL = 6;
// Next hop is a VPN gateway. This scenario only happens when tracing
// connectivity from an on-premises network to Google Cloud through a VPN.
// The analysis simulates a packet departing from the on-premises network
// through a VPN tunnel and arriving at a Cloud VPN gateway.
NEXT_HOP_VPN_GATEWAY = 7;
// Next hop is an internet gateway.
NEXT_HOP_INTERNET_GATEWAY = 8;
// Next hop is blackhole; that is, the next hop either does not exist or is
// not running.
NEXT_HOP_BLACKHOLE = 9;
// Next hop is the forwarding rule of an Internal Load Balancer.
NEXT_HOP_ILB = 10;
}
// Type of route.
RouteType route_type = 8;
// Type of next hop.
NextHopType next_hop_type = 9;
// Name of a Compute Engine route.
string display_name = 1;
// URI of a Compute Engine route.
// Dynamic route from cloud router does not have a URI.
// Advertised route from Google Cloud VPC to on-premises network also does
// not have a URI.
string uri = 2;
// Destination IP range of the route.
string dest_ip_range = 3;
// Next hop of the route.
string next_hop = 4;
// URI of a Compute Engine network.
string network_uri = 5;
// Priority of the route.
int32 priority = 6;
// Instance tags of the route.
repeated string instance_tags = 7;
}
// For display only. Metadata associated with a Compute Engine forwarding rule.
message ForwardingRuleInfo {
// Name of a Compute Engine forwarding rule.
string display_name = 1;
// URI of a Compute Engine forwarding rule.
string uri = 2;
// Protocol defined in the forwarding rule that matches the test.
string matched_protocol = 3;
// Port range defined in the forwarding rule that matches the test.
string matched_port_range = 6;
// VIP of the forwarding rule.
string vip = 4;
// Target type of the forwarding rule.
string target = 5;
// Network URI. Only valid for Internal Load Balancer.
string network_uri = 7;
}
// For display only. Metadata associated with a load balancer.
message LoadBalancerInfo {
// The type definition for a load balancer:
enum LoadBalancerType {
// Type is unspecified.
LOAD_BALANCER_TYPE_UNSPECIFIED = 0;
// Internal TCP/UDP load balancer.
INTERNAL_TCP_UDP = 1;
// Network TCP/UDP load balancer.
NETWORK_TCP_UDP = 2;
// HTTP(S) proxy load balancer.
HTTP_PROXY = 3;
// TCP proxy load balancer.
TCP_PROXY = 4;
// SSL proxy load balancer.
SSL_PROXY = 5;
}
// The type definition for a load balancer backend configuration:
enum BackendType {
// Type is unspecified.
BACKEND_TYPE_UNSPECIFIED = 0;
// Backend Service as the load balancer's backend.
BACKEND_SERVICE = 1;
// Target Pool as the load balancer's backend.
TARGET_POOL = 2;
}
// Type of the load balancer.
LoadBalancerType load_balancer_type = 1;
// URI of the health check for the load balancer.
string health_check_uri = 2;
// Information for the loadbalancer backends.
repeated LoadBalancerBackend backends = 3;
// Type of load balancer's backend configuration.
BackendType backend_type = 4;
// Backend configuration URI.
string backend_uri = 5;
}
// For display only. Metadata associated with a specific load balancer backend.
message LoadBalancerBackend {
// State of a health check firewall configuration:
enum HealthCheckFirewallState {
// State is unspecified. Default state if not populated.
HEALTH_CHECK_FIREWALL_STATE_UNSPECIFIED = 0;
// There are configured firewall rules to allow health check probes to the
// backend.
CONFIGURED = 1;
// There are firewall rules configured to allow partial health check ranges
// or block all health check ranges.
// If a health check probe is sent from denied IP ranges,
// the health check to the backend will fail. Then, the backend will be
// marked unhealthy and will not receive traffic sent to the load balancer.
MISCONFIGURED = 2;
}
// Name of a Compute Engine instance or network endpoint.
string display_name = 1;
// URI of a Compute Engine instance or network endpoint.
string uri = 2;
// State of the health check firewall configuration.
HealthCheckFirewallState health_check_firewall_state = 3;
// A list of firewall rule URIs allowing probes from health check IP ranges.
repeated string health_check_allowing_firewall_rules = 4;
// A list of firewall rule URIs blocking probes from health check IP ranges.
repeated string health_check_blocking_firewall_rules = 5;
}
// For display only. Metadata associated with a Compute Engine VPN gateway.
message VpnGatewayInfo {
// Name of a VPN gateway.
string display_name = 1;
// URI of a VPN gateway.
string uri = 2;
// URI of a Compute Engine network where the VPN gateway is configured.
string network_uri = 3;
// IP address of the VPN gateway.
string ip_address = 4;
// A VPN tunnel that is associated with this VPN gateway.
// There may be multiple VPN tunnels configured on a VPN gateway, and only
// the one relevant to the test is displayed.
string vpn_tunnel_uri = 5;
// Name of a Google Cloud region where this VPN gateway is configured.
string region = 6;
}
// For display only. Metadata associated with a Compute Engine VPN tunnel.
message VpnTunnelInfo {
// Types of VPN routing policy. For details, refer to [Networks and Tunnel
// routing](https://cloud.google.com/network-connectivity/docs/vpn/concepts/choosing-networks-routing/).
enum RoutingType {
// Unspecified type. Default value.
ROUTING_TYPE_UNSPECIFIED = 0;
// Route based VPN.
ROUTE_BASED = 1;
// Policy based routing.
POLICY_BASED = 2;
// Dynamic (BGP) routing.
DYNAMIC = 3;
}
// Name of a VPN tunnel.
string display_name = 1;
// URI of a VPN tunnel.
string uri = 2;
// URI of the VPN gateway at local end of the tunnel.
string source_gateway = 3;
// URI of a VPN gateway at remote end of the tunnel.
string remote_gateway = 4;
// Remote VPN gateway's IP address.
string remote_gateway_ip = 5;
// Local VPN gateway's IP address.
string source_gateway_ip = 6;
// URI of a Compute Engine network where the VPN tunnel is configured.
string network_uri = 7;
// Name of a Google Cloud region where this VPN tunnel is configured.
string region = 8;
// Type of the routing policy.
RoutingType routing_type = 9;
}
// For display only. The specification of the endpoints for the test.
// EndpointInfo is derived from source and destination Endpoint and validated
// by the backend data plane model.
message EndpointInfo {
// Source IP address.
string source_ip = 1;
// Destination IP address.
string destination_ip = 2;
// IP protocol in string format, for example: "TCP", "UDP", "ICMP".
string protocol = 3;
// Source port. Only valid when protocol is TCP or UDP.
int32 source_port = 4;
// Destination port. Only valid when protocol is TCP or UDP.
int32 destination_port = 5;
// URI of the network where this packet originates from.
string source_network_uri = 6;
// URI of the network where this packet is sent to.
string destination_network_uri = 7;
}
// Details of the final state "deliver" and associated resource.
message DeliverInfo {
// Deliver target types:
enum Target {
// Target not specified.
TARGET_UNSPECIFIED = 0;
// Target is a Compute Engine instance.
INSTANCE = 1;
// Target is the internet.
INTERNET = 2;
// Target is a Google API.
GOOGLE_API = 3;
// Target is a Google Kubernetes Engine cluster master.
GKE_MASTER = 4;
// Target is a Cloud SQL instance.
CLOUD_SQL_INSTANCE = 5;
}
// Target type where the packet is delivered to.
Target target = 1;
// URI of the resource that the packet is delivered to.
string resource_uri = 2;
}
// Details of the final state "forward" and associated resource.
message ForwardInfo {
// Forward target types.
enum Target {
// Target not specified.
TARGET_UNSPECIFIED = 0;
// Forwarded to a VPC peering network.
PEERING_VPC = 1;
// Forwarded to a Cloud VPN gateway.
VPN_GATEWAY = 2;
// Forwarded to a Cloud Interconnect connection.
INTERCONNECT = 3;
// Forwarded to a Google Kubernetes Engine Container cluster master.
GKE_MASTER = 4;
// Forwarded to the next hop of a custom route imported from a peering VPC.
IMPORTED_CUSTOM_ROUTE_NEXT_HOP = 5;
// Forwarded to a Cloud SQL instance.
CLOUD_SQL_INSTANCE = 6;
}
// Target type where this packet is forwarded to.
Target target = 1;
// URI of the resource that the packet is forwarded to.
string resource_uri = 2;
}
// Details of the final state "abort" and associated resource.
message AbortInfo {
// Abort cause types:
enum Cause {
// Cause is unspecified.
CAUSE_UNSPECIFIED = 0;
// Aborted due to unknown network.
// The reachability analysis cannot proceed because the user does not have
// access to the host project's network configurations, including firewall
// rules and routes. This happens when the project is a service project and
// the endpoints being traced are in the host project's network.
UNKNOWN_NETWORK = 1;
// Aborted because the IP address(es) are unknown.
UNKNOWN_IP = 2;
// Aborted because no project information can be derived from the test
// input.
UNKNOWN_PROJECT = 3;
// Aborted because the user lacks the permission to access all or part of
// the network configurations required to run the test.
PERMISSION_DENIED = 4;
// Aborted because no valid source endpoint is derived from the input test
// request.
NO_SOURCE_LOCATION = 5;
// Aborted because the source and/or destination endpoint specified in
// the test are invalid. The possible reasons that an endpoint is
// invalid include: malformed IP address; nonexistent instance or
// network URI; IP address not in the range of specified network URI; and
// instance not owning the network interface in the specified network.
INVALID_ARGUMENT = 6;
// Aborted because traffic is sent from a public IP to an instance without
// an external IP.
NO_EXTERNAL_IP = 7;
// Aborted because none of the traces matches destination information
// specified in the input test request.
UNINTENDED_DESTINATION = 8;
// Aborted because the number of steps in the trace exceeding a certain
// limit which may be caused by routing loop.
TRACE_TOO_LONG = 9;
// Aborted due to internal server error.
INTERNAL_ERROR = 10;
// Aborted because the source endpoint could not be found.
SOURCE_ENDPOINT_NOT_FOUND = 11;
// Aborted because the source network does not match the source endpoint.
MISMATCHED_SOURCE_NETWORK = 12;
// Aborted because the destination endpoint could not be found.
DESTINATION_ENDPOINT_NOT_FOUND = 13;
// Aborted because the destination network does not match the destination
// endpoint.
MISMATCHED_DESTINATION_NETWORK = 14;
}
// Causes that the analysis is aborted.
Cause cause = 1;
// URI of the resource that caused the abort.
string resource_uri = 2;
}
// Details of the final state "drop" and associated resource.
message DropInfo {
// Drop cause types:
enum Cause {
// Cause is unspecified.
CAUSE_UNSPECIFIED = 0;
// Destination external address cannot be resolved to a known target. If
// the address is used in a Google Cloud project, provide the project ID
// as test input.
UNKNOWN_EXTERNAL_ADDRESS = 1;
// a Compute Engine instance can only send or receive a packet with a
// foreign IP address if ip_forward is enabled.
FOREIGN_IP_DISALLOWED = 2;
// Dropped due to a firewall rule, unless allowed due to connection
// tracking.
FIREWALL_RULE = 3;
// Dropped due to no routes.
NO_ROUTE = 4;
// Dropped due to invalid route. Route's next hop is a blackhole.
ROUTE_BLACKHOLE = 5;
// Packet is sent to a wrong (unintended) network. Example: you trace a
// packet from VM1:Network1 to VM2:Network2, however, the route configured
// in Network1 sends the packet destined for VM2's IP addresss to Network3.
ROUTE_WRONG_NETWORK = 6;
// Packet with internal destination address sent to the internet gateway.
PRIVATE_TRAFFIC_TO_INTERNET = 7;
// Instance with only an internal IP address tries to access Google API and
// services, but private Google access is not enabled.
PRIVATE_GOOGLE_ACCESS_DISALLOWED = 8;
// Instance with only an internal IP address tries to access external hosts,
// but Cloud NAT is not enabled in the subnet, unless special configurations
// on a VM allow this connection. For more details, see [Special
// configurations for VM
// instances](https://cloud.google.com/vpc/docs/special-configurations).
NO_EXTERNAL_ADDRESS = 9;
// Destination internal address cannot be resolved to a known target. If
// this is a shared VPC scenario, verify if the service project ID is
// provided as test input. Otherwise, verify if the IP address is being
// used in the project.
UNKNOWN_INTERNAL_ADDRESS = 10;
// Forwarding rule's protocol and ports do not match the packet header.
FORWARDING_RULE_MISMATCH = 11;
// Forwarding rule does not have backends configured.
FORWARDING_RULE_NO_INSTANCES = 12;
// Firewalls block the health check probes to the backends and cause
// the backends to be unavailable for traffic from the load balancer.
// For more details, see [Health check firewall
// rules](https://cloud.google.com/load-balancing/docs/health-checks#firewall_rules).
FIREWALL_BLOCKING_LOAD_BALANCER_BACKEND_HEALTH_CHECK = 13;
// Packet is sent from or to a Compute Engine instance that is not in a
// running state.
INSTANCE_NOT_RUNNING = 14;
// The type of traffic is blocked and the user cannot configure a firewall
// rule to enable it. See [Always blocked
// traffic](https://cloud.google.com/vpc/docs/firewalls#blockedtraffic) for
// more details.
TRAFFIC_TYPE_BLOCKED = 15;
// Access to Google Kubernetes Engine cluster master's endpoint is not
// authorized. See [Access to the cluster
// endpoints](https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters#access_to_the_cluster_endpoints)
// for more details.
GKE_MASTER_UNAUTHORIZED_ACCESS = 16;
// Access to the Cloud SQL instance endpoint is not authorized.
// See [Authorizing with authorized
// networks](https://cloud.google.com/sql/docs/mysql/authorize-networks) for
// more details.
CLOUD_SQL_INSTANCE_UNAUTHORIZED_ACCESS = 17;
// Packet was dropped inside Google Kubernetes Engine Service.
DROPPED_INSIDE_GKE_SERVICE = 18;
// Packet was dropped inside Cloud SQL Service.
DROPPED_INSIDE_CLOUD_SQL_SERVICE = 19;
// Packet was dropped because there is no peering between the originating
// network and the Google Managed Services Network.
GOOGLE_MANAGED_SERVICE_NO_PEERING = 20;
// Packet was dropped because the Cloud SQL instance has neither a private
// nor a public IP address.
CLOUD_SQL_INSTANCE_NO_IP_ADDRESS = 21;
}
// Cause that the packet is dropped.
Cause cause = 1;
// URI of the resource that caused the drop.
string resource_uri = 2;
}
// For display only. Metadata associated with a Google Kubernetes Engine (GKE)
// cluster master.
message GKEMasterInfo {
// URI of a GKE cluster.
string cluster_uri = 2;
// URI of a GKE cluster network.
string cluster_network_uri = 4;
// Internal IP address of a GKE cluster master.
string internal_ip = 5;
// External IP address of a GKE cluster master.
string external_ip = 6;
}
// For display only. Metadata associated with a Cloud SQL instance.
message CloudSQLInstanceInfo {
// Name of a Cloud SQL instance.
string display_name = 1;
// URI of a Cloud SQL instance.
string uri = 2;
// URI of a Cloud SQL instance network or empty string if the instance does
// not have one.
string network_uri = 4;
// Internal IP address of a Cloud SQL instance.
string internal_ip = 5;
// External IP address of a Cloud SQL instance.
string external_ip = 6;
// Region in which the Cloud SQL instance is running.
string region = 7;
}