Reference documentation and code samples for the Google Cloud Compute V1 API class Google::Cloud::Compute::V1::ReservationBlocks::Rest::Client.
REST client for the ReservationBlocks service.
The ReservationBlocks API.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the ReservationBlocks Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all ReservationBlocks clients ::Google::Cloud::Compute::V1::ReservationBlocks::Rest::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure the ReservationBlocks 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 Client.configure.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#get
def get(request, options = nil) -> ::Google::Cloud::Compute::V1::ReservationBlocksGetResponse
def get(project: nil, reservation: nil, reservation_block: nil, view: nil, zone: nil) -> ::Google::Cloud::Compute::V1::ReservationBlocksGetResponseRetrieves information about the specified reservation block.
def get(request, options = nil) -> ::Google::Cloud::Compute::V1::ReservationBlocksGetResponseget via a request object, either of type
GetReservationBlockRequest or an equivalent Hash.
- request (::Google::Cloud::Compute::V1::GetReservationBlockRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get(project: nil, reservation: nil, reservation_block: nil, view: nil, zone: nil) -> ::Google::Cloud::Compute::V1::ReservationBlocksGetResponseget via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- project (::String) — Project ID for this request.
- reservation (::String) — The name of the reservation. Name should conform to RFC1035 or be a resource ID.
- reservation_block (::String) — The name of the reservation block. Name should conform to RFC1035 or be a resource ID.
- view (::String) — View of the Block. Check the View enum for the list of possible values.
- zone (::String) — Name of the zone for this request. Zone name should conform to RFC1035.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Compute::V1::ReservationBlocksGetResponse)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/compute/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Compute::V1::ReservationBlocks::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Compute::V1::GetReservationBlockRequest.new # Call the get method. result = client.get request # The returned object is of type Google::Cloud::Compute::V1::ReservationBlocksGetResponse. p result
#get_iam_policy
def get_iam_policy(request, options = nil) -> ::Google::Cloud::Compute::V1::Policy
def get_iam_policy(options_requested_policy_version: nil, parent_resource: nil, project: nil, resource: nil, zone: nil) -> ::Google::Cloud::Compute::V1::PolicyGets the access control policy for a resource. May be empty if no such policy or resource exists.
def get_iam_policy(request, options = nil) -> ::Google::Cloud::Compute::V1::Policyget_iam_policy via a request object, either of type
GetIamPolicyReservationBlockRequest or an equivalent Hash.
- request (::Google::Cloud::Compute::V1::GetIamPolicyReservationBlockRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_iam_policy(options_requested_policy_version: nil, parent_resource: nil, project: nil, resource: nil, zone: nil) -> ::Google::Cloud::Compute::V1::Policyget_iam_policy via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- options_requested_policy_version (::Integer) — Requested IAM Policy version.
- parent_resource (::String) — Name or id of parent resource of the resource for this request.
- project (::String) — Project ID for this request.
- resource (::String) — Name or id of the resource for this request.
- zone (::String) — The name of the zone for this request.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Compute::V1::Policy)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/compute/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Compute::V1::ReservationBlocks::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Compute::V1::GetIamPolicyReservationBlockRequest.new # Call the get_iam_policy method. result = client.get_iam_policy request # The returned object is of type Google::Cloud::Compute::V1::Policy. p result
#initialize
def initialize() { |config| ... } -> ClientCreate a new ReservationBlocks REST client object.
- (config) — Configure the ReservationBlocks client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Compute::V1::ReservationBlocks::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Compute::V1::ReservationBlocks::Rest::Client.new do |config| config.timeout = 10.0 end
#list
def list(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::ReservationBlock>
def list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, reservation: nil, return_partial_success: nil, zone: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::ReservationBlock>Retrieves a list of reservation blocks under a single reservation.
def list(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::ReservationBlock>list via a request object, either of type
ListReservationBlocksRequest or an equivalent Hash.
- request (::Google::Cloud::Compute::V1::ListReservationBlocksRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, reservation: nil, return_partial_success: nil, zone: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::ReservationBlock>list via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
filter (::String) — A filter expression that filters resources listed in the response. Most
Compute resources support two types of filter expressions:
expressions that support regular expressions and expressions that follow
API improvement proposal AIP-160.
These two types of filter expressions cannot be mixed in one request.
If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either
=,!=,>,<,<=,>=or:.For example, if you are filtering Compute Engine instances, you can exclude instances named
example-instanceby specifyingname != example-instance.The
:*comparison can be used to test whether a key has been defined. For example, to find all objects withownerlabel use:labels.owner:*You can also filter nested fields. For example, you could specify
scheduling.automaticRestart = falseto include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based onresource labels.To filter on multiple expressions, provide each separate expression within parentheses. For example:
(scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")By default, each expression is anANDexpression. However, you can includeANDandORexpressions explicitly. For example:(cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true)If you want to use a regular expression, use the
eq(equal) orne(not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples:fieldname eq unquoted literalfieldname eq 'single quoted literal'fieldname eq "double quoted literal"(fieldname1 eq literal) (fieldname2 ne "literal")The literal value is interpreted as a regular expression using GoogleRE2 library syntax. The literal value must match the entire field.
For example, to filter for instances that do not end with name "instance", you would use
name ne .*instance.You cannot combine constraints on multiple fields using regular expressions.
-
max_results (::Integer) — The maximum number of results per page that should be returned.
If the number of available results is larger than
maxResults, Compute Engine returns anextPageTokenthat can be used to get the next page of results in subsequent list requests. Acceptable values are0to500, inclusive. (Default:500) -
order_by (::String) — Sorts list results by a certain order. By default, results
are returned in alphanumerical order based on the resource name.
You can also sort results in descending order based on the creation timestamp using
orderBy="creationTimestamp desc". This sorts results based on thecreationTimestampfield in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.Currently, only sorting by
nameorcreationTimestamp descis supported. -
page_token (::String) — Specifies a page token to use. Set
pageTokento thenextPageTokenreturned by a previous list request to get the next page of results. - project (::String) — Project ID for this request.
- reservation (::String) — The name of the reservation. Name should conform to RFC1035 or be a resource ID.
-
return_partial_success (::Boolean) — Opt-in for partial success behavior which provides partial results in case
of failure. The default value is false.
For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.
- zone (::String) — Name of the zone for this request. Zone name should conform to RFC1035.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::ReservationBlock>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::ReservationBlock>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/compute/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Compute::V1::ReservationBlocks::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Compute::V1::ListReservationBlocksRequest.new # Call the list method. result = client.list request # The returned object is of type Google::Cloud::Compute::V1::ReservationBlocksListResponse. p result
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#perform_maintenance
def perform_maintenance(request, options = nil) -> ::Gapic::GenericLRO::Operation
def perform_maintenance(project: nil, request_id: nil, reservation: nil, reservation_block: nil, reservations_blocks_perform_maintenance_request_resource: nil, zone: nil) -> ::Gapic::GenericLRO::OperationAllows customers to perform maintenance on a reservation block
def perform_maintenance(request, options = nil) -> ::Gapic::GenericLRO::Operationperform_maintenance via a request object, either of type
PerformMaintenanceReservationBlockRequest or an equivalent Hash.
- request (::Google::Cloud::Compute::V1::PerformMaintenanceReservationBlockRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def perform_maintenance(project: nil, request_id: nil, reservation: nil, reservation_block: nil, reservations_blocks_perform_maintenance_request_resource: nil, zone: nil) -> ::Gapic::GenericLRO::Operationperform_maintenance via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- project (::String) — Project ID for this request.
-
request_id (::String) — An optional request ID to identify requests. Specify a unique request ID so
that if you must retry your request, the server will know to ignore the
request if it has already been completed.
For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
- reservation (::String) — The name of the reservation. Name should conform to RFC1035 or be a resource ID.
- reservation_block (::String) — The name of the reservation block. Name should conform to RFC1035 or be a resource ID.
- reservations_blocks_perform_maintenance_request_resource (::Google::Cloud::Compute::V1::ReservationsBlocksPerformMaintenanceRequest, ::Hash) — The body resource for this request
- zone (::String) — Name of the zone for this request. Zone name should conform to RFC1035.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::GenericLRO::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::GenericLRO::Operation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/compute/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Compute::V1::ReservationBlocks::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Compute::V1::PerformMaintenanceReservationBlockRequest.new # Call the perform_maintenance method. result = client.perform_maintenance request # The returned object is of type Google::Cloud::Compute::V1::Operation. p result
#set_iam_policy
def set_iam_policy(request, options = nil) -> ::Google::Cloud::Compute::V1::Policy
def set_iam_policy(parent_resource: nil, project: nil, resource: nil, zone: nil, zone_set_nested_policy_request_resource: nil) -> ::Google::Cloud::Compute::V1::PolicySets the access control policy on the specified resource. Replaces any existing policy.
def set_iam_policy(request, options = nil) -> ::Google::Cloud::Compute::V1::Policyset_iam_policy via a request object, either of type
SetIamPolicyReservationBlockRequest or an equivalent Hash.
- request (::Google::Cloud::Compute::V1::SetIamPolicyReservationBlockRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def set_iam_policy(parent_resource: nil, project: nil, resource: nil, zone: nil, zone_set_nested_policy_request_resource: nil) -> ::Google::Cloud::Compute::V1::Policyset_iam_policy via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- parent_resource (::String) — Name or id of parent resource of the resource for this request.
- project (::String) — Project ID for this request.
- resource (::String) — Name or id of the resource for this request.
- zone (::String) — The name of the zone for this request.
- zone_set_nested_policy_request_resource (::Google::Cloud::Compute::V1::ZoneSetNestedPolicyRequest, ::Hash) — The body resource for this request
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Compute::V1::Policy)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/compute/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Compute::V1::ReservationBlocks::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Compute::V1::SetIamPolicyReservationBlockRequest.new # Call the set_iam_policy method. result = client.set_iam_policy request # The returned object is of type Google::Cloud::Compute::V1::Policy. p result
#test_iam_permissions
def test_iam_permissions(request, options = nil) -> ::Google::Cloud::Compute::V1::TestPermissionsResponse
def test_iam_permissions(parent_resource: nil, project: nil, resource: nil, test_permissions_request_resource: nil, zone: nil) -> ::Google::Cloud::Compute::V1::TestPermissionsResponseReturns permissions that a caller has on the specified resource.
def test_iam_permissions(request, options = nil) -> ::Google::Cloud::Compute::V1::TestPermissionsResponsetest_iam_permissions via a request object, either of type
TestIamPermissionsReservationBlockRequest or an equivalent Hash.
- request (::Google::Cloud::Compute::V1::TestIamPermissionsReservationBlockRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def test_iam_permissions(parent_resource: nil, project: nil, resource: nil, test_permissions_request_resource: nil, zone: nil) -> ::Google::Cloud::Compute::V1::TestPermissionsResponsetest_iam_permissions via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- parent_resource (::String) — Name or id of parent resource of the resource for this request.
- project (::String) — Project ID for this request.
- resource (::String) — Name or id of the resource for this request.
- test_permissions_request_resource (::Google::Cloud::Compute::V1::TestPermissionsRequest, ::Hash) — The body resource for this request
- zone (::String) — The name of the zone for this request.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Compute::V1::TestPermissionsResponse)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/compute/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Compute::V1::ReservationBlocks::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Compute::V1::TestIamPermissionsReservationBlockRequest.new # Call the test_iam_permissions method. result = client.test_iam_permissions request # The returned object is of type Google::Cloud::Compute::V1::TestPermissionsResponse. p result
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (String)
#zone_operations
def zone_operations() -> ::Google::Cloud::Compute::V1::ZoneOperations::Rest::ClientGet the associated client for long-running operations via ZoneOperations.