# Cloud Monitoring V3 API - Class Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client (v1.10.0)

1.10.0 (latest) 1.9.0 1.8.0 1.7.1 1.6.1 1.5.1 1.4.0 1.3.0 1.2.0 1.1.0 1.0.1 0.18.0 0.17.0 0.16.0 0.15.2 0.14.0 0.13.0 0.12.1 0.11.0 0.10.0 0.9.0 0.8.0 0.7.1 Reference documentation and code samples for the Cloud Monitoring V3 API class Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.

Client for the ServiceMonitoringService service.


<br />

The Cloud Monitoring Service-Oriented Monitoring API has endpoints for
managing and querying aspects of a Metrics Scope's services. These include
the `Service`'s monitored resources, its Service-Level Objectives, and a
taxonomy of categorized Health Metrics.

## Inherits

- Object

## Includes

- [Google::Cloud::Monitoring::V3::ServiceMonitoringService::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ServiceMonitoringService-Paths)

## Methods

### .configure

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

Configure the ServiceMonitoringService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ServiceMonitoringService-Client-Configuration "Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ServiceMonitoringService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ServiceMonitoringService-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all ServiceMonitoringService clients
::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.configure do |config|
  config.timeout = 10.0
end
```

### #configure

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

Configure the ServiceMonitoringService 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ServiceMonitoringService-Client#Google__Cloud__Monitoring__V3__ServiceMonitoringService__Client_configure_class_ "Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ServiceMonitoringService-Client-Configuration "Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ServiceMonitoringService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ServiceMonitoringService-Client-Configuration))

### #create_service

    def create_service(request, options = nil) -> ::Google::Cloud::Monitoring::V3::Service
    def create_service(parent: nil, service_id: nil, service: nil) -> ::Google::Cloud::Monitoring::V3::Service

Create a `Service`.
**Overloads**

    def create_service(request, options = nil) -> ::Google::Cloud::Monitoring::V3::Service

Pass arguments to `create_service` via a request object, either of type [CreateServiceRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-CreateServiceRequest "Google::Cloud::Monitoring::V3::CreateServiceRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::CreateServiceRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-CreateServiceRequest), ::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 create_service(parent: nil, service_id: nil, service: nil) -> ::Google::Cloud::Monitoring::V3::Service

Pass arguments to `create_service` 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. Resource
  [name](https://cloud.google.com/monitoring/api/v3#project_name) of the
  parent Metrics Scope. The format is:

      projects/[PROJECT_ID_OR_NUMBER]

- **service_id** (::String) --- Optional. The Service id to use for this Service. If omitted, an id will be generated instead. Must match the pattern `[a-z0-9\-]+`
- **service** ([::Google::Cloud::Monitoring::V3::Service](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-Service), ::Hash) --- Required. The `Service` to create.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Monitoring::V3::Service](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-Service))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Monitoring::V3::Service](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-Service))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::CreateServiceRequest.new

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

# The returned object is of type Google::Cloud::Monitoring::V3::Service.
p result
```

### #create_service_level_objective

    def create_service_level_objective(request, options = nil) -> ::Google::Cloud::Monitoring::V3::ServiceLevelObjective
    def create_service_level_objective(parent: nil, service_level_objective_id: nil, service_level_objective: nil) -> ::Google::Cloud::Monitoring::V3::ServiceLevelObjective

Create a `ServiceLevelObjective` for the given `Service`.
**Overloads**

    def create_service_level_objective(request, options = nil) -> ::Google::Cloud::Monitoring::V3::ServiceLevelObjective

Pass arguments to `create_service_level_objective` via a request object, either of type [CreateServiceLevelObjectiveRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-CreateServiceLevelObjectiveRequest "Google::Cloud::Monitoring::V3::CreateServiceLevelObjectiveRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::CreateServiceLevelObjectiveRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-CreateServiceLevelObjectiveRequest), ::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 create_service_level_objective(parent: nil, service_level_objective_id: nil, service_level_objective: nil) -> ::Google::Cloud::Monitoring::V3::ServiceLevelObjective

Pass arguments to `create_service_level_objective` 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. Resource name of the parent `Service`. The format is:

      projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]

