Class BackupForGKEClient (0.2.1)

BackupForGKEClient(*, credentials: Optional[google.auth.credentials.Credentials] = None, transport: Optional[Union[str, google.cloud.gke_backup_v1.services.backup_for_gke.transports.base.BackupForGKETransport]] = 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>)

BackupForGKE allows Kubernetes administrators to configure, execute, and manage backup and restore operations for their GKE clusters.

Inheritance

builtins.object > BackupForGKEClient

Properties

transport

Returns the transport used by the client instance.

Returns
TypeDescription
BackupForGKETransportThe transport used by the client instance.

Methods

BackupForGKEClient

BackupForGKEClient(*, credentials: Optional[google.auth.credentials.Credentials] = None, transport: Optional[Union[str, google.cloud.gke_backup_v1.services.backup_for_gke.transports.base.BackupForGKETransport]] = 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 backup for gke 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, BackupForGKETransport]

The transport to use. If set to None, a transport is chosen automatically. NOTE: "rest" transport functionality is currently in a beta state (preview). We welcome your feedback via an issue in this library's source repository.

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.

backup_path

backup_path(project: str, location: str, backup_plan: str, backup: str)

Returns a fully-qualified backup string.

backup_plan_path

backup_plan_path(project: str, location: str, backup_plan: str)

Returns a fully-qualified backup_plan string.

cluster_path

cluster_path(project: str, location: str, cluster: str)

Returns a fully-qualified cluster string.

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.

create_backup

create_backup(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.CreateBackupRequest, dict]] = None, *, parent: Optional[str] = None, backup: Optional[google.cloud.gke_backup_v1.types.backup.Backup] = None, backup_id: 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]] = ())

Creates a Backup for the given BackupPlan.

# 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 gke_backup_v1

def sample_create_backup():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    request = gke_backup_v1.CreateBackupRequest(
        parent="parent_value",
    )

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

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

    response = operation.result()

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

The request object. Request message for CreateBackup.

parent str

