google-cloud-network_connectivity-v1 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/network_connectivity/v1/hub_service/client.rb +14 -3
- data/lib/google/cloud/network_connectivity/v1/hub_service/operations.rb +13 -2
- data/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/client.rb +786 -0
- data/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/credentials.rb +51 -0
- data/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/operations.rb +779 -0
- data/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/paths.rb +84 -0
- data/lib/google/cloud/network_connectivity/v1/policy_based_routing_service.rb +51 -0
- data/lib/google/cloud/network_connectivity/v1/version.rb +1 -1
- data/lib/google/cloud/network_connectivity/v1.rb +1 -0
- data/lib/google/cloud/networkconnectivity/v1/policy_based_routing_pb.rb +64 -0
- data/lib/google/cloud/networkconnectivity/v1/policy_based_routing_services_pb.rb +52 -0
- data/proto_docs/google/api/field_behavior.rb +14 -0
- data/proto_docs/google/cloud/networkconnectivity/v1/policy_based_routing.rb +312 -0
- metadata +13 -5
@@ -0,0 +1,84 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module NetworkConnectivity
|
23
|
+
module V1
|
24
|
+
module PolicyBasedRoutingService
|
25
|
+
# Path helper methods for the PolicyBasedRoutingService API.
|
26
|
+
module Paths
|
27
|
+
##
|
28
|
+
# Create a fully-qualified Location resource string.
|
29
|
+
#
|
30
|
+
# The resource will be in the following format:
|
31
|
+
#
|
32
|
+
# `projects/{project}/locations/{location}`
|
33
|
+
#
|
34
|
+
# @param project [String]
|
35
|
+
# @param location [String]
|
36
|
+
#
|
37
|
+
# @return [::String]
|
38
|
+
def location_path project:, location:
|
39
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
40
|
+
|
41
|
+
"projects/#{project}/locations/#{location}"
|
42
|
+
end
|
43
|
+
|
44
|
+
##
|
45
|
+
# Create a fully-qualified Network resource string.
|
46
|
+
#
|
47
|
+
# The resource will be in the following format:
|
48
|
+
#
|
49
|
+
# `projects/{project}/global/networks/{resource_id}`
|
50
|
+
#
|
51
|
+
# @param project [String]
|
52
|
+
# @param resource_id [String]
|
53
|
+
#
|
54
|
+
# @return [::String]
|
55
|
+
def network_path project:, resource_id:
|
56
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
57
|
+
|
58
|
+
"projects/#{project}/global/networks/#{resource_id}"
|
59
|
+
end
|
60
|
+
|
61
|
+
##
|
62
|
+
# Create a fully-qualified PolicyBasedRoute resource string.
|
63
|
+
#
|
64
|
+
# The resource will be in the following format:
|
65
|
+
#
|
66
|
+
# `projects/{project}/locations/global/PolicyBasedRoutes/{policy_based_route}`
|
67
|
+
#
|
68
|
+
# @param project [String]
|
69
|
+
# @param policy_based_route [String]
|
70
|
+
#
|
71
|
+
# @return [::String]
|
72
|
+
def policy_based_route_path project:, policy_based_route:
|
73
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
74
|
+
|
75
|
+
"projects/#{project}/locations/global/PolicyBasedRoutes/#{policy_based_route}"
|
76
|
+
end
|
77
|
+
|
78
|
+
extend self
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "gapic/common"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/network_connectivity/v1/version"
|
24
|
+
|
25
|
+
require "google/cloud/network_connectivity/v1/policy_based_routing_service/credentials"
|
26
|
+
require "google/cloud/network_connectivity/v1/policy_based_routing_service/paths"
|
27
|
+
require "google/cloud/network_connectivity/v1/policy_based_routing_service/operations"
|
28
|
+
require "google/cloud/network_connectivity/v1/policy_based_routing_service/client"
|
29
|
+
|
30
|
+
module Google
|
31
|
+
module Cloud
|
32
|
+
module NetworkConnectivity
|
33
|
+
module V1
|
34
|
+
##
|
35
|
+
# Policy-Based Routing allows GCP customers to specify flexibile routing
|
36
|
+
# policies for Layer 4 traffic traversing through the connected service.
|
37
|
+
#
|
38
|
+
# @example Load this service and instantiate a gRPC client
|
39
|
+
#
|
40
|
+
# require "google/cloud/network_connectivity/v1/policy_based_routing_service"
|
41
|
+
# client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new
|
42
|
+
#
|
43
|
+
module PolicyBasedRoutingService
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
helper_path = ::File.join __dir__, "policy_based_routing_service", "helpers.rb"
|
51
|
+
require "google/cloud/network_connectivity/v1/policy_based_routing_service/helpers" if ::File.file? helper_path
|
@@ -17,6 +17,7 @@
|
|
17
17
|
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
18
|
|
19
19
|
require "google/cloud/network_connectivity/v1/hub_service"
|
20
|
+
require "google/cloud/network_connectivity/v1/policy_based_routing_service"
|
20
21
|
require "google/cloud/network_connectivity/v1/version"
|
21
22
|
|
22
23
|
module Google
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: google/cloud/networkconnectivity/v1/policy_based_routing.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'google/api/annotations_pb'
|
8
|
+
require 'google/api/client_pb'
|
9
|
+
require 'google/api/field_behavior_pb'
|
10
|
+
require 'google/api/resource_pb'
|
11
|
+
require 'google/cloud/networkconnectivity/v1/common_pb'
|
12
|
+
require 'google/longrunning/operations_pb'
|
13
|
+
require 'google/protobuf/empty_pb'
|
14
|
+
require 'google/protobuf/timestamp_pb'
|
15
|
+
|
16
|
+
|
17
|
+
descriptor_data = "\n>google/cloud/networkconnectivity/v1/policy_based_routing.proto\x12#google.cloud.networkconnectivity.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x30google/cloud/networkconnectivity/v1/common.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd1\x0e\n\x10PolicyBasedRoute\x12\x64\n\x0fvirtual_machine\x18\x12 \x01(\x0b\x32\x44.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachineB\x03\xe0\x41\x01H\x00\x12t\n\x17interconnect_attachment\x18\t \x01(\x0b\x32L.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachmentB\x03\xe0\x41\x01H\x00\x12\x1e\n\x0fnext_hop_ilb_ip\x18\x0c \x01(\tB\x03\xe0\x41\x01H\x01\x12g\n\x15next_hop_other_routes\x18\x15 \x01(\x0e\x32\x41.google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutesB\x03\xe0\x41\x01H\x01\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12Q\n\x06labels\x18\x04 \x03(\x0b\x32\x41.google.cloud.networkconnectivity.v1.PolicyBasedRoute.LabelsEntry\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x37\n\x07network\x18\x06 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12Q\n\x06\x66ilter\x18\n \x01(\x0b\x32<.google.cloud.networkconnectivity.v1.PolicyBasedRoute.FilterB\x03\xe0\x41\x02\x12\x15\n\x08priority\x18\x0b \x01(\x05\x42\x03\xe0\x41\x01\x12U\n\x08warnings\x18\x0e \x03(\x0b\x32>.google.cloud.networkconnectivity.v1.PolicyBasedRoute.WarningsB\x03\xe0\x41\x03\x12\x16\n\tself_link\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04kind\x18\x10 \x01(\tB\x03\xe0\x41\x03\x1a#\n\x0eVirtualMachine\x12\x11\n\x04tags\x18\x01 \x03(\tB\x03\xe0\x41\x01\x1a-\n\x16InterconnectAttachment\x12\x13\n\x06region\x18\x01 \x01(\tB\x03\xe0\x41\x01\x1a\xff\x01\n\x06\x46ilter\x12\x18\n\x0bip_protocol\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tsrc_range\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\ndest_range\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12k\n\x10protocol_version\x18\x06 \x01(\x0e\x32L.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersionB\x03\xe0\x41\x02\"=\n\x0fProtocolVersion\x12 \n\x1cPROTOCOL_VERSION_UNSPECIFIED\x10\x00\x12\x08\n\x04IPV4\x10\x01\x1a\xe1\x02\n\x08Warnings\x12V\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x43.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.CodeB\x03\xe0\x41\x03\x12[\n\x04\x64\x61ta\x18\x02 \x03(\x0b\x32H.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.DataEntryB\x03\xe0\x41\x03\x12\x1c\n\x0fwarning_message\x18\x03 \x01(\tB\x03\xe0\x41\x03\x1a+\n\tDataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"U\n\x04\x43ode\x12\x17\n\x13WARNING_UNSPECIFIED\x10\x00\x12\x17\n\x13RESOURCE_NOT_ACTIVE\x10\x01\x12\x1b\n\x17RESOURCE_BEING_MODIFIED\x10\x02\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"@\n\x0bOtherRoutes\x12\x1c\n\x18OTHER_ROUTES_UNSPECIFIED\x10\x00\x12\x13\n\x0f\x44\x45\x46\x41ULT_ROUTING\x10\x01:\x85\x01\xea\x41\x81\x01\n3networkconnectivity.googleapis.com/PolicyBasedRoute\x12Jprojects/{project}/locations/global/PolicyBasedRoutes/{policy_based_route}B\x08\n\x06targetB\n\n\x08next_hop\"\xa2\x01\n\x1cListPolicyBasedRoutesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\xa1\x01\n\x1dListPolicyBasedRoutesResponse\x12R\n\x13policy_based_routes\x18\x01 \x03(\x0b\x32\x35.google.cloud.networkconnectivity.v1.PolicyBasedRoute\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"g\n\x1aGetPolicyBasedRouteRequest\x12I\n\x04name\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\n3networkconnectivity.googleapis.com/PolicyBasedRoute\"\xef\x01\n\x1d\x43reatePolicyBasedRouteRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\"\n\x15policy_based_route_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12V\n\x12policy_based_route\x18\x03 \x01(\x0b\x32\x35.google.cloud.networkconnectivity.v1.PolicyBasedRouteB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x83\x01\n\x1d\x44\x65letePolicyBasedRouteRequest\x12I\n\x04name\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\n3networkconnectivity.googleapis.com/PolicyBasedRoute\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x32\xe3\x08\n\x19PolicyBasedRoutingService\x12\xeb\x01\n\x15ListPolicyBasedRoutes\x12\x41.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest\x1a\x42.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse\"K\x82\xd3\xe4\x93\x02<\x12:/v1/{parent=projects/*/locations/global}/policyBasedRoutes\xda\x41\x06parent\x12\xd8\x01\n\x13GetPolicyBasedRoute\x12?.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest\x1a\x35.google.cloud.networkconnectivity.v1.PolicyBasedRoute\"I\x82\xd3\xe4\x93\x02<\x12:/v1/{name=projects/*/locations/global/policyBasedRoutes/*}\xda\x41\x04name\x12\xae\x02\n\x16\x43reatePolicyBasedRoute\x12\x42.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest\x1a\x1d.google.longrunning.Operation\"\xb0\x01\x82\xd3\xe4\x93\x02P\":/v1/{parent=projects/*/locations/global}/policyBasedRoutes:\x12policy_based_route\xda\x41/parent,policy_based_route,policy_based_route_id\xca\x41%\n\x10PolicyBasedRoute\x12\x11OperationMetadata\x12\xf3\x01\n\x16\x44\x65letePolicyBasedRoute\x12\x42.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest\x1a\x1d.google.longrunning.Operation\"v\x82\xd3\xe4\x93\x02<*:/v1/{name=projects/*/locations/global/policyBasedRoutes/*}\xda\x41\x04name\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\x1aV\xca\x41\"networkconnectivity.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x94\x02\n\'com.google.cloud.networkconnectivity.v1B\x17PolicyBasedRoutingProtoP\x01ZYcloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb;networkconnectivitypb\xaa\x02#Google.Cloud.NetworkConnectivity.V1\xca\x02#Google\\Cloud\\NetworkConnectivity\\V1\xea\x02&Google::Cloud::NetworkConnectivity::V1b\x06proto3"
|
18
|
+
|
19
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
20
|
+
|
21
|
+
begin
|
22
|
+
pool.add_serialized_file(descriptor_data)
|
23
|
+
rescue TypeError => e
|
24
|
+
# Compatibility code: will be removed in the next major version.
|
25
|
+
require 'google/protobuf/descriptor_pb'
|
26
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
27
|
+
parsed.clear_dependency
|
28
|
+
serialized = parsed.class.encode(parsed)
|
29
|
+
file = pool.add_serialized_file(serialized)
|
30
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
31
|
+
imports = [
|
32
|
+
["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"],
|
33
|
+
]
|
34
|
+
imports.each do |type_name, expected_filename|
|
35
|
+
import_file = pool.lookup(type_name).file_descriptor
|
36
|
+
if import_file.name != expected_filename
|
37
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
41
|
+
warn "This will become an error in the next major version."
|
42
|
+
end
|
43
|
+
|
44
|
+
module Google
|
45
|
+
module Cloud
|
46
|
+
module NetworkConnectivity
|
47
|
+
module V1
|
48
|
+
PolicyBasedRoute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.PolicyBasedRoute").msgclass
|
49
|
+
PolicyBasedRoute::VirtualMachine = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine").msgclass
|
50
|
+
PolicyBasedRoute::InterconnectAttachment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment").msgclass
|
51
|
+
PolicyBasedRoute::Filter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter").msgclass
|
52
|
+
PolicyBasedRoute::Filter::ProtocolVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion").enummodule
|
53
|
+
PolicyBasedRoute::Warnings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings").msgclass
|
54
|
+
PolicyBasedRoute::Warnings::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code").enummodule
|
55
|
+
PolicyBasedRoute::OtherRoutes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes").enummodule
|
56
|
+
ListPolicyBasedRoutesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest").msgclass
|
57
|
+
ListPolicyBasedRoutesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse").msgclass
|
58
|
+
GetPolicyBasedRouteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest").msgclass
|
59
|
+
CreatePolicyBasedRouteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest").msgclass
|
60
|
+
DeletePolicyBasedRouteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest").msgclass
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: google/cloud/networkconnectivity/v1/policy_based_routing.proto for package 'Google.Cloud.NetworkConnectivity.V1'
|
3
|
+
# Original file comments:
|
4
|
+
# Copyright 2023 Google LLC
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require 'grpc'
|
20
|
+
require 'google/cloud/networkconnectivity/v1/policy_based_routing_pb'
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module NetworkConnectivity
|
25
|
+
module V1
|
26
|
+
module PolicyBasedRoutingService
|
27
|
+
# Policy-Based Routing allows GCP customers to specify flexibile routing
|
28
|
+
# policies for Layer 4 traffic traversing through the connected service.
|
29
|
+
class Service
|
30
|
+
|
31
|
+
include ::GRPC::GenericService
|
32
|
+
|
33
|
+
self.marshal_class_method = :encode
|
34
|
+
self.unmarshal_class_method = :decode
|
35
|
+
self.service_name = 'google.cloud.networkconnectivity.v1.PolicyBasedRoutingService'
|
36
|
+
|
37
|
+
# Lists PolicyBasedRoutes in a given project and location.
|
38
|
+
rpc :ListPolicyBasedRoutes, ::Google::Cloud::NetworkConnectivity::V1::ListPolicyBasedRoutesRequest, ::Google::Cloud::NetworkConnectivity::V1::ListPolicyBasedRoutesResponse
|
39
|
+
# Gets details of a single PolicyBasedRoute.
|
40
|
+
rpc :GetPolicyBasedRoute, ::Google::Cloud::NetworkConnectivity::V1::GetPolicyBasedRouteRequest, ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute
|
41
|
+
# Creates a new PolicyBasedRoute in a given project and location.
|
42
|
+
rpc :CreatePolicyBasedRoute, ::Google::Cloud::NetworkConnectivity::V1::CreatePolicyBasedRouteRequest, ::Google::Longrunning::Operation
|
43
|
+
# Deletes a single PolicyBasedRoute.
|
44
|
+
rpc :DeletePolicyBasedRoute, ::Google::Cloud::NetworkConnectivity::V1::DeletePolicyBasedRouteRequest, ::Google::Longrunning::Operation
|
45
|
+
end
|
46
|
+
|
47
|
+
Stub = Service.rpc_stub_class
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -66,6 +66,20 @@ module Google
|
|
66
66
|
# a non-empty value will be returned. The user will not be aware of what
|
67
67
|
# non-empty value to expect.
|
68
68
|
NON_EMPTY_DEFAULT = 7
|
69
|
+
|
70
|
+
# Denotes that the field in a resource (a message annotated with
|
71
|
+
# google.api.resource) is used in the resource name to uniquely identify the
|
72
|
+
# resource. For AIP-compliant APIs, this should only be applied to the
|
73
|
+
# `name` field on the resource.
|
74
|
+
#
|
75
|
+
# This behavior should not be applied to references to other resources within
|
76
|
+
# the message.
|
77
|
+
#
|
78
|
+
# The identifier field of resources often have different field behavior
|
79
|
+
# depending on the request it is embedded in (e.g. for Create methods name
|
80
|
+
# is optional and unused, while for Update methods it is required). Instead
|
81
|
+
# of method-specific annotations, only `IDENTIFIER` is required.
|
82
|
+
IDENTIFIER = 8
|
69
83
|
end
|
70
84
|
end
|
71
85
|
end
|
@@ -0,0 +1,312 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module NetworkConnectivity
|
23
|
+
module V1
|
24
|
+
# Policy Based Routes (PBR) are more powerful routes that allows GCP customers
|
25
|
+
# to route their L4 network traffic based on not just destination IP, but also
|
26
|
+
# source IP, protocol and more. A PBR always take precedence when it conflicts
|
27
|
+
# with other types of routes.
|
28
|
+
# Next id: 22
|
29
|
+
# @!attribute [rw] virtual_machine
|
30
|
+
# @return [::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::VirtualMachine]
|
31
|
+
# Optional. VM instances to which this policy based route applies to.
|
32
|
+
# @!attribute [rw] interconnect_attachment
|
33
|
+
# @return [::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::InterconnectAttachment]
|
34
|
+
# Optional. The interconnect attachments to which this route applies to.
|
35
|
+
# @!attribute [rw] next_hop_ilb_ip
|
36
|
+
# @return [::String]
|
37
|
+
# Optional. The IP of a global access enabled L4 ILB that should be the
|
38
|
+
# next hop to handle matching packets. For this version, only
|
39
|
+
# next_hop_ilb_ip is supported.
|
40
|
+
# @!attribute [rw] next_hop_other_routes
|
41
|
+
# @return [::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::OtherRoutes]
|
42
|
+
# Optional. Other routes that will be referenced to determine the next hop
|
43
|
+
# of the packet.
|
44
|
+
# @!attribute [rw] name
|
45
|
+
# @return [::String]
|
46
|
+
# Immutable. A unique name of the resource in the form of
|
47
|
+
# `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
|
48
|
+
# @!attribute [r] create_time
|
49
|
+
# @return [::Google::Protobuf::Timestamp]
|
50
|
+
# Output only. Time when the PolicyBasedRoute was created.
|
51
|
+
# @!attribute [r] update_time
|
52
|
+
# @return [::Google::Protobuf::Timestamp]
|
53
|
+
# Output only. Time when the PolicyBasedRoute was updated.
|
54
|
+
# @!attribute [rw] labels
|
55
|
+
# @return [::Google::Protobuf::Map{::String => ::String}]
|
56
|
+
# User-defined labels.
|
57
|
+
# @!attribute [rw] description
|
58
|
+
# @return [::String]
|
59
|
+
# Optional. An optional description of this resource. Provide this field when
|
60
|
+
# you create the resource.
|
61
|
+
# @!attribute [rw] network
|
62
|
+
# @return [::String]
|
63
|
+
# Required. Fully-qualified URL of the network that this route applies to.
|
64
|
+
# e.g. projects/my-project/global/networks/my-network.
|
65
|
+
# @!attribute [rw] filter
|
66
|
+
# @return [::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::Filter]
|
67
|
+
# Required. The filter to match L4 traffic.
|
68
|
+
# @!attribute [rw] priority
|
69
|
+
# @return [::Integer]
|
70
|
+
# Optional. The priority of this policy based route. Priority is used to
|
71
|
+
# break ties in cases where there are more than one matching policy based
|
72
|
+
# routes found. In cases where multiple policy based routes are matched, the
|
73
|
+
# one with the lowest-numbered priority value wins. The default value is
|
74
|
+
# 1000. The priority value must be from 1 to 65535, inclusive.
|
75
|
+
# @!attribute [r] warnings
|
76
|
+
# @return [::Array<::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::Warnings>]
|
77
|
+
# Output only. If potential misconfigurations are detected for this route,
|
78
|
+
# this field will be populated with warning messages.
|
79
|
+
# @!attribute [r] self_link
|
80
|
+
# @return [::String]
|
81
|
+
# Output only. Server-defined fully-qualified URL for this resource.
|
82
|
+
# @!attribute [r] kind
|
83
|
+
# @return [::String]
|
84
|
+
# Output only. Type of this resource. Always
|
85
|
+
# networkconnectivity#policyBasedRoute for Policy Based Route resources.
|
86
|
+
class PolicyBasedRoute
|
87
|
+
include ::Google::Protobuf::MessageExts
|
88
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
89
|
+
|
90
|
+
# VM instances to which this policy based route applies to.
|
91
|
+
# @!attribute [rw] tags
|
92
|
+
# @return [::Array<::String>]
|
93
|
+
# Optional. A list of VM instance tags to which this policy based route
|
94
|
+
# applies to. VM instances that have ANY of tags specified here will
|
95
|
+
# install this PBR.
|
96
|
+
class VirtualMachine
|
97
|
+
include ::Google::Protobuf::MessageExts
|
98
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
99
|
+
end
|
100
|
+
|
101
|
+
# InterconnectAttachment to which this route applies to.
|
102
|
+
# @!attribute [rw] region
|
103
|
+
# @return [::String]
|
104
|
+
# Optional. Cloud region to install this policy based route on interconnect
|
105
|
+
# attachment. Use `all` to install it on all interconnect attachments.
|
106
|
+
class InterconnectAttachment
|
107
|
+
include ::Google::Protobuf::MessageExts
|
108
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
109
|
+
end
|
110
|
+
|
111
|
+
# Filter matches L4 traffic.
|
112
|
+
# @!attribute [rw] ip_protocol
|
113
|
+
# @return [::String]
|
114
|
+
# Optional. The IP protocol that this policy based route applies to. Valid
|
115
|
+
# values are 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
|
116
|
+
# @!attribute [rw] src_range
|
117
|
+
# @return [::String]
|
118
|
+
# Optional. The source IP range of outgoing packets that this policy based
|
119
|
+
# route applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
|
120
|
+
# @!attribute [rw] dest_range
|
121
|
+
# @return [::String]
|
122
|
+
# Optional. The destination IP range of outgoing packets that this policy
|
123
|
+
# based route applies to. Default is "0.0.0.0/0" if protocol version is
|
124
|
+
# IPv4.
|
125
|
+
# @!attribute [rw] protocol_version
|
126
|
+
# @return [::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::Filter::ProtocolVersion]
|
127
|
+
# Required. Internet protocol versions this policy based route applies to.
|
128
|
+
# For this version, only IPV4 is supported.
|
129
|
+
class Filter
|
130
|
+
include ::Google::Protobuf::MessageExts
|
131
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
132
|
+
|
133
|
+
# The internet protocol version.
|
134
|
+
module ProtocolVersion
|
135
|
+
# Default value.
|
136
|
+
PROTOCOL_VERSION_UNSPECIFIED = 0
|
137
|
+
|
138
|
+
# The PBR is for IPv4 internet protocol traffic.
|
139
|
+
IPV4 = 1
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
# Informational warning message.
|
144
|
+
# @!attribute [r] code
|
145
|
+
# @return [::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::Warnings::Code]
|
146
|
+
# Output only. A warning code, if applicable.
|
147
|
+
# @!attribute [r] data
|
148
|
+
# @return [::Google::Protobuf::Map{::String => ::String}]
|
149
|
+
# Output only. Metadata about this warning in key: value format. The key
|
150
|
+
# should provides more detail on the warning being returned. For example,
|
151
|
+
# for warnings where there are no results in a list request for a
|
152
|
+
# particular zone, this key might be scope and the key value might be the
|
153
|
+
# zone name. Other examples might be a key indicating a deprecated resource
|
154
|
+
# and a suggested replacement.
|
155
|
+
# @!attribute [r] warning_message
|
156
|
+
# @return [::String]
|
157
|
+
# Output only. A human-readable description of the warning code.
|
158
|
+
class Warnings
|
159
|
+
include ::Google::Protobuf::MessageExts
|
160
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
161
|
+
|
162
|
+
# @!attribute [rw] key
|
163
|
+
# @return [::String]
|
164
|
+
# @!attribute [rw] value
|
165
|
+
# @return [::String]
|
166
|
+
class DataEntry
|
167
|
+
include ::Google::Protobuf::MessageExts
|
168
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
169
|
+
end
|
170
|
+
|
171
|
+
# Warning code for Policy Based Routing. Expect to add values in the
|
172
|
+
# future.
|
173
|
+
module Code
|
174
|
+
# Default value.
|
175
|
+
WARNING_UNSPECIFIED = 0
|
176
|
+
|
177
|
+
# The policy based route is not active and functioning. Common causes are
|
178
|
+
# the dependent network was deleted or the resource project was turned
|
179
|
+
# off.
|
180
|
+
RESOURCE_NOT_ACTIVE = 1
|
181
|
+
|
182
|
+
# The policy based route is being modified (e.g. created/deleted) at this
|
183
|
+
# time.
|
184
|
+
RESOURCE_BEING_MODIFIED = 2
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
# @!attribute [rw] key
|
189
|
+
# @return [::String]
|
190
|
+
# @!attribute [rw] value
|
191
|
+
# @return [::String]
|
192
|
+
class LabelsEntry
|
193
|
+
include ::Google::Protobuf::MessageExts
|
194
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
195
|
+
end
|
196
|
+
|
197
|
+
# The other routing cases.
|
198
|
+
module OtherRoutes
|
199
|
+
# Default value.
|
200
|
+
OTHER_ROUTES_UNSPECIFIED = 0
|
201
|
+
|
202
|
+
# Use the routes from the default routing tables (system-generated routes,
|
203
|
+
# custom routes, peering route) to determine the next hop. This will
|
204
|
+
# effectively exclude matching packets being applied on other PBRs with a
|
205
|
+
# lower priority.
|
206
|
+
DEFAULT_ROUTING = 1
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
# Request for [PolicyBasedRouting.ListPolicyBasedRoutes][] method.
|
211
|
+
# @!attribute [rw] parent
|
212
|
+
# @return [::String]
|
213
|
+
# Required. The parent resource's name.
|
214
|
+
# @!attribute [rw] page_size
|
215
|
+
# @return [::Integer]
|
216
|
+
# The maximum number of results per page that should be returned.
|
217
|
+
# @!attribute [rw] page_token
|
218
|
+
# @return [::String]
|
219
|
+
# The page token.
|
220
|
+
# @!attribute [rw] filter
|
221
|
+
# @return [::String]
|
222
|
+
# A filter expression that filters the results listed in the response.
|
223
|
+
# @!attribute [rw] order_by
|
224
|
+
# @return [::String]
|
225
|
+
# Sort the results by a certain order.
|
226
|
+
class ListPolicyBasedRoutesRequest
|
227
|
+
include ::Google::Protobuf::MessageExts
|
228
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
229
|
+
end
|
230
|
+
|
231
|
+
# Response for [PolicyBasedRouting.ListPolicyBasedRoutes][] method.
|
232
|
+
# @!attribute [rw] policy_based_routes
|
233
|
+
# @return [::Array<::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute>]
|
234
|
+
# Policy based routes to be returned.
|
235
|
+
# @!attribute [rw] next_page_token
|
236
|
+
# @return [::String]
|
237
|
+
# The next pagination token in the List response. It should be used as
|
238
|
+
# page_token for the following request. An empty value means no more result.
|
239
|
+
# @!attribute [rw] unreachable
|
240
|
+
# @return [::Array<::String>]
|
241
|
+
# Locations that could not be reached.
|
242
|
+
class ListPolicyBasedRoutesResponse
|
243
|
+
include ::Google::Protobuf::MessageExts
|
244
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
245
|
+
end
|
246
|
+
|
247
|
+
# Request for [PolicyBasedRouting.GetPolicyBasedRoute][] method.
|
248
|
+
# @!attribute [rw] name
|
249
|
+
# @return [::String]
|
250
|
+
# Required. Name of the PolicyBasedRoute resource to get.
|
251
|
+
class GetPolicyBasedRouteRequest
|
252
|
+
include ::Google::Protobuf::MessageExts
|
253
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
254
|
+
end
|
255
|
+
|
256
|
+
# Request for [PolicyBasedRouting.CreatePolicyBasedRoute][] method.
|
257
|
+
# @!attribute [rw] parent
|
258
|
+
# @return [::String]
|
259
|
+
# Required. The parent resource's name of the PolicyBasedRoute.
|
260
|
+
# @!attribute [rw] policy_based_route_id
|
261
|
+
# @return [::String]
|
262
|
+
# Required. Unique id for the Policy Based Route to create.
|
263
|
+
# @!attribute [rw] policy_based_route
|
264
|
+
# @return [::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute]
|
265
|
+
# Required. Initial values for a new Policy Based Route.
|
266
|
+
# @!attribute [rw] request_id
|
267
|
+
# @return [::String]
|
268
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
269
|
+
# request ID so that if you must retry your request, the server will know to
|
270
|
+
# ignore the request if it has already been completed. The server will
|
271
|
+
# guarantee that for at least 60 minutes since the first request.
|
272
|
+
#
|
273
|
+
# For example, consider a situation where you make an initial request and
|
274
|
+
# the request times out. If you make the request again with the same request
|
275
|
+
# ID, the server can check if original operation with the same request ID
|
276
|
+
# was received, and if so, will ignore the second request. This prevents
|
277
|
+
# clients from accidentally creating duplicate commitments.
|
278
|
+
#
|
279
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
280
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
281
|
+
class CreatePolicyBasedRouteRequest
|
282
|
+
include ::Google::Protobuf::MessageExts
|
283
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
284
|
+
end
|
285
|
+
|
286
|
+
# Request for [PolicyBasedRouting.DeletePolicyBasedRoute][] method.
|
287
|
+
# @!attribute [rw] name
|
288
|
+
# @return [::String]
|
289
|
+
# Required. Name of the PolicyBasedRoute resource to delete.
|
290
|
+
# @!attribute [rw] request_id
|
291
|
+
# @return [::String]
|
292
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
293
|
+
# request ID so that if you must retry your request, the server will know to
|
294
|
+
# ignore the request if it has already been completed. The server will
|
295
|
+
# guarantee that for at least 60 minutes after the first request.
|
296
|
+
#
|
297
|
+
# For example, consider a situation where you make an initial request and
|
298
|
+
# the request times out. If you make the request again with the same request
|
299
|
+
# ID, the server can check if original operation with the same request ID
|
300
|
+
# was received, and if so, will ignore the second request. This prevents
|
301
|
+
# clients from accidentally creating duplicate commitments.
|
302
|
+
#
|
303
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
304
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
305
|
+
class DeletePolicyBasedRouteRequest
|
306
|
+
include ::Google::Protobuf::MessageExts
|
307
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
308
|
+
end
|
309
|
+
end
|
310
|
+
end
|
311
|
+
end
|
312
|
+
end
|