Class: Google::Cloud::Config::V1::Config::Client
- Inherits:
-
Object
- Object
- Google::Cloud::Config::V1::Config::Client
- Includes:
- Paths
- Defined in:
- lib/google/cloud/config/v1/config/client.rb
Overview
Client for the Config service.
Infrastructure Manager is a managed service that automates the deployment and management of Google Cloud infrastructure resources.
Defined Under Namespace
Classes: Configuration
Instance Attribute Summary collapse
-
#iam_policy_client ⇒ Google::Iam::V1::IAMPolicy::Client
readonly
Get the associated client for mix-in of the IAMPolicy.
-
#location_client ⇒ Google::Cloud::Location::Locations::Client
readonly
Get the associated client for mix-in of the Locations.
-
#operations_client ⇒ ::Google::Cloud::Config::V1::Config::Operations
readonly
Get the associated client for long-running operations.
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Client::Configuration
Configure the Config Client class.
Instance Method Summary collapse
-
#configure {|config| ... } ⇒ Client::Configuration
Configure the Config Client instance.
-
#create_deployment(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Creates a Deployment.
-
#delete_deployment(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Deletes a Deployment.
-
#delete_statefile(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes Terraform state file in a given deployment.
-
#export_deployment_statefile(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Config::V1::Statefile
Exports Terraform state file from a given deployment.
-
#export_lock_info(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Config::V1::LockInfo
Exports the lock info on a locked deployment.
-
#export_revision_statefile(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Config::V1::Statefile
Exports Terraform state file from a given revision.
-
#get_deployment(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Config::V1::Deployment
Gets details about a Deployment.
-
#get_resource(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Config::V1::Resource
Gets details about a Resource deployed by Infra Manager.
-
#get_revision(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Config::V1::Revision
Gets details about a Revision.
-
#import_statefile(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Config::V1::Statefile
Imports Terraform state file in a given deployment.
-
#initialize {|config| ... } ⇒ Client
constructor
Create a new Config client object.
-
#list_deployments(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Config::V1::Deployment>
Lists Deployments in a given project and location.
-
#list_resources(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Config::V1::Resource>
Lists Resources in a given revision.
-
#list_revisions(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Config::V1::Revision>
Lists Revisions of a deployment.
-
#lock_deployment(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Locks a deployment.
-
#unlock_deployment(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Unlocks a locked deployment.
-
#update_deployment(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Updates a Deployment.
Methods included from Paths
#deployment_path, #location_path, #resource_path, #revision_path, #service_account_path, #worker_pool_path
Constructor Details
#initialize {|config| ... } ⇒ Client
Create a new Config client object.
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/google/cloud/config/v1/config/client.rb', line 112 def initialize # These require statements are intentionally placed here to initialize # the gRPC module only when it's required. # See https://github.com/googleapis/toolkit/issues/446 require "gapic/grpc" require "google/cloud/config/v1/config_services_pb" # Create the configuration object @config = Configuration.new Client.configure # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials # Use self-signed JWT if the endpoint is unchanged from default, # but only if the default endpoint does not have a region prefix. enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT && !@config.endpoint.split(".").first.include?("-") credentials ||= Credentials.default scope: @config.scope, enable_self_signed_jwt: enable_self_signed_jwt if credentials.is_a?(::String) || credentials.is_a?(::Hash) credentials = Credentials.new credentials, scope: @config.scope end @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @operations_client = Operations.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint end @location_client = Google::Cloud::Location::Locations::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint end @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint end @config_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Config::V1::Config::Stub, credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) end |
Instance Attribute Details
#iam_policy_client ⇒ Google::Iam::V1::IAMPolicy::Client (readonly)
Get the associated client for mix-in of the IAMPolicy.
186 187 188 |
# File 'lib/google/cloud/config/v1/config/client.rb', line 186 def iam_policy_client @iam_policy_client end |
#location_client ⇒ Google::Cloud::Location::Locations::Client (readonly)
Get the associated client for mix-in of the Locations.
179 180 181 |
# File 'lib/google/cloud/config/v1/config/client.rb', line 179 def location_client @location_client end |
#operations_client ⇒ ::Google::Cloud::Config::V1::Config::Operations (readonly)
Get the associated client for long-running operations.
172 173 174 |
# File 'lib/google/cloud/config/v1/config/client.rb', line 172 def operations_client @operations_client end |
Class Method Details
.configure {|config| ... } ⇒ Client::Configuration
Configure the Config Client class.
See Configuration for a description of the configuration fields.
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/google/cloud/config/v1/config/client.rb', line 59 def self.configure @configure ||= begin namespace = ["Google", "Cloud", "Config", "V1"] parent_config = while namespace.any? parent_name = namespace.join "::" parent_const = const_get parent_name break parent_const.configure if parent_const.respond_to? :configure namespace.pop end default_config = Client::Configuration.new parent_config default_config end yield @configure if block_given? @configure end |
Instance Method Details
#configure {|config| ... } ⇒ Client::Configuration
Configure the Config Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.
See Configuration for a description of the configuration fields.
91 92 93 94 |
# File 'lib/google/cloud/config/v1/config/client.rb', line 91 def configure yield @config if block_given? @config end |
#create_deployment(request, options = nil) ⇒ ::Gapic::Operation #create_deployment(parent: nil, deployment_id: nil, deployment: nil, request_id: nil) ⇒ ::Gapic::Operation
Creates a Deployment.
471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 |
# File 'lib/google/cloud/config/v1/config/client.rb', line 471 def create_deployment request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::CreateDeploymentRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_deployment..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Config::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_deployment.timeout, metadata: , retry_policy: @config.rpcs.create_deployment.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_stub.call_rpc :create_deployment, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_deployment(request, options = nil) ⇒ ::Gapic::Operation #delete_deployment(name: nil, request_id: nil, force: nil, delete_policy: nil) ⇒ ::Gapic::Operation
Deletes a Deployment.
705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 |
# File 'lib/google/cloud/config/v1/config/client.rb', line 705 def delete_deployment request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::DeleteDeploymentRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_deployment..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Config::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_deployment.timeout, metadata: , retry_policy: @config.rpcs.delete_deployment.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_stub.call_rpc :delete_deployment, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_statefile(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_statefile(name: nil, lock_id: nil) ⇒ ::Google::Protobuf::Empty
Deletes Terraform state file in a given deployment.
1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 |
# File 'lib/google/cloud/config/v1/config/client.rb', line 1477 def delete_statefile request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::DeleteStatefileRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_statefile..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Config::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_statefile.timeout, metadata: , retry_policy: @config.rpcs.delete_statefile.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_stub.call_rpc :delete_statefile, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#export_deployment_statefile(request, options = nil) ⇒ ::Google::Cloud::Config::V1::Statefile #export_deployment_statefile(parent: nil, draft: nil) ⇒ ::Google::Cloud::Config::V1::Statefile
Exports Terraform state file from a given deployment.
1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 |
# File 'lib/google/cloud/config/v1/config/client.rb', line 1208 def export_deployment_statefile request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::ExportDeploymentStatefileRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.export_deployment_statefile..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Config::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.export_deployment_statefile.timeout, metadata: , retry_policy: @config.rpcs.export_deployment_statefile.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_stub.call_rpc :export_deployment_statefile, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#export_lock_info(request, options = nil) ⇒ ::Google::Cloud::Config::V1::LockInfo #export_lock_info(name: nil) ⇒ ::Google::Cloud::Config::V1::LockInfo
Exports the lock info on a locked deployment.
1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 |
# File 'lib/google/cloud/config/v1/config/client.rb', line 1753 def export_lock_info request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::ExportLockInfoRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.export_lock_info..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Config::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.export_lock_info.timeout, metadata: , retry_policy: @config.rpcs.export_lock_info.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_stub.call_rpc :export_lock_info, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#export_revision_statefile(request, options = nil) ⇒ ::Google::Cloud::Config::V1::Statefile #export_revision_statefile(parent: nil) ⇒ ::Google::Cloud::Config::V1::Statefile
Exports Terraform state file from a given revision.
1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 |
# File 'lib/google/cloud/config/v1/config/client.rb', line 1295 def export_revision_statefile request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::ExportRevisionStatefileRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.export_revision_statefile..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Config::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.export_revision_statefile.timeout, metadata: , retry_policy: @config.rpcs.export_revision_statefile.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_stub.call_rpc :export_revision_statefile, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_deployment(request, options = nil) ⇒ ::Google::Cloud::Config::V1::Deployment #get_deployment(name: nil) ⇒ ::Google::Cloud::Config::V1::Deployment
Gets details about a Deployment.
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 |
# File 'lib/google/cloud/config/v1/config/client.rb', line 359 def get_deployment request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::GetDeploymentRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_deployment..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Config::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_deployment.timeout, metadata: , retry_policy: @config.rpcs.get_deployment.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_stub.call_rpc :get_deployment, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_resource(request, options = nil) ⇒ ::Google::Cloud::Config::V1::Resource #get_resource(name: nil) ⇒ ::Google::Cloud::Config::V1::Resource
Gets details about a Resource deployed by Infra Manager.
1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 |
# File 'lib/google/cloud/config/v1/config/client.rb', line 1002 def get_resource request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::GetResourceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_resource..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Config::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_resource.timeout, metadata: , retry_policy: @config.rpcs.get_resource.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_stub.call_rpc :get_resource, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_revision(request, options = nil) ⇒ ::Google::Cloud::Config::V1::Revision #get_revision(name: nil) ⇒ ::Google::Cloud::Config::V1::Revision
Gets details about a Revision.
915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 |
# File 'lib/google/cloud/config/v1/config/client.rb', line 915 def get_revision request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::GetRevisionRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_revision..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Config::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_revision.timeout, metadata: , retry_policy: @config.rpcs.get_revision.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_stub.call_rpc :get_revision, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#import_statefile(request, options = nil) ⇒ ::Google::Cloud::Config::V1::Statefile #import_statefile(parent: nil, lock_id: nil, skip_draft: nil) ⇒ ::Google::Cloud::Config::V1::Statefile
Imports Terraform state file in a given deployment. The state file does not take effect until the Deployment has been unlocked.
1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 |
# File 'lib/google/cloud/config/v1/config/client.rb', line 1388 def import_statefile request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::ImportStatefileRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.import_statefile..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Config::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.import_statefile.timeout, metadata: , retry_policy: @config.rpcs.import_statefile.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_stub.call_rpc :import_statefile, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_deployments(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Config::V1::Deployment> #list_deployments(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Config::V1::Deployment>
Lists Deployments in a given project and location.
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
# File 'lib/google/cloud/config/v1/config/client.rb', line 272 def list_deployments request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::ListDeploymentsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_deployments..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Config::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_deployments.timeout, metadata: , retry_policy: @config.rpcs.list_deployments.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_stub.call_rpc :list_deployments, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @config_stub, :list_deployments, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_resources(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Config::V1::Resource> #list_resources(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Config::V1::Resource>
Lists Resources in a given revision.
1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 |
# File 'lib/google/cloud/config/v1/config/client.rb', line 1116 def list_resources request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::ListResourcesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_resources..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Config::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_resources.timeout, metadata: , retry_policy: @config.rpcs.list_resources.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_stub.call_rpc :list_resources, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @config_stub, :list_resources, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_revisions(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Config::V1::Revision> #list_revisions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Config::V1::Revision>
Lists Revisions of a deployment.
828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 |
# File 'lib/google/cloud/config/v1/config/client.rb', line 828 def list_revisions request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::ListRevisionsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_revisions..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Config::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_revisions.timeout, metadata: , retry_policy: @config.rpcs.list_revisions.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_stub.call_rpc :list_revisions, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @config_stub, :list_revisions, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#lock_deployment(request, options = nil) ⇒ ::Gapic::Operation #lock_deployment(name: nil) ⇒ ::Gapic::Operation
Locks a deployment.
1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 |
# File 'lib/google/cloud/config/v1/config/client.rb', line 1570 def lock_deployment request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::LockDeploymentRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.lock_deployment..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Config::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.lock_deployment.timeout, metadata: , retry_policy: @config.rpcs.lock_deployment.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_stub.call_rpc :lock_deployment, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#unlock_deployment(request, options = nil) ⇒ ::Gapic::Operation #unlock_deployment(name: nil, lock_id: nil) ⇒ ::Gapic::Operation
Unlocks a locked deployment.
1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 |
# File 'lib/google/cloud/config/v1/config/client.rb', line 1666 def unlock_deployment request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::UnlockDeploymentRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.unlock_deployment..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Config::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.unlock_deployment.timeout, metadata: , retry_policy: @config.rpcs.unlock_deployment.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_stub.call_rpc :unlock_deployment, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_deployment(request, options = nil) ⇒ ::Gapic::Operation #update_deployment(update_mask: nil, deployment: nil, request_id: nil) ⇒ ::Gapic::Operation
Updates a Deployment.
589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 |
# File 'lib/google/cloud/config/v1/config/client.rb', line 589 def update_deployment request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::UpdateDeploymentRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_deployment..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Config::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.deployment&.name header_params["deployment.name"] = request.deployment.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_deployment.timeout, metadata: , retry_policy: @config.rpcs.update_deployment.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @config_stub.call_rpc :update_deployment, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |