Class BareMetalSolutionClient (1.1.2)

BareMetalSolutionClient(*, credentials: Optional[google.auth.credentials.Credentials] = None, transport: Optional[Union[str, google.cloud.bare_metal_solution_v2.services.bare_metal_solution.transports.base.BareMetalSolutionTransport]] = None, client_options: Optional[google.api_core.client_options.ClientOptions] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)

Performs management operations on Bare Metal Solution servers.

The baremetalsolution.googleapis.com service provides management capabilities for Bare Metal Solution servers. To access the API methods, you must assign Bare Metal Solution IAM roles containing the desired permissions to your staff in your Google Cloud project. You must also enable the Bare Metal Solution API. Once enabled, the methods act upon specific servers in your Bare Metal Solution environment.

Inheritance

builtins.object > BareMetalSolutionClient

Properties

transport

Returns the transport used by the client instance.

Returns
TypeDescription
BareMetalSolutionTransportThe transport used by the client instance.

Methods

BareMetalSolutionClient

BareMetalSolutionClient(*, credentials: Optional[google.auth.credentials.Credentials] = None, transport: Optional[Union[str, google.cloud.bare_metal_solution_v2.services.bare_metal_solution.transports.base.BareMetalSolutionTransport]] = None, client_options: Optional[google.api_core.client_options.ClientOptions] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)

Instantiates the bare metal solution client.

Parameters
NameDescription
credentials Optional[google.auth.credentials.Credentials]

The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment.

transport Union[str, BareMetalSolutionTransport]

The transport to use. If set to None, a transport is chosen automatically.

client_options google.api_core.client_options.ClientOptions

Custom options for the client. It won't take effect if a transport instance is provided. (1) The api_endpoint property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT environment variable can also be used to override the endpoint: "always" (always use the default mTLS endpoint), "never" (always use the default regular endpoint) and "auto" (auto switch to the default mTLS endpoint if client certificate is present, this is the default value). However, the api_endpoint property takes precedence if provided. (2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is "true", then the client_cert_source property can be used to provide client certificate for mutual TLS transport. If not provided, the default SSL client certificate will be used if present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not set, no client certificate will be used.

client_info google.api_core.gapic_v1.client_info.ClientInfo

The client info used to send a user-agent string along with API requests. If None, then default info will be used. Generally, you only need to set this if you're developing your own client library.

Exceptions
TypeDescription
google.auth.exceptions.MutualTLSChannelErrorIf mutual TLS transport creation failed for any reason.

__exit__

__exit__(type, value, traceback)

Releases underlying transport's resources.

common_billing_account_path

common_billing_account_path(billing_account: str)

Returns a fully-qualified billing_account string.

common_folder_path

common_folder_path(folder: str)

Returns a fully-qualified folder string.

common_location_path

common_location_path(project: str, location: str)

Returns a fully-qualified location string.

common_organization_path

common_organization_path(organization: str)

Returns a fully-qualified organization string.

common_project_path

common_project_path(project: str)

Returns a fully-qualified project string.

detach_lun

detach_lun(request: Optional[Union[google.cloud.bare_metal_solution_v2.types.instance.DetachLunRequest, dict]] = None, *, instance: Optional[str] = None, lun: Optional[str] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Detach LUN from Instance.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bare_metal_solution_v2

def sample_detach_lun():
    # Create a client
    client = bare_metal_solution_v2.BareMetalSolutionClient()

    # Initialize request argument(s)
    request = bare_metal_solution_v2.DetachLunRequest(
        instance="instance_value",
        lun="lun_value",
    )

    # Make the request
    operation = client.detach_lun(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
NameDescription
request Union[google.cloud.bare_metal_solution_v2.types.DetachLunRequest, dict]

The request object. Message for detach specific LUN from an Instance.

instance str

Required. Name of the instance. This corresponds to the instance field on the request instance; if request is provided, this should not be set.

lun str

Required. Name of the Lun to detach. This corresponds to the lun field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.api_core.operation.OperationAn object representing a long-running operation. The result type for the operation will be Instance A server.

from_service_account_file

from_service_account_file(filename: str, *args, **kwargs)

Creates an instance of this client using the provided credentials file.

Parameter
NameDescription
filename str

The path to the service account private key json file.

Returns
TypeDescription
BareMetalSolutionClientThe constructed client.

from_service_account_info

from_service_account_info(info: dict, *args, **kwargs)

Creates an instance of this client using the provided credentials info.

Parameter
NameDescription
info dict

The service account private key info.

Returns
TypeDescription
BareMetalSolutionClientThe constructed client.

from_service_account_json

from_service_account_json(filename: str, *args, **kwargs)

Creates an instance of this client using the provided credentials file.

Parameter
NameDescription
filename str

The path to the service account private key json file.

Returns
TypeDescription
BareMetalSolutionClientThe constructed client.

get_instance

get_instance(request: Optional[Union[google.cloud.bare_metal_solution_v2.types.instance.GetInstanceRequest, dict]] = None, *, name: Optional[str] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Get details about a single server.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bare_metal_solution_v2

def sample_get_instance():
    # Create a client
    client = bare_metal_solution_v2.BareMetalSolutionClient()

    # Initialize request argument(s)
    request = bare_metal_solution_v2.GetInstanceRequest(
        name="name_value",
    )

    # Make the request
    response = client.get_instance(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Union[google.cloud.bare_metal_solution_v2.types.GetInstanceRequest, dict]

The request object. Message for requesting server information.

name str

Required. Name of the resource. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bare_metal_solution_v2.types.InstanceA server.

get_lun

get_lun(request: Optional[Union[google.cloud.bare_metal_solution_v2.types.lun.GetLunRequest, dict]] = None, *, name: Optional[str] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Get details of a single storage logical unit number(LUN).

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bare_metal_solution_v2

def sample_get_lun():
    # Create a client
    client = bare_metal_solution_v2.BareMetalSolutionClient()

    # Initialize request argument(s)
    request = bare_metal_solution_v2.GetLunRequest(
        name="name_value",
    )

    # Make the request
    response = client.get_lun(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Union[google.cloud.bare_metal_solution_v2.types.GetLunRequest, dict]

The request object. Message for requesting storage lun information.

name str

Required. Name of the resource. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bare_metal_solution_v2.types.LunA storage volume logical unit number (LUN).

get_mtls_endpoint_and_cert_source

get_mtls_endpoint_and_cert_source(
    client_options: Optional[google.api_core.client_options.ClientOptions] = None,
)

Return the API endpoint and client cert source for mutual TLS.

The client cert source is determined in the following order: (1) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is not "true", the client cert source is None. (2) if client_options.client_cert_source is provided, use the provided one; if the default client cert source exists, use the default one; otherwise the client cert source is None.

The API endpoint is determined in the following order: (1) if client_options.api_endpoint if provided, use the provided one. (2) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is "always", use the default mTLS endpoint; if the environment variabel is "never", use the default API endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise use the default API endpoint.

More details can be found at https://google.aip.dev/auth/4114.

Parameter
NameDescription
client_options google.api_core.client_options.ClientOptions

Custom options for the client. Only the api_endpoint and client_cert_source properties may be used in this method.

Exceptions
TypeDescription
google.auth.exceptions.MutualTLSChannelErrorIf any errors happen.
Returns
TypeDescription
Tuple[str, Callable[[], Tuple[bytes, bytes]]]returns the API endpoint and the client cert source to use.

get_network

get_network(request: Optional[Union[google.cloud.bare_metal_solution_v2.types.network.GetNetworkRequest, dict]] = None, *, name: Optional[str] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Get details of a single network.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bare_metal_solution_v2

def sample_get_network():
    # Create a client
    client = bare_metal_solution_v2.BareMetalSolutionClient()

    # Initialize request argument(s)
    request = bare_metal_solution_v2.GetNetworkRequest(
        name="name_value",
    )

    # Make the request
    response = client.get_network(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Union[google.cloud.bare_metal_solution_v2.types.GetNetworkRequest, dict]

The request object. Message for requesting network information.

name str

Required. Name of the resource. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bare_metal_solution_v2.types.NetworkA Network.

get_nfs_share

get_nfs_share(request: Optional[Union[google.cloud.bare_metal_solution_v2.types.nfs_share.GetNfsShareRequest, dict]] = None, *, name: Optional[str] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Get details of a single NFS share.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bare_metal_solution_v2

def sample_get_nfs_share():
    # Create a client
    client = bare_metal_solution_v2.BareMetalSolutionClient()

    # Initialize request argument(s)
    request = bare_metal_solution_v2.GetNfsShareRequest(
        name="name_value",
    )

    # Make the request
    response = client.get_nfs_share(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Union[google.cloud.bare_metal_solution_v2.types.GetNfsShareRequest, dict]

The request object. Message for requesting NFS share information.

name str

Required. Name of the resource. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bare_metal_solution_v2.types.NfsShareAn NFS share.

get_volume

get_volume(request: Optional[Union[google.cloud.bare_metal_solution_v2.types.volume.GetVolumeRequest, dict]] = None, *, name: Optional[str] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Get details of a single storage volume.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bare_metal_solution_v2

def sample_get_volume():
    # Create a client
    client = bare_metal_solution_v2.BareMetalSolutionClient()

    # Initialize request argument(s)
    request = bare_metal_solution_v2.GetVolumeRequest(
        name="name_value",
    )

    # Make the request
    response = client.get_volume(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Union[google.cloud.bare_metal_solution_v2.types.GetVolumeRequest, dict]

The request object. Message for requesting storage volume information.

name str

Required. Name of the resource. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bare_metal_solution_v2.types.VolumeA storage volume.

instance_path

instance_path(project: str, location: str, instance: str)

Returns a fully-qualified instance string.

list_instances

list_instances(request: Optional[Union[google.cloud.bare_metal_solution_v2.types.instance.ListInstancesRequest, dict]] = None, *, parent: Optional[str] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

List servers in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bare_metal_solution_v2

def sample_list_instances():
    # Create a client
    client = bare_metal_solution_v2.BareMetalSolutionClient()

    # Initialize request argument(s)
    request = bare_metal_solution_v2.ListInstancesRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_instances(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
NameDescription
request Union[google.cloud.bare_metal_solution_v2.types.ListInstancesRequest, dict]

The request object. Message for requesting the list of servers.

parent str

Required. Parent value for ListInstancesRequest. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bare_metal_solution_v2.services.bare_metal_solution.pagers.ListInstancesPagerResponse message for the list of servers. Iterating over this object will yield results and resolve additional pages automatically.

list_luns

list_luns(request: Optional[Union[google.cloud.bare_metal_solution_v2.types.lun.ListLunsRequest, dict]] = None, *, parent: Optional[str] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

List storage volume luns for given storage volume.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bare_metal_solution_v2

def sample_list_luns():
    # Create a client
    client = bare_metal_solution_v2.BareMetalSolutionClient()

    # Initialize request argument(s)
    request = bare_metal_solution_v2.ListLunsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_luns(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
NameDescription
request Union[google.cloud.bare_metal_solution_v2.types.ListLunsRequest, dict]

The request object. Message for requesting a list of storage volume luns.

parent str

Required. Parent value for ListLunsRequest. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bare_metal_solution_v2.services.bare_metal_solution.pagers.ListLunsPagerResponse message containing the list of storage volume luns. Iterating over this object will yield results and resolve additional pages automatically.

list_network_usage

list_network_usage(request: Optional[Union[google.cloud.bare_metal_solution_v2.types.network.ListNetworkUsageRequest, dict]] = None, *, location: Optional[str] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

List all Networks (and used IPs for each Network) in the vendor account associated with the specified project.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bare_metal_solution_v2

def sample_list_network_usage():
    # Create a client
    client = bare_metal_solution_v2.BareMetalSolutionClient()

    # Initialize request argument(s)
    request = bare_metal_solution_v2.ListNetworkUsageRequest(
        location="location_value",
    )

    # Make the request
    response = client.list_network_usage(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Union[google.cloud.bare_metal_solution_v2.types.ListNetworkUsageRequest, dict]

The request object. Request to get networks with IPs.

location str

Required. Parent value (project and location). This corresponds to the location field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bare_metal_solution_v2.types.ListNetworkUsageResponseResponse with Networks with IPs

list_networks

list_networks(request: Optional[Union[google.cloud.bare_metal_solution_v2.types.network.ListNetworksRequest, dict]] = None, *, parent: Optional[str] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

List network in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bare_metal_solution_v2

def sample_list_networks():
    # Create a client
    client = bare_metal_solution_v2.BareMetalSolutionClient()

    # Initialize request argument(s)
    request = bare_metal_solution_v2.ListNetworksRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_networks(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
NameDescription
request Union[google.cloud.bare_metal_solution_v2.types.ListNetworksRequest, dict]

The request object. Message for requesting a list of networks.

parent str

Required. Parent value for ListNetworksRequest. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bare_metal_solution_v2.services.bare_metal_solution.pagers.ListNetworksPagerResponse message containing the list of networks. Iterating over this object will yield results and resolve additional pages automatically.

list_nfs_shares

list_nfs_shares(request: Optional[Union[google.cloud.bare_metal_solution_v2.types.nfs_share.ListNfsSharesRequest, dict]] = None, *, parent: Optional[str] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

List NFS shares.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bare_metal_solution_v2

def sample_list_nfs_shares():
    # Create a client
    client = bare_metal_solution_v2.BareMetalSolutionClient()

    # Initialize request argument(s)
    request = bare_metal_solution_v2.ListNfsSharesRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_nfs_shares(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
NameDescription
request Union[google.cloud.bare_metal_solution_v2.types.ListNfsSharesRequest, dict]

The request object. Message for requesting a list of NFS shares.

parent str

Required. Parent value for ListNfsSharesRequest. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bare_metal_solution_v2.services.bare_metal_solution.pagers.ListNfsSharesPagerResponse message containing the list of NFS shares. Iterating over this object will yield results and resolve additional pages automatically.

list_volumes

list_volumes(request: Optional[Union[google.cloud.bare_metal_solution_v2.types.volume.ListVolumesRequest, dict]] = None, *, parent: Optional[str] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

List storage volumes in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bare_metal_solution_v2

def sample_list_volumes():
    # Create a client
    client = bare_metal_solution_v2.BareMetalSolutionClient()

    # Initialize request argument(s)
    request = bare_metal_solution_v2.ListVolumesRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_volumes(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
NameDescription
request Union[google.cloud.bare_metal_solution_v2.types.ListVolumesRequest, dict]

The request object. Message for requesting a list of storage volumes.

parent str

Required. Parent value for ListVolumesRequest. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bare_metal_solution_v2.services.bare_metal_solution.pagers.ListVolumesPagerResponse message containing the list of storage volumes. Iterating over this object will yield results and resolve additional pages automatically.

lun_path

lun_path(project: str, location: str, volume: str, lun: str)

Returns a fully-qualified lun string.

network_path

network_path(project: str, location: str, network: str)

Returns a fully-qualified network string.

nfs_share_path

nfs_share_path(project: str, location: str, nfs_share: str)

Returns a fully-qualified nfs_share string.

parse_common_billing_account_path

parse_common_billing_account_path(path: str)

Parse a billing_account path into its component segments.

parse_common_folder_path

parse_common_folder_path(path: str)

Parse a folder path into its component segments.

parse_common_location_path

parse_common_location_path(path: str)

Parse a location path into its component segments.

parse_common_organization_path

parse_common_organization_path(path: str)

Parse a organization path into its component segments.

parse_common_project_path

parse_common_project_path(path: str)

Parse a project path into its component segments.

parse_instance_path

parse_instance_path(path: str)

Parses a instance path into its component segments.

parse_lun_path

parse_lun_path(path: str)

Parses a lun path into its component segments.

parse_network_path

parse_network_path(path: str)

Parses a network path into its component segments.

parse_nfs_share_path

parse_nfs_share_path(path: str)

Parses a nfs_share path into its component segments.

parse_server_network_template_path

parse_server_network_template_path(path: str)

Parses a server_network_template path into its component segments.

parse_volume_path

parse_volume_path(path: str)

Parses a volume path into its component segments.

reset_instance

reset_instance(request: Optional[Union[google.cloud.bare_metal_solution_v2.types.instance.ResetInstanceRequest, dict]] = None, *, name: Optional[str] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Perform an ungraceful, hard reset on a server. Equivalent to shutting the power off and then turning it back on.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bare_metal_solution_v2

def sample_reset_instance():
    # Create a client
    client = bare_metal_solution_v2.BareMetalSolutionClient()

    # Initialize request argument(s)
    request = bare_metal_solution_v2.ResetInstanceRequest(
        name="name_value",
    )

    # Make the request
    operation = client.reset_instance(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
NameDescription
request Union[google.cloud.bare_metal_solution_v2.types.ResetInstanceRequest, dict]

The request object. Message requesting to reset a server.

name str

Required. Name of the resource. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.api_core.operation.OperationAn object representing a long-running operation. The result type for the operation will be ResetInstanceResponse Response message from resetting a server.

resize_volume

resize_volume(request: Optional[Union[google.cloud.bare_metal_solution_v2.types.volume.ResizeVolumeRequest, dict]] = None, *, volume: Optional[str] = None, size_gib: Optional[int] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Emergency Volume resize.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bare_metal_solution_v2

def sample_resize_volume():
    # Create a client
    client = bare_metal_solution_v2.BareMetalSolutionClient()

    # Initialize request argument(s)
    request = bare_metal_solution_v2.ResizeVolumeRequest(
        volume="volume_value",
    )

    # Make the request
    operation = client.resize_volume(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
NameDescription
request Union[google.cloud.bare_metal_solution_v2.types.ResizeVolumeRequest, dict]

The request object. Request for emergency resize Volume.

volume str

Required. Volume to resize. This corresponds to the volume field on the request instance; if request is provided, this should not be set.

size_gib int

New Volume size, in GiB. This corresponds to the size_gib field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.api_core.operation.OperationAn object representing a long-running operation. The result type for the operation will be Volume A storage volume.

server_network_template_path

server_network_template_path(
    project: str, location: str, server_network_template: str
)

Returns a fully-qualified server_network_template string.

start_instance

start_instance(request: Optional[Union[google.cloud.bare_metal_solution_v2.types.instance.StartInstanceRequest, dict]] = None, *, name: Optional[str] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Starts a server that was shutdown.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bare_metal_solution_v2

def sample_start_instance():
    # Create a client
    client = bare_metal_solution_v2.BareMetalSolutionClient()

    # Initialize request argument(s)
    request = bare_metal_solution_v2.StartInstanceRequest(
        name="name_value",
    )

    # Make the request
    operation = client.start_instance(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
NameDescription
request Union[google.cloud.bare_metal_solution_v2.types.StartInstanceRequest, dict]

The request object. Message requesting to start a server.

name str

Required. Name of the resource. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.api_core.operation.OperationAn object representing a long-running operation. The result type for the operation will be StartInstanceResponse Response message from starting a server.

stop_instance

stop_instance(request: Optional[Union[google.cloud.bare_metal_solution_v2.types.instance.StopInstanceRequest, dict]] = None, *, name: Optional[str] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Stop a running server.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bare_metal_solution_v2

def sample_stop_instance():
    # Create a client
    client = bare_metal_solution_v2.BareMetalSolutionClient()

    # Initialize request argument(s)
    request = bare_metal_solution_v2.StopInstanceRequest(
        name="name_value",
    )

    # Make the request
    operation = client.stop_instance(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
NameDescription
request Union[google.cloud.bare_metal_solution_v2.types.StopInstanceRequest, dict]

The request object. Message requesting to stop a server.

name str

Required. Name of the resource. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.api_core.operation.OperationAn object representing a long-running operation. The result type for the operation will be StopInstanceResponse Response message from stopping a server.

update_instance

update_instance(request: Optional[Union[google.cloud.bare_metal_solution_v2.types.instance.UpdateInstanceRequest, dict]] = None, *, instance: Optional[google.cloud.bare_metal_solution_v2.types.instance.Instance] = None, update_mask: Optional[google.protobuf.field_mask_pb2.FieldMask] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Update details of a single server.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bare_metal_solution_v2

def sample_update_instance():
    # Create a client
    client = bare_metal_solution_v2.BareMetalSolutionClient()

    # Initialize request argument(s)
    request = bare_metal_solution_v2.UpdateInstanceRequest(
    )

    # Make the request
    operation = client.update_instance(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
NameDescription
request Union[google.cloud.bare_metal_solution_v2.types.UpdateInstanceRequest, dict]

The request object. Message requesting to updating a server.

instance google.cloud.bare_metal_solution_v2.types.Instance

Required. The server to update. The name field is used to identify the instance to update. Format: projects/{project}/locations/{location}/instances/{instance} This corresponds to the instance field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

The list of fields to update. The currently supported fields are: labels hyperthreading_enabled os_image This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.api_core.operation.OperationAn object representing a long-running operation. The result type for the operation will be Instance A server.

update_network

update_network(request: Optional[Union[google.cloud.bare_metal_solution_v2.types.network.UpdateNetworkRequest, dict]] = None, *, network: Optional[google.cloud.bare_metal_solution_v2.types.network.Network] = None, update_mask: Optional[google.protobuf.field_mask_pb2.FieldMask] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Update details of a single network.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bare_metal_solution_v2

def sample_update_network():
    # Create a client
    client = bare_metal_solution_v2.BareMetalSolutionClient()

    # Initialize request argument(s)
    request = bare_metal_solution_v2.UpdateNetworkRequest(
    )

    # Make the request
    operation = client.update_network(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
NameDescription
request Union[google.cloud.bare_metal_solution_v2.types.UpdateNetworkRequest, dict]

The request object. Message requesting to updating a network.

network google.cloud.bare_metal_solution_v2.types.Network

Required. The network to update. The name field is used to identify the instance to update. Format: projects/{project}/locations/{location}/networks/{network} This corresponds to the network field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

The list of fields to update. The only currently supported fields are: labels, reservations This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.api_core.operation.OperationAn object representing a long-running operation. The result type for the operation will be Network A Network.

update_nfs_share

update_nfs_share(request: Optional[Union[google.cloud.bare_metal_solution_v2.types.nfs_share.UpdateNfsShareRequest, dict]] = None, *, nfs_share: Optional[google.cloud.bare_metal_solution_v2.types.nfs_share.NfsShare] = None, update_mask: Optional[google.protobuf.field_mask_pb2.FieldMask] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Update details of a single NFS share.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bare_metal_solution_v2

def sample_update_nfs_share():
    # Create a client
    client = bare_metal_solution_v2.BareMetalSolutionClient()

    # Initialize request argument(s)
    request = bare_metal_solution_v2.UpdateNfsShareRequest(
    )

    # Make the request
    operation = client.update_nfs_share(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
NameDescription
request Union[google.cloud.bare_metal_solution_v2.types.UpdateNfsShareRequest, dict]

The request object. Message requesting to updating a NFS share.

nfs_share google.cloud.bare_metal_solution_v2.types.NfsShare

Required. The NFS share to update. The name field is used to identify the NFS share to update. Format: projects/{project}/locations/{location}/nfsShares/{nfs_share} This corresponds to the nfs_share field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

The list of fields to update. The only currently supported fields are: labels This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.api_core.operation.OperationAn object representing a long-running operation. The result type for the operation will be NfsShare An NFS share.

update_volume

update_volume(request: Optional[Union[google.cloud.bare_metal_solution_v2.types.volume.UpdateVolumeRequest, dict]] = None, *, volume: Optional[google.cloud.bare_metal_solution_v2.types.volume.Volume] = None, update_mask: Optional[google.protobuf.field_mask_pb2.FieldMask] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Update details of a single storage volume.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bare_metal_solution_v2

def sample_update_volume():
    # Create a client
    client = bare_metal_solution_v2.BareMetalSolutionClient()

    # Initialize request argument(s)
    request = bare_metal_solution_v2.UpdateVolumeRequest(
    )

    # Make the request
    operation = client.update_volume(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
Parameters
NameDescription
request Union[google.cloud.bare_metal_solution_v2.types.UpdateVolumeRequest, dict]

The request object. Message for updating a volume.

volume google.cloud.bare_metal_solution_v2.types.Volume

Required. The volume to update. The name field is used to identify the volume to update. Format: projects/{project}/locations/{location}/volumes/{volume} This corresponds to the volume field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

The list of fields to update. The only currently supported fields are: snapshot_auto_delete_behavior snapshot_schedule_policy_name 'labels' 'snapshot_enabled' 'snapshot_reservation_detail.reserved_space_percent' This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.api_core.operation.OperationAn object representing a long-running operation. The result type for the operation will be Volume A storage volume.

volume_path

volume_path(project: str, location: str, volume: str)

Returns a fully-qualified volume string.