google-cloud-compute-v1 2.0.0 → 2.2.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/compute/v1/accelerator_types/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb +3 -3
- data/lib/google/cloud/compute/v1/addresses/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +6 -6
- data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +7 -7
- data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +9 -9
- data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +14 -14
- data/lib/google/cloud/compute/v1/compute_pb.rb +42 -10746
- data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb +3 -3
- data/lib/google/cloud/compute/v1/disks/rest/client.rb +98 -5
- data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +75 -13
- data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb +6 -6
- data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +8 -6
- data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +18 -18
- data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +6 -6
- data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb +8 -8
- data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +5 -5
- data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb +7 -7
- data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb +7 -7
- data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb +5 -5
- data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb +3 -3
- data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb +5 -5
- data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +7 -7
- data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb +1 -1
- data/lib/google/cloud/compute/v1/images/rest/client.rb +9 -7
- data/lib/google/cloud/compute/v1/images/rest/service_stub.rb +11 -11
- data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +20 -20
- data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +9 -9
- data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +97 -8
- data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +66 -7
- data/lib/google/cloud/compute/v1/instances/rest/client.rb +95 -5
- data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +107 -45
- data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +7 -7
- data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +2 -2
- data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +7 -7
- data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +2 -2
- data/lib/google/cloud/compute/v1/licenses/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +7 -7
- data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb +7 -7
- data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +3 -3
- data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/network_attachments/rest/service_stub.rb +8 -8
- data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +5 -5
- data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +9 -9
- data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +16 -16
- data/lib/google/cloud/compute/v1/networks/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +11 -11
- data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +94 -4
- data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +75 -13
- data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +8 -8
- data/lib/google/cloud/compute/v1/node_types/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +3 -3
- data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +7 -7
- data/lib/google/cloud/compute/v1/projects/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +13 -13
- data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +5 -5
- data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +6 -6
- data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +6 -6
- data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +9 -9
- data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +5 -5
- data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +2 -2
- data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +97 -4
- data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +74 -12
- data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +5 -5
- data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +6 -6
- data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +19 -19
- data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +4 -4
- data/lib/google/cloud/compute/v1/region_instance_templates/credentials.rb +52 -0
- data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +626 -0
- data/lib/google/cloud/compute/v1/region_instance_templates/rest/service_stub.rb +291 -0
- data/lib/google/cloud/compute/v1/region_instance_templates/rest.rb +51 -0
- data/lib/google/cloud/compute/v1/region_instance_templates.rb +47 -0
- data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb +1 -1
- data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +4 -4
- data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +17 -17
- data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +4 -4
- data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +4 -4
- data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +5 -5
- data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +4 -4
- data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb +6 -6
- data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +5 -5
- data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +7 -7
- data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb +4 -4
- data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +7 -7
- data/lib/google/cloud/compute/v1/regions/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +2 -2
- data/lib/google/cloud/compute/v1/reservations/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +10 -10
- data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +8 -8
- data/lib/google/cloud/compute/v1/rest.rb +1 -0
- data/lib/google/cloud/compute/v1/routers/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +10 -10
- data/lib/google/cloud/compute/v1/routes/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +4 -4
- data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +12 -12
- data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb +9 -9
- data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +8 -8
- data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +5 -5
- data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +7 -7
- data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +12 -12
- data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +5 -5
- data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +7 -7
- data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +11 -11
- data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +5 -5
- data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +11 -11
- data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +9 -9
- data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +7 -7
- data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +6 -6
- data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +9 -9
- data/lib/google/cloud/compute/v1/version.rb +1 -1
- data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +8 -8
- data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +6 -6
- data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +6 -4
- data/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +4 -4
- data/lib/google/cloud/compute/v1/zones/rest/client.rb +7 -5
- data/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +2 -2
- data/lib/google/cloud/compute/v1.rb +1 -0
- data/proto_docs/google/api/client.rb +67 -4
- data/proto_docs/google/cloud/compute/v1/compute.rb +414 -29
- metadata +9 -4
@@ -0,0 +1,291 @@
|
|
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 "google/cloud/compute/v1/compute_pb"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module Compute
|
24
|
+
module V1
|
25
|
+
module RegionInstanceTemplates
|
26
|
+
module Rest
|
27
|
+
##
|
28
|
+
# REST service stub for the RegionInstanceTemplates service.
|
29
|
+
# Service stub contains baseline method implementations
|
30
|
+
# including transcoding, making the REST call, and deserialing the response.
|
31
|
+
#
|
32
|
+
class ServiceStub
|
33
|
+
def initialize endpoint:, credentials:
|
34
|
+
# These require statements are intentionally placed here to initialize
|
35
|
+
# the REST modules only when it's required.
|
36
|
+
require "gapic/rest"
|
37
|
+
|
38
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
|
39
|
+
numeric_enums: false,
|
40
|
+
raise_faraday_errors: false
|
41
|
+
end
|
42
|
+
|
43
|
+
##
|
44
|
+
# Baseline implementation for the delete REST call
|
45
|
+
#
|
46
|
+
# @param request_pb [::Google::Cloud::Compute::V1::DeleteRegionInstanceTemplateRequest]
|
47
|
+
# A request object representing the call parameters. Required.
|
48
|
+
# @param options [::Gapic::CallOptions]
|
49
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
50
|
+
#
|
51
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
52
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::Operation]
|
53
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
54
|
+
#
|
55
|
+
# @return [::Google::Cloud::Compute::V1::Operation]
|
56
|
+
# A result object deserialized from the server's reply
|
57
|
+
def delete request_pb, options = nil
|
58
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
59
|
+
|
60
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_delete_request request_pb
|
61
|
+
query_string_params = if query_string_params.any?
|
62
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
63
|
+
else
|
64
|
+
{}
|
65
|
+
end
|
66
|
+
|
67
|
+
response = @client_stub.make_http_request(
|
68
|
+
verb,
|
69
|
+
uri: uri,
|
70
|
+
body: body || "",
|
71
|
+
params: query_string_params,
|
72
|
+
options: options
|
73
|
+
)
|
74
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
75
|
+
result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
|
76
|
+
|
77
|
+
yield result, operation if block_given?
|
78
|
+
result
|
79
|
+
end
|
80
|
+
|
81
|
+
##
|
82
|
+
# Baseline implementation for the get REST call
|
83
|
+
#
|
84
|
+
# @param request_pb [::Google::Cloud::Compute::V1::GetRegionInstanceTemplateRequest]
|
85
|
+
# A request object representing the call parameters. Required.
|
86
|
+
# @param options [::Gapic::CallOptions]
|
87
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
88
|
+
#
|
89
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
90
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::InstanceTemplate]
|
91
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
92
|
+
#
|
93
|
+
# @return [::Google::Cloud::Compute::V1::InstanceTemplate]
|
94
|
+
# A result object deserialized from the server's reply
|
95
|
+
def get request_pb, options = nil
|
96
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
97
|
+
|
98
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_get_request request_pb
|
99
|
+
query_string_params = if query_string_params.any?
|
100
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
101
|
+
else
|
102
|
+
{}
|
103
|
+
end
|
104
|
+
|
105
|
+
response = @client_stub.make_http_request(
|
106
|
+
verb,
|
107
|
+
uri: uri,
|
108
|
+
body: body || "",
|
109
|
+
params: query_string_params,
|
110
|
+
options: options
|
111
|
+
)
|
112
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
113
|
+
result = ::Google::Cloud::Compute::V1::InstanceTemplate.decode_json response.body, ignore_unknown_fields: true
|
114
|
+
|
115
|
+
yield result, operation if block_given?
|
116
|
+
result
|
117
|
+
end
|
118
|
+
|
119
|
+
##
|
120
|
+
# Baseline implementation for the insert REST call
|
121
|
+
#
|
122
|
+
# @param request_pb [::Google::Cloud::Compute::V1::InsertRegionInstanceTemplateRequest]
|
123
|
+
# A request object representing the call parameters. Required.
|
124
|
+
# @param options [::Gapic::CallOptions]
|
125
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
126
|
+
#
|
127
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
128
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::Operation]
|
129
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
130
|
+
#
|
131
|
+
# @return [::Google::Cloud::Compute::V1::Operation]
|
132
|
+
# A result object deserialized from the server's reply
|
133
|
+
def insert request_pb, options = nil
|
134
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
135
|
+
|
136
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_insert_request request_pb
|
137
|
+
query_string_params = if query_string_params.any?
|
138
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
139
|
+
else
|
140
|
+
{}
|
141
|
+
end
|
142
|
+
|
143
|
+
response = @client_stub.make_http_request(
|
144
|
+
verb,
|
145
|
+
uri: uri,
|
146
|
+
body: body || "",
|
147
|
+
params: query_string_params,
|
148
|
+
options: options
|
149
|
+
)
|
150
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
151
|
+
result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
|
152
|
+
|
153
|
+
yield result, operation if block_given?
|
154
|
+
result
|
155
|
+
end
|
156
|
+
|
157
|
+
##
|
158
|
+
# Baseline implementation for the list REST call
|
159
|
+
#
|
160
|
+
# @param request_pb [::Google::Cloud::Compute::V1::ListRegionInstanceTemplatesRequest]
|
161
|
+
# A request object representing the call parameters. Required.
|
162
|
+
# @param options [::Gapic::CallOptions]
|
163
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
164
|
+
#
|
165
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
166
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::InstanceTemplateList]
|
167
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
168
|
+
#
|
169
|
+
# @return [::Google::Cloud::Compute::V1::InstanceTemplateList]
|
170
|
+
# A result object deserialized from the server's reply
|
171
|
+
def list request_pb, options = nil
|
172
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
173
|
+
|
174
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_list_request request_pb
|
175
|
+
query_string_params = if query_string_params.any?
|
176
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
177
|
+
else
|
178
|
+
{}
|
179
|
+
end
|
180
|
+
|
181
|
+
response = @client_stub.make_http_request(
|
182
|
+
verb,
|
183
|
+
uri: uri,
|
184
|
+
body: body || "",
|
185
|
+
params: query_string_params,
|
186
|
+
options: options
|
187
|
+
)
|
188
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
189
|
+
result = ::Google::Cloud::Compute::V1::InstanceTemplateList.decode_json response.body, ignore_unknown_fields: true
|
190
|
+
|
191
|
+
yield result, operation if block_given?
|
192
|
+
result
|
193
|
+
end
|
194
|
+
|
195
|
+
##
|
196
|
+
# @private
|
197
|
+
#
|
198
|
+
# GRPC transcoding helper method for the delete REST call
|
199
|
+
#
|
200
|
+
# @param request_pb [::Google::Cloud::Compute::V1::DeleteRegionInstanceTemplateRequest]
|
201
|
+
# A request object representing the call parameters. Required.
|
202
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
203
|
+
# Uri, Body, Query string parameters
|
204
|
+
def self.transcode_delete_request request_pb
|
205
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
206
|
+
.with_bindings(
|
207
|
+
uri_method: :delete,
|
208
|
+
uri_template: "/compute/v1/projects/{project}/regions/{region}/instanceTemplates/{instance_template}",
|
209
|
+
matches: [
|
210
|
+
["project", %r{^[^/]+/?$}, false],
|
211
|
+
["region", %r{^[^/]+/?$}, false],
|
212
|
+
["instance_template", %r{^[^/]+/?$}, false]
|
213
|
+
]
|
214
|
+
)
|
215
|
+
transcoder.transcode request_pb
|
216
|
+
end
|
217
|
+
|
218
|
+
##
|
219
|
+
# @private
|
220
|
+
#
|
221
|
+
# GRPC transcoding helper method for the get REST call
|
222
|
+
#
|
223
|
+
# @param request_pb [::Google::Cloud::Compute::V1::GetRegionInstanceTemplateRequest]
|
224
|
+
# A request object representing the call parameters. Required.
|
225
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
226
|
+
# Uri, Body, Query string parameters
|
227
|
+
def self.transcode_get_request request_pb
|
228
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
229
|
+
.with_bindings(
|
230
|
+
uri_method: :get,
|
231
|
+
uri_template: "/compute/v1/projects/{project}/regions/{region}/instanceTemplates/{instance_template}",
|
232
|
+
matches: [
|
233
|
+
["project", %r{^[^/]+/?$}, false],
|
234
|
+
["region", %r{^[^/]+/?$}, false],
|
235
|
+
["instance_template", %r{^[^/]+/?$}, false]
|
236
|
+
]
|
237
|
+
)
|
238
|
+
transcoder.transcode request_pb
|
239
|
+
end
|
240
|
+
|
241
|
+
##
|
242
|
+
# @private
|
243
|
+
#
|
244
|
+
# GRPC transcoding helper method for the insert REST call
|
245
|
+
#
|
246
|
+
# @param request_pb [::Google::Cloud::Compute::V1::InsertRegionInstanceTemplateRequest]
|
247
|
+
# A request object representing the call parameters. Required.
|
248
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
249
|
+
# Uri, Body, Query string parameters
|
250
|
+
def self.transcode_insert_request request_pb
|
251
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
252
|
+
.with_bindings(
|
253
|
+
uri_method: :post,
|
254
|
+
uri_template: "/compute/v1/projects/{project}/regions/{region}/instanceTemplates",
|
255
|
+
body: "instance_template_resource",
|
256
|
+
matches: [
|
257
|
+
["project", %r{^[^/]+/?$}, false],
|
258
|
+
["region", %r{^[^/]+/?$}, false]
|
259
|
+
]
|
260
|
+
)
|
261
|
+
transcoder.transcode request_pb
|
262
|
+
end
|
263
|
+
|
264
|
+
##
|
265
|
+
# @private
|
266
|
+
#
|
267
|
+
# GRPC transcoding helper method for the list REST call
|
268
|
+
#
|
269
|
+
# @param request_pb [::Google::Cloud::Compute::V1::ListRegionInstanceTemplatesRequest]
|
270
|
+
# A request object representing the call parameters. Required.
|
271
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
272
|
+
# Uri, Body, Query string parameters
|
273
|
+
def self.transcode_list_request request_pb
|
274
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
275
|
+
.with_bindings(
|
276
|
+
uri_method: :get,
|
277
|
+
uri_template: "/compute/v1/projects/{project}/regions/{region}/instanceTemplates",
|
278
|
+
matches: [
|
279
|
+
["project", %r{^[^/]+/?$}, false],
|
280
|
+
["region", %r{^[^/]+/?$}, false]
|
281
|
+
]
|
282
|
+
)
|
283
|
+
transcoder.transcode request_pb
|
284
|
+
end
|
285
|
+
end
|
286
|
+
end
|
287
|
+
end
|
288
|
+
end
|
289
|
+
end
|
290
|
+
end
|
291
|
+
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/rest"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/compute/v1/version"
|
24
|
+
|
25
|
+
require "google/cloud/compute/v1/region_instance_templates/credentials"
|
26
|
+
require "google/cloud/compute/v1/region_instance_templates/rest/client"
|
27
|
+
|
28
|
+
module Google
|
29
|
+
module Cloud
|
30
|
+
module Compute
|
31
|
+
module V1
|
32
|
+
##
|
33
|
+
# The RegionInstanceTemplates API.
|
34
|
+
#
|
35
|
+
# To load this service and instantiate a REST client:
|
36
|
+
#
|
37
|
+
# require "google/cloud/compute/v1/region_instance_templates/rest"
|
38
|
+
# client = ::Google::Cloud::Compute::V1::RegionInstanceTemplates::Rest::Client.new
|
39
|
+
#
|
40
|
+
module RegionInstanceTemplates
|
41
|
+
# Client for the REST transport
|
42
|
+
module Rest
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
helper_path = ::File.join __dir__, "rest", "helpers.rb"
|
51
|
+
require "google/cloud/compute/v1/region_instance_templates/rest/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,47 @@
|
|
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/config"
|
20
|
+
require "gapic/config/method"
|
21
|
+
|
22
|
+
require "google/cloud/compute/v1/version"
|
23
|
+
|
24
|
+
require "google/cloud/compute/v1/region_instance_templates/credentials"
|
25
|
+
require "google/cloud/compute/v1/region_instance_templates/rest"
|
26
|
+
|
27
|
+
module Google
|
28
|
+
module Cloud
|
29
|
+
module Compute
|
30
|
+
module V1
|
31
|
+
##
|
32
|
+
# The RegionInstanceTemplates API.
|
33
|
+
#
|
34
|
+
# @example Load this service and instantiate a REST client
|
35
|
+
#
|
36
|
+
# require "google/cloud/compute/v1/region_instance_templates/rest"
|
37
|
+
# client = ::Google::Cloud::Compute::V1::RegionInstanceTemplates::Rest::Client.new
|
38
|
+
#
|
39
|
+
module RegionInstanceTemplates
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
helper_path = ::File.join __dir__, "region_instance_templates", "helpers.rb"
|
47
|
+
require "google/cloud/compute/v1/region_instance_templates/helpers" if ::File.file? helper_path
|
@@ -120,7 +120,7 @@ module Google
|
|
120
120
|
credentials = @config.credentials
|
121
121
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
122
122
|
# but only if the default endpoint does not have a region prefix.
|
123
|
-
enable_self_signed_jwt = @config.endpoint ==
|
123
|
+
enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
124
124
|
!@config.endpoint.split(".").first.include?("-")
|
125
125
|
credentials ||= Credentials.default scope: @config.scope,
|
126
126
|
enable_self_signed_jwt: enable_self_signed_jwt
|
@@ -264,9 +264,9 @@ module Google
|
|
264
264
|
# * (`String`) The path to a service account key file in JSON format
|
265
265
|
# * (`Hash`) A service account key as a Hash
|
266
266
|
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
267
|
-
# (see the [googleauth docs](https://
|
267
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
268
268
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
269
|
-
# (see the [signet docs](https://
|
269
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
270
270
|
# * (`nil`) indicating no credentials
|
271
271
|
# @return [::Object]
|
272
272
|
# @!attribute [rw] scope
|
@@ -299,7 +299,9 @@ module Google
|
|
299
299
|
class Configuration
|
300
300
|
extend ::Gapic::Config
|
301
301
|
|
302
|
-
|
302
|
+
DEFAULT_ENDPOINT = "compute.googleapis.com"
|
303
|
+
|
304
|
+
config_attr :endpoint, DEFAULT_ENDPOINT, ::String
|
303
305
|
config_attr :credentials, nil do |value|
|
304
306
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
305
307
|
allowed.any? { |klass| klass === value }
|
@@ -59,7 +59,7 @@ module Google
|
|
59
59
|
|
60
60
|
verb, uri, query_string_params, body = ServiceStub.transcode_bulk_insert_request request_pb
|
61
61
|
query_string_params = if query_string_params.any?
|
62
|
-
query_string_params.to_h { |p| p.split
|
62
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
63
63
|
else
|
64
64
|
{}
|
65
65
|
end
|
@@ -132,7 +132,7 @@ module Google
|
|
132
132
|
credentials = @config.credentials
|
133
133
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
134
134
|
# but only if the default endpoint does not have a region prefix.
|
135
|
-
enable_self_signed_jwt = @config.endpoint ==
|
135
|
+
enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
136
136
|
!@config.endpoint.split(".").first.include?("-")
|
137
137
|
credentials ||= Credentials.default scope: @config.scope,
|
138
138
|
enable_self_signed_jwt: enable_self_signed_jwt
|
@@ -239,7 +239,7 @@ module Google
|
|
239
239
|
end
|
240
240
|
|
241
241
|
##
|
242
|
-
# Returns the specified network endpoint group.
|
242
|
+
# Returns the specified network endpoint group.
|
243
243
|
#
|
244
244
|
# @overload get(request, options = nil)
|
245
245
|
# Pass arguments to `get` via a request object, either of type
|
@@ -494,9 +494,9 @@ module Google
|
|
494
494
|
# * (`String`) The path to a service account key file in JSON format
|
495
495
|
# * (`Hash`) A service account key as a Hash
|
496
496
|
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
497
|
-
# (see the [googleauth docs](https://
|
497
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
498
498
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
499
|
-
# (see the [signet docs](https://
|
499
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
500
500
|
# * (`nil`) indicating no credentials
|
501
501
|
# @return [::Object]
|
502
502
|
# @!attribute [rw] scope
|
@@ -529,7 +529,9 @@ module Google
|
|
529
529
|
class Configuration
|
530
530
|
extend ::Gapic::Config
|
531
531
|
|
532
|
-
|
532
|
+
DEFAULT_ENDPOINT = "compute.googleapis.com"
|
533
|
+
|
534
|
+
config_attr :endpoint, DEFAULT_ENDPOINT, ::String
|
533
535
|
config_attr :credentials, nil do |value|
|
534
536
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
535
537
|
allowed.any? { |klass| klass === value }
|
@@ -59,7 +59,7 @@ module Google
|
|
59
59
|
|
60
60
|
verb, uri, query_string_params, body = ServiceStub.transcode_delete_request request_pb
|
61
61
|
query_string_params = if query_string_params.any?
|
62
|
-
query_string_params.to_h { |p| p.split
|
62
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
63
63
|
else
|
64
64
|
{}
|
65
65
|
end
|
@@ -97,7 +97,7 @@ module Google
|
|
97
97
|
|
98
98
|
verb, uri, query_string_params, body = ServiceStub.transcode_get_request request_pb
|
99
99
|
query_string_params = if query_string_params.any?
|
100
|
-
query_string_params.to_h { |p| p.split
|
100
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
101
101
|
else
|
102
102
|
{}
|
103
103
|
end
|
@@ -135,7 +135,7 @@ module Google
|
|
135
135
|
|
136
136
|
verb, uri, query_string_params, body = ServiceStub.transcode_insert_request request_pb
|
137
137
|
query_string_params = if query_string_params.any?
|
138
|
-
query_string_params.to_h { |p| p.split
|
138
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
139
139
|
else
|
140
140
|
{}
|
141
141
|
end
|
@@ -173,7 +173,7 @@ module Google
|
|
173
173
|
|
174
174
|
verb, uri, query_string_params, body = ServiceStub.transcode_list_request request_pb
|
175
175
|
query_string_params = if query_string_params.any?
|
176
|
-
query_string_params.to_h { |p| p.split
|
176
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
177
177
|
else
|
178
178
|
{}
|
179
179
|
end
|
@@ -170,7 +170,7 @@ module Google
|
|
170
170
|
credentials = @config.credentials
|
171
171
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
172
172
|
# but only if the default endpoint does not have a region prefix.
|
173
|
-
enable_self_signed_jwt = @config.endpoint ==
|
173
|
+
enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
174
174
|
!@config.endpoint.split(".").first.include?("-")
|
175
175
|
credentials ||= Credentials.default scope: @config.scope,
|
176
176
|
enable_self_signed_jwt: enable_self_signed_jwt
|
@@ -1499,9 +1499,9 @@ module Google
|
|
1499
1499
|
# * (`String`) The path to a service account key file in JSON format
|
1500
1500
|
# * (`Hash`) A service account key as a Hash
|
1501
1501
|
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
1502
|
-
# (see the [googleauth docs](https://
|
1502
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
1503
1503
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
1504
|
-
# (see the [signet docs](https://
|
1504
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
1505
1505
|
# * (`nil`) indicating no credentials
|
1506
1506
|
# @return [::Object]
|
1507
1507
|
# @!attribute [rw] scope
|
@@ -1534,7 +1534,9 @@ module Google
|
|
1534
1534
|
class Configuration
|
1535
1535
|
extend ::Gapic::Config
|
1536
1536
|
|
1537
|
-
|
1537
|
+
DEFAULT_ENDPOINT = "compute.googleapis.com"
|
1538
|
+
|
1539
|
+
config_attr :endpoint, DEFAULT_ENDPOINT, ::String
|
1538
1540
|
config_attr :credentials, nil do |value|
|
1539
1541
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1540
1542
|
allowed.any? { |klass| klass === value }
|