- **service_level_objective_id** (::String) --- Optional. The ServiceLevelObjective id to use for this ServiceLevelObjective. If omitted, an id will be generated instead. Must match the pattern `^[a-zA-Z0-9-_:.]+$`
- **service_level_objective** ([::Google::Cloud::Monitoring::V3::ServiceLevelObjective](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ServiceLevelObjective), ::Hash) --- Required. The `ServiceLevelObjective` to create. The provided `name` will be respected if no `ServiceLevelObjective` exists with this name.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Monitoring::V3::ServiceLevelObjective](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ServiceLevelObjective))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Monitoring::V3::ServiceLevelObjective](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ServiceLevelObjective))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::CreateServiceLevelObjectiveRequest.new

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

# The returned object is of type Google::Cloud::Monitoring::V3::ServiceLevelObjective.
p result
```

### #delete_service

    def delete_service(request, options = nil) -> ::Google::Protobuf::Empty
    def delete_service(name: nil) -> ::Google::Protobuf::Empty

Soft delete this `Service`.
**Overloads**

    def delete_service(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_service` via a request object, either of type [DeleteServiceRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-DeleteServiceRequest "Google::Cloud::Monitoring::V3::DeleteServiceRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::DeleteServiceRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-DeleteServiceRequest), ::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 delete_service(name: nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_service` 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. Resource name of the `Service` to delete. The format is:

      projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]

**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Protobuf-Empty))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::DeleteServiceRequest.new

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

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #delete_service_level_objective

    def delete_service_level_objective(request, options = nil) -> ::Google::Protobuf::Empty
    def delete_service_level_objective(name: nil) -> ::Google::Protobuf::Empty

Delete the given `ServiceLevelObjective`.
**Overloads**

    def delete_service_level_objective(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_service_level_objective` via a request object, either of type [DeleteServiceLevelObjectiveRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-DeleteServiceLevelObjectiveRequest "Google::Cloud::Monitoring::V3::DeleteServiceLevelObjectiveRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::DeleteServiceLevelObjectiveRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-DeleteServiceLevelObjectiveRequest), ::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 delete_service_level_objective(name: nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_service_level_objective` 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. Resource name of the `ServiceLevelObjective` to delete. The
  format is:

      projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME]

**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Protobuf-Empty))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::DeleteServiceLevelObjectiveRequest.new

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

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #get_service

    def get_service(request, options = nil) -> ::Google::Cloud::Monitoring::V3::Service
    def get_service(name: nil) -> ::Google::Cloud::Monitoring::V3::Service

Get the named `Service`.
**Overloads**

    def get_service(request, options = nil) -> ::Google::Cloud::Monitoring::V3::Service

Pass arguments to `get_service` via a request object, either of type [GetServiceRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-GetServiceRequest "Google::Cloud::Monitoring::V3::GetServiceRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::GetServiceRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-GetServiceRequest), ::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_service(name: nil) -> ::Google::Cloud::Monitoring::V3::Service

Pass arguments to `get_service` 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. Resource name of the `Service`. The format is:

      projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]

**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Monitoring::V3::Service](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-Service))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Monitoring::V3::Service](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-Service))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::GetServiceRequest.new

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

