Reference documentation and code samples for the Service Health V1 API class Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.
Client for the ServiceHealth service.
Request service health events relevant to your Google Cloud project.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the ServiceHealth Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all ServiceHealth clients ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure the ServiceHealth 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_event
def get_event(request, options = nil) -> ::Google::Cloud::ServiceHealth::V1::Event
def get_event(name: nil) -> ::Google::Cloud::ServiceHealth::V1::EventRetrieves a resource containing information about an event.
def get_event(request, options = nil) -> ::Google::Cloud::ServiceHealth::V1::Eventget_event via a request object, either of type
GetEventRequest or an equivalent Hash.
- request (::Google::Cloud::ServiceHealth::V1::GetEventRequest, ::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_event(name: nil) -> ::Google::Cloud::ServiceHealth::V1::Eventget_event 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).
-
name (::String) — Required. Unique name of the event in this scope including project
and location using the form
projects/{project_id}/locations/{location}/events/{event_id}.project_id- Project ID of the project that contains the event.
location- The location to get the service health events from.
event_id- Event ID to retrieve.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::ServiceHealth::V1::Event)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/service_health/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::ServiceHealth::V1::GetEventRequest.new # Call the get_event method. result = client.get_event request # The returned object is of type Google::Cloud::ServiceHealth::V1::Event. p result
#get_organization_event
def get_organization_event(request, options = nil) -> ::Google::Cloud::ServiceHealth::V1::OrganizationEvent
def get_organization_event(name: nil) -> ::Google::Cloud::ServiceHealth::V1::OrganizationEventRetrieves a resource containing information about an event affecting an organization .
def get_organization_event(request, options = nil) -> ::Google::Cloud::ServiceHealth::V1::OrganizationEventget_organization_event via a request object, either of type
GetOrganizationEventRequest or an equivalent Hash.
- request (::Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest, ::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_organization_event(name: nil) -> ::Google::Cloud::ServiceHealth::V1::OrganizationEventget_organization_event 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).
-
name (::String) — Required. Unique name of the event in this scope including organization and
event ID using the form
organizations/{organization_id}/locations/locations/global/organizationEvents/{event_id}.organization_id- ID (number) of the project that contains the event. To get yourorganization_id, see Getting your organization resource ID.
event_id- Organization event ID to retrieve.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::ServiceHealth::V1::OrganizationEvent)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/service_health/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::ServiceHealth::V1::GetOrganizationEventRequest.new # Call the get_organization_event method. result = client.get_organization_event request # The returned object is of type Google::Cloud::ServiceHealth::V1::OrganizationEvent. p result
#get_organization_impact
def get_organization_impact(request, options = nil) -> ::Google::Cloud::ServiceHealth::V1::OrganizationImpact
def get_organization_impact(name: nil) -> ::Google::Cloud::ServiceHealth::V1::OrganizationImpactRetrieves a resource containing information about impact to an asset under an organization affected by a service health event.
def get_organization_impact(request, options = nil) -> ::Google::Cloud::ServiceHealth::V1::OrganizationImpactget_organization_impact via a request object, either of type
GetOrganizationImpactRequest or an equivalent Hash.
- request (::Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest, ::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_organization_impact(name: nil) -> ::Google::Cloud::ServiceHealth::V1::OrganizationImpactget_organization_impact 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).
-
name (::String) — Required. Name of the resource using the form
organizations/{organization_id}/locations/global/organizationImpacts/{organization_impact_id}.organization_id- ID (number) of the organization that contains the event. To get yourorganization_id, see Getting your organization resource ID.
organization_impact_id- ID of the OrganizationImpact resource.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::ServiceHealth::V1::OrganizationImpact)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/service_health/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::ServiceHealth::V1::GetOrganizationImpactRequest.new # Call the get_organization_impact method. result = client.get_organization_impact request # The returned object is of type Google::Cloud::ServiceHealth::V1::OrganizationImpact. p result
#initialize
def initialize() { |config| ... } -> ClientCreate a new ServiceHealth client object.
- (config) — Configure the ServiceHealth client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new # Create a client using a custom configuration client = ::Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new do |config| config.timeout = 10.0 end
#list_events
def list_events(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::Event>
def list_events(parent: nil, page_size: nil, page_token: nil, filter: nil, view: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::Event>Lists events under a given project and location.
def list_events(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::Event>list_events via a request object, either of type
ListEventsRequest or an equivalent Hash.
- request (::Google::Cloud::ServiceHealth::V1::ListEventsRequest, ::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_events(parent: nil, page_size: nil, page_token: nil, filter: nil, view: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::Event>list_events 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 (::String) — Required. Parent value using the form
projects/{project_id}/locations/{location}/events.project_id- ID of the project for which to list service health events.location- The location to get the service health events from. To retrieve service health events of category = INCIDENT, uselocation=global. - page_size (::Integer) — Optional. The maximum number of events that should be returned. Acceptable values are 1 to 100, inclusive. (The default value is 10.) If more results are available, the service returns a next_page_token that you can use to get the next page of results in subsequent list requests. The service may return fewer events than the requested page_size.
-
page_token (::String) — Optional. A token identifying a page of results the server should return.
Provide Page token returned by a previous
ListEventscall to retrieve the next page of results. When paginating, all other parameters provided toListEventsmust match the call that provided the page token. -
filter (::String) — Optional. A filter expression that filters resources listed in the
response. The expression takes the following forms:
- field=value for
categoryandstate - field <, >, <=, or >= value for
update_time
Examples:category=INCIDENT,update_time>="2000-01-01T11:30:00-04:00",event_impacts.product.product_name:"Eventarc"
Multiple filter queries are separated by spaces. Example:
category=INCIDENT state=ACTIVE.By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly.
Filter is supported for the following fields:
category,state,update_time,event_impacts.product.product_name - field=value for
- view (::Google::Cloud::ServiceHealth::V1::EventView) — Optional. Event fields to include in response.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::Event>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::Event>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/service_health/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::ServiceHealth::V1::ListEventsRequest.new # Call the list_events method. result = client.list_events 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::ServiceHealth::V1::Event. p item end
#list_organization_events
def list_organization_events(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationEvent>
def list_organization_events(parent: nil, page_size: nil, page_token: nil, filter: nil, view: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationEvent>Lists organization events under a given organization and location.
def list_organization_events(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationEvent>list_organization_events via a request object, either of type
ListOrganizationEventsRequest or an equivalent Hash.
- request (::Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest, ::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_organization_events(parent: nil, page_size: nil, page_token: nil, filter: nil, view: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationEvent>list_organization_events 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 (::String) — Required. Parent value using the form
organizations/{organization_id}/locations/{location}/organizationEvents.organization_id- ID (number) of the project that contains the event. To get yourorganization_id, see Getting your organization resource ID.
location- The location to get the service health events from. To retrieve service health events of category = INCIDENT, uselocation=global. -
page_size (::Integer) — Optional. The maximum number of events that should be returned. Acceptable
values are
1to100, inclusive. (The default value is10.) If more results are available, the service returns anext_page_tokenthat you can use to get the next page of results in subsequent list requests. The service may return fewer events than the requestedpage_size. -
page_token (::String) — Optional. A token identifying a page of results the server should return.
Provide Page token returned by a previous
ListOrganizationEventscall to retrieve the next page of results.When paginating, all other parameters provided to
ListOrganizationEventsmust match the call that provided the page token. -
filter (::String) — Optional. A filter expression that filters resources listed in the
response. The expression takes the following forms:
- field=value for
categoryandstate - field <, >, <=, or >= value for
update_time
Examples:
category=INCIDENT,update_time>="2000-01-01T11:30:00-04:00"Multiple filter queries are space-separated. Example:
category=INCIDENT state=ACTIVE.By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly.
Filter is supported for the following fields:
category,state,update_time - field=value for
- view (::Google::Cloud::ServiceHealth::V1::OrganizationEventView) — Optional. OrganizationEvent fields to include in response.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationEvent>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationEvent>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/service_health/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::ServiceHealth::V1::ListOrganizationEventsRequest.new # Call the list_organization_events method. result = client.list_organization_events 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::ServiceHealth::V1::OrganizationEvent. p item end
#list_organization_impacts
def list_organization_impacts(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationImpact>
def list_organization_impacts(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationImpact>Lists assets impacted by organization events under a given organization and location.
def list_organization_impacts(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationImpact>list_organization_impacts via a request object, either of type
ListOrganizationImpactsRequest or an equivalent Hash.
- request (::Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest, ::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_organization_impacts(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationImpact>list_organization_impacts 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 (::String) — Required. Parent value using the form
organizations/{organization_id}/locations/{location}/organizationImpacts.organization_id- ID (number) of the project that contains the event. To get yourorganization_id, see Getting your organization resource ID. -
page_size (::Integer) — Optional. The maximum number of events that should be returned. Acceptable
values are
1to100, inclusive. The default value is10.If more results are available, the service returns a
next_page_tokenthat can be used to get the next page of results in subsequent list requests. The service may return fewer impacts than the requestedpage_size. -
page_token (::String) — Optional. A token identifying a page of results the server should return.
Provide
page_tokenreturned by a previousListOrganizationImpactscall to retrieve the next page of results.When paginating, all other parameters provided to
ListOrganizationImpactsmust match the call that provided the page token. -
filter (::String) — Optional. A filter expression that filters resources listed in the
response. The expression is in the form of
field:valuefor checking if a repeated field contains a value.Example:
events:organizations%2F{organization_id}%2Flocations%2Fglobal%2ForganizationEvents%2Fevent-idTo get your
{organization_id}, see Getting your organization resource ID.Multiple filter queries are separated by spaces.
By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. Filter is supported for the following fields:
events.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationImpact>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::ServiceHealth::V1::OrganizationImpact>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/service_health/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::ServiceHealth::V1::ServiceHealth::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::ServiceHealth::V1::ListOrganizationImpactsRequest.new # Call the list_organization_impacts method. result = client.list_organization_impacts 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::ServiceHealth::V1::OrganizationImpact. p item end
#location_client
def location_client() -> Google::Cloud::Location::Locations::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Client)
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (String)