Maintenance V1BETA API - Class Google::Cloud::Maintenance::Api::V1beta::Maintenance::Client (v0.1.0)

Reference documentation and code samples for the Maintenance V1BETA API class Google::Cloud::Maintenance::Api::V1beta::Maintenance::Client.

Client for the Maintenance service.

Unified Maintenance service

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the Maintenance Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all Maintenance clients
::Google::Cloud::Maintenance::Api::V1beta::Maintenance::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the Maintenance 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.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#get_resource_maintenance

def get_resource_maintenance(request, options = nil) -> ::Google::Cloud::Maintenance::Api::V1beta::ResourceMaintenance
def get_resource_maintenance(name: nil) -> ::Google::Cloud::Maintenance::Api::V1beta::ResourceMaintenance

Retrieve a single resource maintenance.

Overloads
def get_resource_maintenance(request, options = nil) -> ::Google::Cloud::Maintenance::Api::V1beta::ResourceMaintenance
Pass arguments to get_resource_maintenance via a request object, either of type GetResourceMaintenanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Maintenance::Api::V1beta::GetResourceMaintenanceRequest, ::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_resource_maintenance(name: nil) -> ::Google::Cloud::Maintenance::Api::V1beta::ResourceMaintenance
Pass arguments to get_resource_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).
Parameter
  • name (::String) — Required. The resource name of the resource within a service.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/maintenance/api/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Maintenance::Api::V1beta::Maintenance::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Maintenance::Api::V1beta::GetResourceMaintenanceRequest.new

# Call the get_resource_maintenance method.
result = client.get_resource_maintenance request

# The returned object is of type Google::Cloud::Maintenance::Api::V1beta::ResourceMaintenance.
p result

#initialize

def initialize() { |config| ... } -> Client

Create a new Maintenance client object.

Yields
  • (config) — Configure the Maintenance client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::Maintenance::Api::V1beta::Maintenance::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Maintenance::Api::V1beta::Maintenance::Client.new do |config|
  config.timeout = 10.0
end

#list_resource_maintenances

def list_resource_maintenances(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Maintenance::Api::V1beta::ResourceMaintenance>
def list_resource_maintenances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Maintenance::Api::V1beta::ResourceMaintenance>

Retrieve a collection of resource maintenances.

Overloads
def list_resource_maintenances(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Maintenance::Api::V1beta::ResourceMaintenance>
Pass arguments to list_resource_maintenances via a request object, either of type ListResourceMaintenancesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Maintenance::Api::V1beta::ListResourceMaintenancesRequest, ::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_resource_maintenances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Maintenance::Api::V1beta::ResourceMaintenance>
Pass arguments to list_resource_maintenances 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).
Parameters
  • parent (::String) — Required. The parent of the resource maintenance.
  • page_size (::Integer) — The maximum number of resource maintenances to send per page.
  • page_token (::String) — The page token: If the next_page_token from a previous response is provided, this request will send the subsequent page.
  • filter (::String) — Filter the list as specified in https://google.aip.dev/160.
  • order_by (::String) — Order results as specified in https://google.aip.dev/132.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/maintenance/api/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Maintenance::Api::V1beta::Maintenance::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Maintenance::Api::V1beta::ListResourceMaintenancesRequest.new

# Call the list_resource_maintenances method.
result = client.list_resource_maintenances request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Maintenance::Api::V1beta::ResourceMaintenance.
  p item
end

#location_client

def location_client() -> Google::Cloud::Location::Locations::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Client)

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#summarize_maintenances

def summarize_maintenances(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Maintenance::Api::V1beta::MaintenanceSummary>
def summarize_maintenances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Maintenance::Api::V1beta::MaintenanceSummary>

Retrieves the statistics of a specific maintenance.

Overloads
def summarize_maintenances(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Maintenance::Api::V1beta::MaintenanceSummary>
Pass arguments to summarize_maintenances via a request object, either of type SummarizeMaintenancesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Maintenance::Api::V1beta::SummarizeMaintenancesRequest, ::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 summarize_maintenances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Maintenance::Api::V1beta::MaintenanceSummary>
Pass arguments to summarize_maintenances 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).
Parameters
  • parent (::String) — Required. The parent of the resource maintenance. eg. projects/123/locations/*
  • page_size (::Integer) — The maximum number of resource maintenances to send per page. The default page size is 20 and the maximum is 1000.
  • page_token (::String) — The page token: If the next_page_token from a previous response is provided, this request will send the subsequent page.
  • filter (::String) —

    Filter the list as specified in https://google.aip.dev/160. Supported fields include:

    • state
    • resource.location
    • resource.resourceName
    • resource.type
    • maintenance.maintenanceName
    • maintenanceStartTime
    • maintenanceCompleteTime Examples:
    • state="SCHEDULED"
    • resource.location="us-central1-c"
    • resource.resourceName=~"*/instance-20241212-211259"
    • maintenanceStartTime>"2000-10-11T20:44:51Z"
    • state="SCHEDULED" OR resource.type="compute.googleapis.com/Instance"
    • maintenance.maitenanceName="eb3b709c-9ca1-5472-9fb6-800a3849eda1" AND maintenanceCompleteTime>"2000-10-11T20:44:51Z"
  • order_by (::String) — Order results as specified in https://google.aip.dev/132.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/maintenance/api/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Maintenance::Api::V1beta::Maintenance::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Maintenance::Api::V1beta::SummarizeMaintenancesRequest.new

# Call the summarize_maintenances method.
result = client.summarize_maintenances request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Maintenance::Api::V1beta::MaintenanceSummary.
  p item
end

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)