# The returned object is of type Google::Cloud::Monitoring::V3::Service.
p result
```

### #get_service_level_objective

    def get_service_level_objective(request, options = nil) -> ::Google::Cloud::Monitoring::V3::ServiceLevelObjective
    def get_service_level_objective(name: nil, view: nil) -> ::Google::Cloud::Monitoring::V3::ServiceLevelObjective

Get a `ServiceLevelObjective` by name.
**Overloads**

    def get_service_level_objective(request, options = nil) -> ::Google::Cloud::Monitoring::V3::ServiceLevelObjective

Pass arguments to `get_service_level_objective` via a request object, either of type [GetServiceLevelObjectiveRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-GetServiceLevelObjectiveRequest "Google::Cloud::Monitoring::V3::GetServiceLevelObjectiveRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::GetServiceLevelObjectiveRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-GetServiceLevelObjectiveRequest), ::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_service_level_objective(name: nil, view: nil) -> ::Google::Cloud::Monitoring::V3::ServiceLevelObjective

Pass arguments to `get_service_level_objective` 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**

- **name** (::String) ---

  Required. Resource name of the `ServiceLevelObjective` to get. The format
  is:

      projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME]

- **view** ([::Google::Cloud::Monitoring::V3::ServiceLevelObjective::View](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ServiceLevelObjective-View)) --- View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Monitoring::V3::ServiceLevelObjective](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ServiceLevelObjective))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Monitoring::V3::ServiceLevelObjective](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ServiceLevelObjective))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::GetServiceLevelObjectiveRequest.new

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

# The returned object is of type Google::Cloud::Monitoring::V3::ServiceLevelObjective.
p result
```

### #initialize

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

Create a new ServiceMonitoringService client object.
**Yields**

- (config) --- Configure the ServiceMonitoringService client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ServiceMonitoringService-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ServiceMonitoringService-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_service_level_objectives

    def list_service_level_objectives(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::ServiceLevelObjective>
    def list_service_level_objectives(parent: nil, filter: nil, page_size: nil, page_token: nil, view: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::ServiceLevelObjective>

List the `ServiceLevelObjective`s for the given `Service`.
**Overloads**

    def list_service_level_objectives(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::ServiceLevelObjective>

Pass arguments to `list_service_level_objectives` via a request object, either of type [ListServiceLevelObjectivesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ListServiceLevelObjectivesRequest "Google::Cloud::Monitoring::V3::ListServiceLevelObjectivesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::ListServiceLevelObjectivesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ListServiceLevelObjectivesRequest), ::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_service_level_objectives(parent: nil, filter: nil, page_size: nil, page_token: nil, view: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::ServiceLevelObjective>

Pass arguments to `list_service_level_objectives` 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. Resource name of the parent containing the listed SLOs, either a
  project or a Monitoring Metrics Scope. The formats are:

      projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
      workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/-

- **filter** (::String) --- A filter specifying what `ServiceLevelObjective`s to return.
- **page_size** (::Integer) --- A non-negative number that is the maximum number of results to return. When 0, use default page size.
- **page_token** (::String) --- If this field is not empty then it must contain the `nextPageToken` value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call.
- **view** ([::Google::Cloud::Monitoring::V3::ServiceLevelObjective::View](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ServiceLevelObjective-View)) --- View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::PagedEnumerable\<[::Google::Cloud::Monitoring::V3::ServiceLevelObjective](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ServiceLevelObjective)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::PagedEnumerable\<[::Google::Cloud::Monitoring::V3::ServiceLevelObjective](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ServiceLevelObjective)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::ListServiceLevelObjectivesRequest.new

# Call the list_service_level_objectives method.
result = client.list_service_level_objectives 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::Monitoring::V3::ServiceLevelObjective.
  p item
end
```

### #list_services

    def list_services(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::Service>
    def list_services(parent: nil, filter: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::Service>

List `Service`s for this Metrics Scope.
**Overloads**

    def list_services(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::Service>

Pass arguments to `list_services` via a request object, either of type [ListServicesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ListServicesRequest "Google::Cloud::Monitoring::V3::ListServicesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::ListServicesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ListServicesRequest), ::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_services(parent: nil, filter: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::Service>

Pass arguments to `list_services` 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. Resource name of the parent containing the listed services,
  either a [project](https://cloud.google.com/monitoring/api/v3#project_name)
  or a Monitoring Metrics Scope. The formats are:

      projects/[PROJECT_ID_OR_NUMBER]
      workspaces/[HOST_PROJECT_ID_OR_NUMBER]

- **filter** (::String) --- A filter specifying what `Service`s to return. The filter supports filtering on a particular service-identifier type or one of its attributes.


  To filter on a particular service-identifier type, the `identifier_case`
  refers to which option in the `identifier` field is populated. For example,
  the filter `identifier_case = "CUSTOM"` would match all services with a
  value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE",
  "MESH_ISTIO", and the other options listed at
  https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service

  To filter on an attribute of a service-identifier type, apply the filter
  name by using the snake case of the service-identifier type and the
  attribute of that service-identifier type, and join the two with a period.
  For example, to filter by the `meshUid` field of the `MeshIstio`
  service-identifier type, you must filter on `mesh_istio.mesh_uid =
  "123"` to match all services with mesh UID "123". Service-identifier types
  and their attributes are described at
  https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service
- **page_size** (::Integer) --- A non-negative number that is the maximum number of results to return. When 0, use default page size.
- **page_token** (::String) --- If this field is not empty then it must contain the `nextPageToken` value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::PagedEnumerable\<[::Google::Cloud::Monitoring::V3::Service](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-Service)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::PagedEnumerable\<[::Google::Cloud::Monitoring::V3::Service](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-Service)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::ListServicesRequest.new

# Call the list_services method.
result = client.list_services 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::Monitoring::V3::Service.
  p item
end
```

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)

### #update_service

    def update_service(request, options = nil) -> ::Google::Cloud::Monitoring::V3::Service
    def update_service(service: nil, update_mask: nil) -> ::Google::Cloud::Monitoring::V3::Service

Update this `Service`.
**Overloads**

    def update_service(request, options = nil) -> ::Google::Cloud::Monitoring::V3::Service

Pass arguments to `update_service` via a request object, either of type [UpdateServiceRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-UpdateServiceRequest "Google::Cloud::Monitoring::V3::UpdateServiceRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::UpdateServiceRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-UpdateServiceRequest), ::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 update_service(service: nil, update_mask: nil) -> ::Google::Cloud::Monitoring::V3::Service

Pass arguments to `update_service` 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**

- **service** ([::Google::Cloud::Monitoring::V3::Service](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-Service), ::Hash) --- Required. The `Service` to draw updates from. The given `name` specifies the resource to update.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Protobuf-FieldMask), ::Hash) --- A set of field paths defining which fields to use for the update.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Monitoring::V3::Service](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-Service))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Monitoring::V3::Service](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-Service))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::UpdateServiceRequest.new

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

