BareMetalSolutionClient(*, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[typing.Union[str, google.cloud.bare_metal_solution_v2.services.bare_metal_solution.transports.base.BareMetalSolutionTransport]] = None, client_options: typing.Optional[typing.Union[google.api_core.client_options.ClientOptions, dict]] = 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.
Properties
transport
Returns the transport used by the client instance.
Returns | |
---|---|
Type | Description |
BareMetalSolutionTransport | The transport used by the client instance. |
Methods
BareMetalSolutionClient
BareMetalSolutionClient(*, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[typing.Union[str, google.cloud.bare_metal_solution_v2.services.bare_metal_solution.transports.base.BareMetalSolutionTransport]] = None, client_options: typing.Optional[typing.Union[google.api_core.client_options.ClientOptions, dict]] = 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 | |
---|---|
Name | Description |
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 |
Optional[Union[google.api_core.client_options.ClientOptions, dict]]
Custom options for the client. It won't take effect if a |
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 |
Exceptions | |
---|---|
Type | Description |
google.auth.exceptions.MutualTLSChannelError | If 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) -> str
Returns a fully-qualified billing_account string.
common_folder_path
common_folder_path(folder: str) -> str
Returns a fully-qualified folder string.
common_location_path
common_location_path(project: str, location: str) -> str
Returns a fully-qualified location string.
common_organization_path
common_organization_path(organization: str) -> str
Returns a fully-qualified organization string.
common_project_path
common_project_path(project: str) -> str
Returns a fully-qualified project string.
detach_lun
detach_lun(
request: typing.Optional[
typing.Union[
google.cloud.bare_metal_solution_v2.types.instance.DetachLunRequest, dict
]
] = None,
*,
instance: typing.Optional[str] = None,
lun: typing.Optional[str] = None,
retry: typing.Union[
google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation
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 | |
---|---|
Name | Description |
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 |
lun |
str
Required. Name of the Lun to detach. This corresponds to the |
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 | |
---|---|
Type | Description |
google.api_core.operation.Operation | An 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 | |
---|---|
Name | Description |
filename |
str
The path to the service account private key json file. |
Returns | |
---|---|
Type | Description |
BareMetalSolutionClient | The 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 | |
---|---|
Name | Description |
info |
dict
The service account private key info. |
Returns | |
---|---|
Type | Description |
BareMetalSolutionClient | The 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 | |
---|---|
Name | Description |
filename |
str
The path to the service account private key json file. |
Returns | |
---|---|
Type | Description |
BareMetalSolutionClient | The constructed client. |
get_instance
get_instance(
request: typing.Optional[
typing.Union[
google.cloud.bare_metal_solution_v2.types.instance.GetInstanceRequest, dict
]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Union[
google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.bare_metal_solution_v2.types.instance.Instance
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 | |
---|---|
Name | Description |
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 |
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 | |
---|---|
Type | Description |
google.cloud.bare_metal_solution_v2.types.Instance | A server. |
get_location
get_location(
request: typing.Optional[
google.cloud.location.locations_pb2.GetLocationRequest
] = None,
*,
retry: typing.Union[
google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.location.locations_pb2.Location
Gets information about a location.
Parameters | |
---|---|
Name | Description |
request |
The request object. Request message for |
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 | |
---|---|
Type | Description |
| Location object. |
get_lun
get_lun(
request: typing.Optional[
typing.Union[google.cloud.bare_metal_solution_v2.types.lun.GetLunRequest, dict]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Union[
google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.bare_metal_solution_v2.types.lun.Lun
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 | |
---|---|
Name | Description |
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 |
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 | |
---|---|
Type | Description |
google.cloud.bare_metal_solution_v2.types.Lun | A storage volume logical unit number (LUN). |
get_mtls_endpoint_and_cert_source
get_mtls_endpoint_and_cert_source(
client_options: typing.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 variable 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 | |
---|---|
Name | Description |
client_options |
google.api_core.client_options.ClientOptions
Custom options for the client. Only the |
Exceptions | |
---|---|
Type | Description |
google.auth.exceptions.MutualTLSChannelError | If any errors happen. |
Returns | |
---|---|
Type | Description |
Tuple[str, Callable[[], Tuple[bytes, bytes]]] | returns the API endpoint and the client cert source to use. |
get_network
get_network(
request: typing.Optional[
typing.Union[
google.cloud.bare_metal_solution_v2.types.network.GetNetworkRequest, dict
]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Union[
google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.bare_metal_solution_v2.types.network.Network
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 | |
---|---|
Name | Description |
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 |
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 | |
---|---|
Type | Description |
google.cloud.bare_metal_solution_v2.types.Network | A Network. |
get_nfs_share
get_nfs_share(
request: typing.Optional[
typing.Union[
google.cloud.bare_metal_solution_v2.types.nfs_share.GetNfsShareRequest, dict
]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Union[
google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.bare_metal_solution_v2.types.nfs_share.NfsShare
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 | |
---|---|
Name | Description |
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 |
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 | |
---|---|
Type | Description |
google.cloud.bare_metal_solution_v2.types.NfsShare | An NFS share. |
get_volume
get_volume(
request: typing.Optional[
typing.Union[
google.cloud.bare_metal_solution_v2.types.volume.GetVolumeRequest, dict
]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Union[
google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.bare_metal_solution_v2.types.volume.Volume
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 | |
---|---|
Name | Description |
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 |
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 | |
---|---|
Type | Description |
google.cloud.bare_metal_solution_v2.types.Volume | A storage volume. |
instance_path
instance_path(project: str, location: str, instance: str) -> str
Returns a fully-qualified instance string.
list_instances
list_instances(
request: typing.Optional[
typing.Union[
google.cloud.bare_metal_solution_v2.types.instance.ListInstancesRequest,
dict,
]
] = None,
*,
parent: typing.Optional[str] = None,
retry: typing.Union[
google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
google.cloud.bare_metal_solution_v2.services.bare_metal_solution.pagers.ListInstancesPager
)
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 | |
---|---|
Name | Description |
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 |
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 | |
---|---|
Type | Description |
google.cloud.bare_metal_solution_v2.services.bare_metal_solution.pagers.ListInstancesPager | Response message for the list of servers. Iterating over this object will yield results and resolve additional pages automatically. |
list_locations
list_locations(
request: typing.Optional[
google.cloud.location.locations_pb2.ListLocationsRequest
] = None,
*,
retry: typing.Union[
google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.location.locations_pb2.ListLocationsResponse
Lists information about the supported locations for this service.
Parameters | |
---|---|
Name | Description |
request |
The request object. Request message for |
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 | |
---|---|
Type | Description |
| Response message for ListLocations method. |
list_luns
list_luns(
request: typing.Optional[
typing.Union[
google.cloud.bare_metal_solution_v2.types.lun.ListLunsRequest, dict
]
] = None,
*,
parent: typing.Optional[str] = None,
retry: typing.Union[
google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
google.cloud.bare_metal_solution_v2.services.bare_metal_solution.pagers.ListLunsPager
)
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 | |
---|---|
Name | Description |
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 |
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 | |
---|---|
Type | Description |
google.cloud.bare_metal_solution_v2.services.bare_metal_solution.pagers.ListLunsPager | Response 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: typing.Optional[
typing.Union[
google.cloud.bare_metal_solution_v2.types.network.ListNetworkUsageRequest,
dict,
]
] = None,
*,
location: typing.Optional[str] = None,
retry: typing.Union[
google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.bare_metal_solution_v2.types.network.ListNetworkUsageResponse
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 | |
---|---|
Name | Description |
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 |
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 | |
---|---|
Type | Description |
google.cloud.bare_metal_solution_v2.types.ListNetworkUsageResponse | Response with Networks with IPs |
list_networks
list_networks(
request: typing.Optional[
typing.Union[
google.cloud.bare_metal_solution_v2.types.network.ListNetworksRequest, dict
]
] = None,
*,
parent: typing.Optional[str] = None,
retry: typing.Union[
google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
google.cloud.bare_metal_solution_v2.services.bare_metal_solution.pagers.ListNetworksPager
)
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 | |
---|---|
Name | Description |
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 |
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 | |
---|---|
Type | Description |
google.cloud.bare_metal_solution_v2.services.bare_metal_solution.pagers.ListNetworksPager | Response 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: typing.Optional[
typing.Union[
google.cloud.bare_metal_solution_v2.types.nfs_share.ListNfsSharesRequest,
dict,
]
] = None,
*,
parent: typing.Optional[str] = None,
retry: typing.Union[
google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
google.cloud.bare_metal_solution_v2.services.bare_metal_solution.pagers.ListNfsSharesPager
)
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 | |
---|---|
Name | Description |
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 |
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 | |
---|---|
Type | Description |
google.cloud.bare_metal_solution_v2.services.bare_metal_solution.pagers.ListNfsSharesPager | Response message containing the list of NFS shares. Iterating over this object will yield results and resolve additional pages automatically. |
list_volumes
list_volumes(
request: typing.Optional[
typing.Union[
google.cloud.bare_metal_solution_v2.types.volume.ListVolumesRequest, dict
]
] = None,
*,
parent: typing.Optional[str] = None,
retry: typing.Union[
google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
google.cloud.bare_metal_solution_v2.services.bare_metal_solution.pagers.ListVolumesPager
)
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 | |
---|---|
Name | Description |
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 |
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 | |
---|---|
Type | Description |
google.cloud.bare_metal_solution_v2.services.bare_metal_solution.pagers.ListVolumesPager | Response 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) -> str
Returns a fully-qualified lun string.
network_path
network_path(project: str, location: str, network: str) -> str
Returns a fully-qualified network string.
nfs_share_path
nfs_share_path(project: str, location: str, nfs_share: str) -> str
Returns a fully-qualified nfs_share string.
parse_common_billing_account_path
parse_common_billing_account_path(path: str) -> typing.Dict[str, str]
Parse a billing_account path into its component segments.
parse_common_folder_path
parse_common_folder_path(path: str) -> typing.Dict[str, str]
Parse a folder path into its component segments.
parse_common_location_path
parse_common_location_path(path: str) -> typing.Dict[str, str]
Parse a location path into its component segments.
parse_common_organization_path
parse_common_organization_path(path: str) -> typing.Dict[str, str]
Parse a organization path into its component segments.
parse_common_project_path
parse_common_project_path(path: str) -> typing.Dict[str, str]
Parse a project path into its component segments.
parse_instance_path
parse_instance_path(path: str) -> typing.Dict[str, str]
Parses a instance path into its component segments.
parse_lun_path
parse_lun_path(path: str) -> typing.Dict[str, str]
Parses a lun path into its component segments.
parse_network_path
parse_network_path(path: str) -> typing.Dict[str, str]
Parses a network path into its component segments.
parse_nfs_share_path
parse_nfs_share_path(path: str) -> typing.Dict[str, str]
Parses a nfs_share path into its component segments.
parse_server_network_template_path
parse_server_network_template_path(path: str) -> typing.Dict[str, str]
Parses a server_network_template path into its component segments.
parse_volume_path
parse_volume_path(path: str) -> typing.Dict[str, str]
Parses a volume path into its component segments.
reset_instance
reset_instance(
request: typing.Optional[
typing.Union[
google.cloud.bare_metal_solution_v2.types.instance.ResetInstanceRequest,
dict,
]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Union[
google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation
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 | |
---|---|
Name | Description |
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 |
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 | |
---|---|
Type | Description |
google.api_core.operation.Operation | An 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: typing.Optional[
typing.Union[
google.cloud.bare_metal_solution_v2.types.volume.ResizeVolumeRequest, dict
]
] = None,
*,
volume: typing.Optional[str] = None,
size_gib: typing.Optional[int] = None,
retry: typing.Union[
google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation
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 | |
---|---|
Name | Description |
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 |
size_gib |
int
New Volume size, in GiB. This corresponds to the |
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 | |
---|---|
Type | Description |
google.api_core.operation.Operation | An 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
) -> str
Returns a fully-qualified server_network_template string.
start_instance
start_instance(
request: typing.Optional[
typing.Union[
google.cloud.bare_metal_solution_v2.types.instance.StartInstanceRequest,
dict,
]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Union[
google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation
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 | |
---|---|
Name | Description |
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 |
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 | |
---|---|
Type | Description |
google.api_core.operation.Operation | An 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: typing.Optional[
typing.Union[
google.cloud.bare_metal_solution_v2.types.instance.StopInstanceRequest, dict
]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Union[
google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation
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 | |
---|---|
Name | Description |
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 |
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 | |
---|---|
Type | Description |
google.api_core.operation.Operation | An 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: typing.Optional[
typing.Union[
google.cloud.bare_metal_solution_v2.types.instance.UpdateInstanceRequest,
dict,
]
] = None,
*,
instance: typing.Optional[
google.cloud.bare_metal_solution_v2.types.instance.Instance
] = None,
update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
retry: typing.Union[
google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation
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 | |
---|---|
Name | Description |
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 |
update_mask |
google.protobuf.field_mask_pb2.FieldMask
The list of fields to update. The currently supported fields are: |
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 | |
---|---|
Type | Description |
google.api_core.operation.Operation | An object representing a long-running operation. The result type for the operation will be Instance A server. |
update_network
update_network(
request: typing.Optional[
typing.Union[
google.cloud.bare_metal_solution_v2.types.network.UpdateNetworkRequest, dict
]
] = None,
*,
network: typing.Optional[
google.cloud.bare_metal_solution_v2.types.network.Network
] = None,
update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
retry: typing.Union[
google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation
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 | |
---|---|
Name | Description |
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 |
update_mask |
google.protobuf.field_mask_pb2.FieldMask
The list of fields to update. The only currently supported fields are: |
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 | |
---|---|
Type | Description |
google.api_core.operation.Operation | An object representing a long-running operation. The result type for the operation will be Network A Network. |
update_nfs_share
update_nfs_share(
request: typing.Optional[
typing.Union[
google.cloud.bare_metal_solution_v2.types.nfs_share.UpdateNfsShareRequest,
dict,
]
] = None,
*,
nfs_share: typing.Optional[
google.cloud.bare_metal_solution_v2.types.nfs_share.NfsShare
] = None,
update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
retry: typing.Union[
google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation
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 | |
---|---|
Name | Description |
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 |
update_mask |
google.protobuf.field_mask_pb2.FieldMask
The list of fields to update. The only currently supported fields are: |
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 | |
---|---|
Type | Description |
google.api_core.operation.Operation | An object representing a long-running operation. The result type for the operation will be NfsShare An NFS share. |
update_volume
update_volume(
request: typing.Optional[
typing.Union[
google.cloud.bare_metal_solution_v2.types.volume.UpdateVolumeRequest, dict
]
] = None,
*,
volume: typing.Optional[
google.cloud.bare_metal_solution_v2.types.volume.Volume
] = None,
update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
retry: typing.Union[
google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation.Operation
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 | |
---|---|
Name | Description |
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 |
update_mask |
google.protobuf.field_mask_pb2.FieldMask
The list of fields to update. The only currently supported fields are: |
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 | |
---|---|
Type | Description |
google.api_core.operation.Operation | An 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) -> str
Returns a fully-qualified volume string.