Required. The BackupPlan within which to create the Backup. Format: projects/*/locations/*/backupPlans/* This corresponds to the parent field on the request instance; if request is provided, this should not be set.

backup google.cloud.gke_backup_v1.types.Backup

The Backup resource to create. This corresponds to the backup field on the request instance; if request is provided, this should not be set.

backup_id str

The client-provided short name for the Backup resource. This name must: - be between 1 and 63 characters long (inclusive) - consist of only lower-case ASCII letters, numbers, and dashes - start with a lower-case letter - end with a lower-case letter or number - be unique within the set of Backups in this BackupPlan This corresponds to the backup_id 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 Backup Represents a request to perform a single point-in-time capture of some portion of the state of a GKE cluster, the record of the backup operation itself, and an anchor for the underlying artifacts that comprise the Backup (the config backup and VolumeBackups). Next id: 28

create_backup_plan

create_backup_plan(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.CreateBackupPlanRequest, dict]] = None, *, parent: Optional[str] = None, backup_plan: Optional[google.cloud.gke_backup_v1.types.backup_plan.BackupPlan] = None, backup_plan_id: 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]] = ())

Creates a new BackupPlan in a given 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 gke_backup_v1

def sample_create_backup_plan():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    backup_plan = gke_backup_v1.BackupPlan()
    backup_plan.cluster = "cluster_value"

    request = gke_backup_v1.CreateBackupPlanRequest(
        parent="parent_value",
        backup_plan=backup_plan,
        backup_plan_id="backup_plan_id_value",
    )

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

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

    response = operation.result()

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

The request object. Request message for CreateBackupPlan.

parent str

Required. The location within which to create the BackupPlan. Format: projects/*/locations/* This corresponds to the parent field on the request instance; if request is provided, this should not be set.

backup_plan google.cloud.gke_backup_v1.types.BackupPlan

Required. The BackupPlan resource object to create. This corresponds to the backup_plan field on the request instance; if request is provided, this should not be set.

backup_plan_id str

Required. The client-provided short name for the BackupPlan resource. This name must: - be between 1 and 63 characters long (inclusive) - consist of only lower-case ASCII letters, numbers, and dashes - start with a lower-case letter - end with a lower-case letter or number - be unique within the set of BackupPlans in this location This corresponds to the backup_plan_id 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 BackupPlan Defines the configuration and scheduling for a "line" of Backups.

create_restore

create_restore(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.CreateRestoreRequest, dict]] = None, *, parent: Optional[str] = None, restore: Optional[google.cloud.gke_backup_v1.types.restore.Restore] = None, restore_id: 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]] = ())

Creates a new Restore for the given RestorePlan.

# 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 gke_backup_v1

def sample_create_restore():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    restore = gke_backup_v1.Restore()
    restore.backup = "backup_value"

    request = gke_backup_v1.CreateRestoreRequest(
        parent="parent_value",
        restore=restore,
        restore_id="restore_id_value",
    )

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

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

    response = operation.result()

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

The request object. Request message for CreateRestore.

parent str

Required. The RestorePlan within which to create the Restore. Format: projects/*/locations/*/restorePlans/* This corresponds to the parent field on the request instance; if request is provided, this should not be set.

restore google.cloud.gke_backup_v1.types.Restore

Required. The restore resource to create. This corresponds to the restore field on the request instance; if request is provided, this should not be set.

restore_id str

Required. The client-provided short name for the Restore resource. This name must: - be between 1 and 63 characters long (inclusive) - consist of only lower-case ASCII letters, numbers, and dashes - start with a lower-case letter - end with a lower-case letter or number - be unique within the set of Restores in this RestorePlan. This corresponds to the restore_id 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 Restore Represents both a request to Restore some portion of a Backup into a target GKE cluster and a record of the restore operation itself. Next id: 18

create_restore_plan

create_restore_plan(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.CreateRestorePlanRequest, dict]] = None, *, parent: Optional[str] = None, restore_plan: Optional[google.cloud.gke_backup_v1.types.restore_plan.RestorePlan] = None, restore_plan_id: 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]] = ())

Creates a new RestorePlan in a given 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 gke_backup_v1

def sample_create_restore_plan():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    restore_plan = gke_backup_v1.RestorePlan()
    restore_plan.backup_plan = "backup_plan_value"
    restore_plan.cluster = "cluster_value"
    restore_plan.restore_config.all_namespaces = True

    request = gke_backup_v1.CreateRestorePlanRequest(
        parent="parent_value",
        restore_plan=restore_plan,
        restore_plan_id="restore_plan_id_value",
    )

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

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

    response = operation.result()

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

The request object. Request message for CreateRestorePlan.

parent str

Required. The location within which to create the RestorePlan. Format: projects/*/locations/* This corresponds to the parent field on the request instance; if request is provided, this should not be set.

restore_plan google.cloud.gke_backup_v1.types.RestorePlan

Required. The RestorePlan resource object to create. This corresponds to the restore_plan field on the request instance; if request is provided, this should not be set.

restore_plan_id str

Required. The client-provided short name for the RestorePlan resource. This name must: - be between 1 and 63 characters long (inclusive) - consist of only lower-case ASCII letters, numbers, and dashes - start with a lower-case letter - end with a lower-case letter or number - be unique within the set of RestorePlans in this location This corresponds to the restore_plan_id 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 RestorePlan The configuration of a potential series of Restore operations to be performed against Backups belong to a particular BackupPlan. Next id: 11

crypto_key_path

crypto_key_path(project: str, location: str, key_ring: str, crypto_key: str)

Returns a fully-qualified crypto_key string.

delete_backup

delete_backup(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.DeleteBackupRequest, 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]] = ())

Deletes an existing Backup.

# 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 gke_backup_v1

def sample_delete_backup():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    request = gke_backup_v1.DeleteBackupRequest(
        name="name_value",
    )

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

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

    response = operation.result()

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

The request object. Request message for DeleteBackup.

name str

Required. Name of the Backup resource. Format: projects/*/locations/*/backupPlans/*/backups/* 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 `google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }

delete_backup_plan

delete_backup_plan(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.DeleteBackupPlanRequest, 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]] = ())

Deletes an existing BackupPlan.

# 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 gke_backup_v1

def sample_delete_backup_plan():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    request = gke_backup_v1.DeleteBackupPlanRequest(
        name="name_value",
    )

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

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

    response = operation.result()

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

The request object. Request message for DeleteBackupPlan.

name str

Required. Fully qualified BackupPlan name. Format: projects/*/locations/*/backupPlans/* 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 `google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }

delete_restore

delete_restore(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.DeleteRestoreRequest, 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]] = ())

Deletes an existing Restore.

# 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 gke_backup_v1

def sample_delete_restore():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    request = gke_backup_v1.DeleteRestoreRequest(
        name="name_value",
    )

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

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

    response = operation.result()

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

The request object. Request message for DeleteRestore.

name str

Required. Full name of the Restore Format: projects/*/locations/*/restorePlans/*/restores/* 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 `google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }

delete_restore_plan

delete_restore_plan(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.DeleteRestorePlanRequest, 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]] = ())

Deletes an existing RestorePlan.

# 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 gke_backup_v1

def sample_delete_restore_plan():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    request = gke_backup_v1.DeleteRestorePlanRequest(
        name="name_value",
    )

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

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

    response = operation.result()

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

The request object. Request message for DeleteRestorePlan.

name str

Required. Fully qualified RestorePlan name. Format: projects/*/locations/*/restorePlans/* 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 `google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }

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
BackupForGKEClientThe 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
BackupForGKEClientThe 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
BackupForGKEClientThe constructed client.

get_backup

get_backup(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.GetBackupRequest, 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]] = ())

Retrieve the details of a single Backup.

# 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 gke_backup_v1

def sample_get_backup():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    request = gke_backup_v1.GetBackupRequest(
        name="name_value",
    )

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

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

The request object. Request message for GetBackup.

name str

Required. Full name of the Backup resource. Format: projects/*/locations/*/backupPlans/*/backups/* 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.gke_backup_v1.types.BackupRepresents a request to perform a single point-in-time capture of some portion of the state of a GKE cluster, the record of the backup operation itself, and an anchor for the underlying artifacts that comprise the Backup (the config backup and VolumeBackups). Next id: 28

get_backup_plan

get_backup_plan(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.GetBackupPlanRequest, 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]] = ())

Retrieve the details of a single BackupPlan.

# 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 gke_backup_v1

def sample_get_backup_plan():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    request = gke_backup_v1.GetBackupPlanRequest(
        name="name_value",
    )

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

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

The request object. Request message for GetBackupPlan.

name str

Required. Fully qualified BackupPlan name. Format: projects/*/locations/*/backupPlans/* 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.gke_backup_v1.types.BackupPlanDefines the configuration and scheduling for a "line" of Backups.

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_restore

get_restore(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.GetRestoreRequest, 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]] = ())

Retrieves the details of a single Restore.

# 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 gke_backup_v1

def sample_get_restore():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    request = gke_backup_v1.GetRestoreRequest(
        name="name_value",
    )

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

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

The request object. Request message for GetRestore.

name str

Required. Name of the restore resource. Format: projects/*/locations/*/restorePlans/*/restores/* 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.gke_backup_v1.types.RestoreRepresents both a request to Restore some portion of a Backup into a target GKE cluster and a record of the restore operation itself. Next id: 18

get_restore_plan

get_restore_plan(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.GetRestorePlanRequest, 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]] = ())

Retrieve the details of a single RestorePlan.

# 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 gke_backup_v1

def sample_get_restore_plan():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    request = gke_backup_v1.GetRestorePlanRequest(
        name="name_value",
    )

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

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

The request object. Request message for GetRestorePlan.

name str

Required. Fully qualified RestorePlan name. Format: projects/*/locations/*/restorePlans/* 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.gke_backup_v1.types.RestorePlanThe configuration of a potential series of Restore operations to be performed against Backups belong to a particular BackupPlan. Next id: 11

get_volume_backup

get_volume_backup(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.GetVolumeBackupRequest, 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]] = ())

Retrieve the details of a single VolumeBackup.

# 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 gke_backup_v1

def sample_get_volume_backup():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    request = gke_backup_v1.GetVolumeBackupRequest(
        name="name_value",
    )

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

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

The request object. Request message for GetVolumeBackup.

name str

Required. Full name of the VolumeBackup resource. Format: projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/* 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.gke_backup_v1.types.VolumeBackupRepresents the backup of a specific persistent volume as a component of a Backup - both the record of the operation and a pointer to the underlying storage-specific artifacts. Next id: 14

get_volume_restore

get_volume_restore(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.GetVolumeRestoreRequest, 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]] = ())

Retrieve the details of a single VolumeRestore.

# 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 gke_backup_v1

def sample_get_volume_restore():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    request = gke_backup_v1.GetVolumeRestoreRequest(
        name="name_value",
    )

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

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

The request object. Request message for GetVolumeRestore.

name str

Required. Full name of the VolumeRestore resource. Format: projects/*/locations/*/restorePlans/*/restores/*/volumeRestores/* 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.gke_backup_v1.types.VolumeRestoreRepresents the operation of restoring a volume from a VolumeBackup. Next id: 13

list_backup_plans

list_backup_plans(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.ListBackupPlansRequest, 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]] = ())

Lists BackupPlans in a given 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 gke_backup_v1

def sample_list_backup_plans():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    request = gke_backup_v1.ListBackupPlansRequest(
        parent="parent_value",
    )

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

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

The request object. Request message for ListBackupPlans.

parent str

Required. The location that contains the BackupPlans to list. Format: projects/*/locations/* 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.gke_backup_v1.services.backup_for_gke.pagers.ListBackupPlansPagerResponse message for ListBackupPlans. Iterating over this object will yield results and resolve additional pages automatically.

list_backups

list_backups(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.ListBackupsRequest, 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]] = ())

Lists the Backups for a given BackupPlan.

# 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 gke_backup_v1

def sample_list_backups():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    request = gke_backup_v1.ListBackupsRequest(
        parent="parent_value",
    )

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

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

The request object. Request message for ListBackups.

parent str

Required. The BackupPlan that contains the Backups to list. Format: projects/*/locations/*/backupPlans/* 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.gke_backup_v1.services.backup_for_gke.pagers.ListBackupsPagerResponse message for ListBackups. Iterating over this object will yield results and resolve additional pages automatically.

list_restore_plans

list_restore_plans(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.ListRestorePlansRequest, 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]] = ())

Lists RestorePlans in a given 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 gke_backup_v1

def sample_list_restore_plans():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    request = gke_backup_v1.ListRestorePlansRequest(
        parent="parent_value",
    )

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

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

The request object. Request message for ListRestorePlans.

parent str

Required. The location that contains the RestorePlans to list. Format: projects/*/locations/* 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.gke_backup_v1.services.backup_for_gke.pagers.ListRestorePlansPagerResponse message for ListRestorePlans. Iterating over this object will yield results and resolve additional pages automatically.

list_restores

list_restores(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.ListRestoresRequest, 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]] = ())

Lists the Restores for a given RestorePlan.

# 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 gke_backup_v1

def sample_list_restores():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    request = gke_backup_v1.ListRestoresRequest(
        parent="parent_value",
    )

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

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

The request object. Request message for ListRestores.

parent str

Required. The RestorePlan that contains the Restores to list. Format: projects/*/locations/*/restorePlans/* 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.gke_backup_v1.services.backup_for_gke.pagers.ListRestoresPagerResponse message for ListRestores. Iterating over this object will yield results and resolve additional pages automatically.

list_volume_backups

list_volume_backups(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.ListVolumeBackupsRequest, 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]] = ())

Lists the VolumeBackups for a given Backup.

# 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 gke_backup_v1

def sample_list_volume_backups():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    request = gke_backup_v1.ListVolumeBackupsRequest(
        parent="parent_value",
    )

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

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

The request object. Request message for ListVolumeBackups.

parent str

Required. The Backup that contains the VolumeBackups to list. Format: projects/*/locations/*/backupPlans/*/backups/* 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.gke_backup_v1.services.backup_for_gke.pagers.ListVolumeBackupsPagerResponse message for ListVolumeBackups. Iterating over this object will yield results and resolve additional pages automatically.

list_volume_restores

list_volume_restores(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.ListVolumeRestoresRequest, 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]] = ())

Lists the VolumeRestores for a given Restore.

# 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 gke_backup_v1

def sample_list_volume_restores():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    request = gke_backup_v1.ListVolumeRestoresRequest(
        parent="parent_value",
    )

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

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

The request object. Request message for ListVolumeRestores.

parent str

Required. The Restore that contains the VolumeRestores to list. Format: projects/*/locations/*/restorePlans/*/restores/* 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.gke_backup_v1.services.backup_for_gke.pagers.ListVolumeRestoresPagerResponse message for ListVolumeRestores. Iterating over this object will yield results and resolve additional pages automatically.

parse_backup_path

parse_backup_path(path: str)

Parses a backup path into its component segments.

parse_backup_plan_path

parse_backup_plan_path(path: str)

Parses a backup_plan path into its component segments.

parse_cluster_path

parse_cluster_path(path: str)

Parses a cluster path into its component segments.

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_crypto_key_path

parse_crypto_key_path(path: str)

Parses a crypto_key path into its component segments.

parse_restore_path

parse_restore_path(path: str)

Parses a restore path into its component segments.

parse_restore_plan_path

parse_restore_plan_path(path: str)

Parses a restore_plan path into its component segments.

parse_volume_backup_path

parse_volume_backup_path(path: str)

Parses a volume_backup path into its component segments.

parse_volume_restore_path

parse_volume_restore_path(path: str)

Parses a volume_restore path into its component segments.

restore_path

restore_path(project: str, location: str, restore_plan: str, restore: str)

Returns a fully-qualified restore string.

restore_plan_path

restore_plan_path(project: str, location: str, restore_plan: str)

Returns a fully-qualified restore_plan string.

update_backup

update_backup(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.UpdateBackupRequest, dict]] = None, *, backup: Optional[google.cloud.gke_backup_v1.types.backup.Backup] = 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 a Backup.

# 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 gke_backup_v1

def sample_update_backup():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    backup = gke_backup_v1.Backup()
    backup.all_namespaces = True

    request = gke_backup_v1.UpdateBackupRequest(
        backup=backup,
    )

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

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

    response = operation.result()

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

The request object. Request message for UpdateBackup.

backup google.cloud.gke_backup_v1.types.Backup

Required. A new version of the Backup resource that contains updated fields. This may be sparsely populated if an update_mask is provided. This corresponds to the backup field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

This is used to specify the fields to be overwritten in the Backup targeted for update. The values for each of these updated fields will be taken from the backup_plan provided with this request. Field names are relative to the root of the resource. If no update_mask is provided, all fields in backup will be written to the target Backup resource. Note that OUTPUT_ONLY and IMMUTABLE fields in backup are ignored and are not used to update the target Backup. 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 Backup Represents a request to perform a single point-in-time capture of some portion of the state of a GKE cluster, the record of the backup operation itself, and an anchor for the underlying artifacts that comprise the Backup (the config backup and VolumeBackups). Next id: 28

update_backup_plan

update_backup_plan(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.UpdateBackupPlanRequest, dict]] = None, *, backup_plan: Optional[google.cloud.gke_backup_v1.types.backup_plan.BackupPlan] = 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 a BackupPlan.

# 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 gke_backup_v1

def sample_update_backup_plan():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    backup_plan = gke_backup_v1.BackupPlan()
    backup_plan.cluster = "cluster_value"

    request = gke_backup_v1.UpdateBackupPlanRequest(
        backup_plan=backup_plan,
    )

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

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

    response = operation.result()

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

The request object. Request message for UpdateBackupPlan.

backup_plan google.cloud.gke_backup_v1.types.BackupPlan

Required. A new version of the BackupPlan resource that contains updated fields. This may be sparsely populated if an update_mask is provided. This corresponds to the backup_plan field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

This is used to specify the fields to be overwritten in the BackupPlan targeted for update. The values for each of these updated fields will be taken from the backup_plan provided with this request. Field names are relative to the root of the resource (e.g., description, backup_config.include_volume_data, etc.) If no update_mask is provided, all fields in backup_plan will be written to the target BackupPlan resource. Note that OUTPUT_ONLY and IMMUTABLE fields in backup_plan are ignored and are not used to update the target BackupPlan. 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 BackupPlan Defines the configuration and scheduling for a "line" of Backups.

update_restore

update_restore(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.UpdateRestoreRequest, dict]] = None, *, restore: Optional[google.cloud.gke_backup_v1.types.restore.Restore] = 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 a Restore.

# 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 gke_backup_v1

def sample_update_restore():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    restore = gke_backup_v1.Restore()
    restore.backup = "backup_value"

    request = gke_backup_v1.UpdateRestoreRequest(
        restore=restore,
    )

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

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

    response = operation.result()

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

The request object. Request message for UpdateRestore.

restore google.cloud.gke_backup_v1.types.Restore

Required. A new version of the Restore resource that contains updated fields. This may be sparsely populated if an update_mask is provided. This corresponds to the restore field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

This is used to specify the fields to be overwritten in the Restore targeted for update. The values for each of these updated fields will be taken from the restore provided with this request. Field names are relative to the root of the resource. If no update_mask is provided, all fields in restore will be written to the target Restore resource. Note that OUTPUT_ONLY and IMMUTABLE fields in restore are ignored and are not used to update the target Restore. 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 Restore Represents both a request to Restore some portion of a Backup into a target GKE cluster and a record of the restore operation itself. Next id: 18

update_restore_plan

update_restore_plan(request: Optional[Union[google.cloud.gke_backup_v1.types.gkebackup.UpdateRestorePlanRequest, dict]] = None, *, restore_plan: Optional[google.cloud.gke_backup_v1.types.restore_plan.RestorePlan] = 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 a RestorePlan.

# 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 gke_backup_v1

def sample_update_restore_plan():
    # Create a client
    client = gke_backup_v1.BackupForGKEClient()

    # Initialize request argument(s)
    restore_plan = gke_backup_v1.RestorePlan()
    restore_plan.backup_plan = "backup_plan_value"
    restore_plan.cluster = "cluster_value"
    restore_plan.restore_config.all_namespaces = True

    request = gke_backup_v1.UpdateRestorePlanRequest(
        restore_plan=restore_plan,
    )

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

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

    response = operation.result()

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

The request object. Request message for UpdateRestorePlan.

restore_plan google.cloud.gke_backup_v1.types.RestorePlan

Required. A new version of the RestorePlan resource that contains updated fields. This may be sparsely populated if an update_mask is provided. This corresponds to the restore_plan field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

This is used to specify the fields to be overwritten in the RestorePlan targeted for update. The values for each of these updated fields will be taken from the restore_plan provided with this request. Field names are relative to the root of the resource. If no update_mask is provided, all fields in restore_plan will be written to the target RestorePlan resource. Note that OUTPUT_ONLY and IMMUTABLE fields in restore_plan are ignored and are not used to update the target RestorePlan. 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 RestorePlan The configuration of a potential series of Restore operations to be performed against Backups belong to a particular BackupPlan. Next id: 11

volume_backup_path

volume_backup_path(
    project: str, location: str, backup_plan: str, backup: str, volume_backup: str
)

Returns a fully-qualified volume_backup string.

volume_restore_path

volume_restore_path(
    project: str, location: str, restore_plan: str, restore: str, volume_restore: str
)

Returns a fully-qualified volume_restore string.