# The returned object is of type Google::Cloud::Monitoring::V3::Service.
p result
```

### #update_service_level_objective

    def update_service_level_objective(request, options = nil) -> ::Google::Cloud::Monitoring::V3::ServiceLevelObjective
    def update_service_level_objective(service_level_objective: nil, update_mask: nil) -> ::Google::Cloud::Monitoring::V3::ServiceLevelObjective

Update the given `ServiceLevelObjective`.
**Overloads**

    def update_service_level_objective(request, options = nil) -> ::Google::Cloud::Monitoring::V3::ServiceLevelObjective

Pass arguments to `update_service_level_objective` via a request object, either of type [UpdateServiceLevelObjectiveRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-UpdateServiceLevelObjectiveRequest "Google::Cloud::Monitoring::V3::UpdateServiceLevelObjectiveRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::UpdateServiceLevelObjectiveRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-UpdateServiceLevelObjectiveRequest), ::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 update_service_level_objective(service_level_objective: nil, update_mask: nil) -> ::Google::Cloud::Monitoring::V3::ServiceLevelObjective

Pass arguments to `update_service_level_objective` 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**

- **service_level_objective** ([::Google::Cloud::Monitoring::V3::ServiceLevelObjective](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ServiceLevelObjective), ::Hash) --- Required. The `ServiceLevelObjective` to draw updates from. The given `name` specifies the resource to update.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Protobuf-FieldMask), ::Hash) --- A set of field paths defining which fields to use for the update.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Monitoring::V3::ServiceLevelObjective](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ServiceLevelObjective))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Monitoring::V3::ServiceLevelObjective](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ServiceLevelObjective))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::UpdateServiceLevelObjectiveRequest.new

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

# The returned object is of type Google::Cloud::Monitoring::V3::ServiceLevelObjective.
p result
```