google-cloud-compute 1.10.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/google/cloud/compute/version.rb +1 -1
- data/lib/google/cloud/compute.rb +63 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ab79b20f2c3789e2335f26762a93da37d6334e73e4437c3c5779e8edaea10b1
|
4
|
+
data.tar.gz: 5e4fa2f02143dd5fb234fa0b460bd74ab74741b5b7179485520dd9fc16d2032c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4eb1e27665c6cc756959eb60d96fbe08be5e26525b9a450b27a72d877bf99c0ea3463423fcd0b78c7e42a718dba5286500c7dd6d6ab037f39d903dc249349ba5
|
7
|
+
data.tar.gz: 823b0d2b14e0e073729454d816cc9fc4ce6af5735ed646c47d01b829279283e43a624ae97db72c05d5f0b859aa17d4de84c4cdcf949d5d6b58f2162e1bc932e8
|
data/lib/google/cloud/compute.rb
CHANGED
@@ -4645,6 +4645,69 @@ module Google
|
|
4645
4645
|
false
|
4646
4646
|
end
|
4647
4647
|
|
4648
|
+
##
|
4649
|
+
# Create a new client object for ReservationBlocks.
|
4650
|
+
#
|
4651
|
+
# By default, this returns an instance of
|
4652
|
+
# [Google::Cloud::Compute::V1::ReservationBlocks::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-ReservationBlocks-Rest-Client)
|
4653
|
+
# for a REST client for version V1 of the API.
|
4654
|
+
# However, you can specify a different API version by passing it in the
|
4655
|
+
# `version` parameter. If the ReservationBlocks service is
|
4656
|
+
# supported by that API version, and the corresponding gem is available, the
|
4657
|
+
# appropriate versioned client will be returned.
|
4658
|
+
#
|
4659
|
+
# Raises an exception if the currently installed versioned client gem for the
|
4660
|
+
# given API version does not support the ReservationBlocks service.
|
4661
|
+
# You can determine whether the method will succeed by calling
|
4662
|
+
# {Google::Cloud::Compute.reservation_blocks_available?}.
|
4663
|
+
#
|
4664
|
+
# ## About ReservationBlocks
|
4665
|
+
#
|
4666
|
+
# The ReservationBlocks API.
|
4667
|
+
#
|
4668
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
4669
|
+
# Defaults to `:v1`.
|
4670
|
+
# @return [::Object] A client object for the specified version.
|
4671
|
+
#
|
4672
|
+
def self.reservation_blocks version: :v1, &block
|
4673
|
+
require "google/cloud/compute/#{version.to_s.downcase}"
|
4674
|
+
|
4675
|
+
package_name = Google::Cloud::Compute
|
4676
|
+
.constants
|
4677
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
4678
|
+
.first
|
4679
|
+
service_module = Google::Cloud::Compute.const_get(package_name).const_get(:ReservationBlocks)
|
4680
|
+
service_module.const_get(:Rest).const_get(:Client).new(&block)
|
4681
|
+
end
|
4682
|
+
|
4683
|
+
##
|
4684
|
+
# Determines whether the ReservationBlocks service is supported by the current client.
|
4685
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::Compute.reservation_blocks}.
|
4686
|
+
# If false, that method will raise an exception. This could happen if the given
|
4687
|
+
# API version does not exist or does not support the ReservationBlocks service,
|
4688
|
+
# or if the versioned client gem needs an update to support the ReservationBlocks service.
|
4689
|
+
#
|
4690
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
4691
|
+
# Defaults to `:v1`.
|
4692
|
+
# @return [boolean] Whether the service is available.
|
4693
|
+
#
|
4694
|
+
def self.reservation_blocks_available? version: :v1
|
4695
|
+
require "google/cloud/compute/#{version.to_s.downcase}"
|
4696
|
+
package_name = Google::Cloud::Compute
|
4697
|
+
.constants
|
4698
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
4699
|
+
.first
|
4700
|
+
return false unless package_name
|
4701
|
+
service_module = Google::Cloud::Compute.const_get package_name
|
4702
|
+
return false unless service_module.const_defined? :ReservationBlocks
|
4703
|
+
service_module = service_module.const_get :ReservationBlocks
|
4704
|
+
return false unless service_module.const_defined? :Rest
|
4705
|
+
service_module = service_module.const_get :Rest
|
4706
|
+
service_module.const_defined? :Client
|
4707
|
+
rescue ::LoadError
|
4708
|
+
false
|
4709
|
+
end
|
4710
|
+
|
4648
4711
|
##
|
4649
4712
|
# Create a new client object for Reservations.
|
4650
4713
|
#
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-compute
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-04-21 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: google-cloud-compute-v1
|
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0'
|
71
71
|
requirements: []
|
72
|
-
rubygems_version: 3.6.
|
72
|
+
rubygems_version: 3.6.5
|
73
73
|
specification_version: 4
|
74
74
|
summary: API Client library for the Google Cloud Compute API
|
75
75
|
test_files: []
|