API hub V1 API - Class Google::Cloud::ApiHub::V1::HostProjectRegistrationService::Client (v0.1.0)

Reference documentation and code samples for the API hub V1 API class Google::Cloud::ApiHub::V1::HostProjectRegistrationService::Client.

Client for the HostProjectRegistrationService service.

This service is used for managing the host project registrations.

Inherits

  • Object

Methods

.configure

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

Configure the HostProjectRegistrationService 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 HostProjectRegistrationService clients
::Google::Cloud::ApiHub::V1::HostProjectRegistrationService::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the HostProjectRegistrationService 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

#create_host_project_registration

def create_host_project_registration(request, options = nil) -> ::Google::Cloud::ApiHub::V1::HostProjectRegistration
def create_host_project_registration(parent: nil, host_project_registration_id: nil, host_project_registration: nil) -> ::Google::Cloud::ApiHub::V1::HostProjectRegistration

Create a host project registration. A Google cloud project can be registered as a host project if it is not attached as a runtime project to another host project. A project can be registered as a host project only once. Subsequent register calls for the same project will fail.

Overloads
def create_host_project_registration(request, options = nil) -> ::Google::Cloud::ApiHub::V1::HostProjectRegistration
Pass arguments to create_host_project_registration via a request object, either of type CreateHostProjectRegistrationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ApiHub::V1::CreateHostProjectRegistrationRequest, ::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_host_project_registration(parent: nil, host_project_registration_id: nil, host_project_registration: nil) -> ::Google::Cloud::ApiHub::V1::HostProjectRegistration
Pass arguments to create_host_project_registration 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 resource for the host project. Format: projects/{project}/locations/{location}
  • host_project_registration_id (::String) — Required. The ID to use for the Host Project Registration, which will become the final component of the host project registration's resource name. The ID must be the same as the Google cloud project specified in the host_project_registration.gcp_project field.
  • host_project_registration (::Google::Cloud::ApiHub::V1::HostProjectRegistration, ::Hash) — Required. The host project registration to register.
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/api_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ApiHub::V1::HostProjectRegistrationService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ApiHub::V1::CreateHostProjectRegistrationRequest.new

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

# The returned object is of type Google::Cloud::ApiHub::V1::HostProjectRegistration.
p result

#get_host_project_registration

def get_host_project_registration(request, options = nil) -> ::Google::Cloud::ApiHub::V1::HostProjectRegistration
def get_host_project_registration(name: nil) -> ::Google::Cloud::ApiHub::V1::HostProjectRegistration

Get a host project registration.

Overloads
def get_host_project_registration(request, options = nil) -> ::Google::Cloud::ApiHub::V1::HostProjectRegistration
Pass arguments to get_host_project_registration via a request object, either of type GetHostProjectRegistrationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ApiHub::V1::GetHostProjectRegistrationRequest, ::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_host_project_registration(name: nil) -> ::Google::Cloud::ApiHub::V1::HostProjectRegistration
Pass arguments to get_host_project_registration 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. Host project registration resource name. projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id}
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/api_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ApiHub::V1::HostProjectRegistrationService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ApiHub::V1::GetHostProjectRegistrationRequest.new

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

# The returned object is of type Google::Cloud::ApiHub::V1::HostProjectRegistration.
p result

#initialize

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

Create a new HostProjectRegistrationService client object.

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

# Create a client using a custom configuration
client = ::Google::Cloud::ApiHub::V1::HostProjectRegistrationService::Client.new do |config|
  config.timeout = 10.0
end

#list_host_project_registrations

def list_host_project_registrations(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::HostProjectRegistration>
def list_host_project_registrations(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::HostProjectRegistration>

Lists host project registrations.

Overloads
def list_host_project_registrations(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::HostProjectRegistration>
Pass arguments to list_host_project_registrations via a request object, either of type ListHostProjectRegistrationsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ApiHub::V1::ListHostProjectRegistrationsRequest, ::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_host_project_registrations(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ApiHub::V1::HostProjectRegistration>
Pass arguments to list_host_project_registrations 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, which owns this collection of host projects. Format: projects/*/locations/*
  • page_size (::Integer) — Optional. The maximum number of host project registrations to return. The service may return fewer than this value. If unspecified, at most 50 host project registrations will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
  • page_token (::String) — Optional. A page token, received from a previous ListHostProjectRegistrations call. Provide this to retrieve the subsequent page.

    When paginating, all other parameters (except page_size) provided to ListHostProjectRegistrations must match the call that provided the page token.

  • filter (::String) —

    Optional. An expression that filters the list of HostProjectRegistrations.

    A filter expression consists of a field name, a comparison operator, and a value for filtering. The value must be a string. All standard operators as documented at https://google.aip.dev/160 are supported.

    The following fields in the HostProjectRegistration are eligible for filtering:

    • name - The name of the HostProjectRegistration.
    • create_time - The time at which the HostProjectRegistration was created. The value should be in the (RFC3339)[https://tools.ietf.org/html/rfc3339] format.
    • gcp_project - The Google cloud project associated with the HostProjectRegistration.
  • order_by (::String) — Optional. Hint for how to order the results.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/api_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ApiHub::V1::HostProjectRegistrationService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ApiHub::V1::ListHostProjectRegistrationsRequest.new

# Call the list_host_project_registrations method.
result = client.list_host_project_registrations 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::ApiHub::V1::HostProjectRegistration.
  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)

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)