Class AppProfile (2.10.0)

AppProfile(
    app_profile_id,
    instance,
    routing_policy_type=None,
    description=None,
    cluster_id=None,
    multi_cluster_ids=None,
    allow_transactional_writes=None,
)

Representation of a Google Cloud Bigtable AppProfile.

We can use a AppProfile to:

  • reload itself
  • create itself
  • update itself
  • delete itself

Parameter

NameDescription
app_profile_id str

The ID of the AppProfile. Must be of the form `_a-zA-Z0-9][-_.a-zA-Z0-9]`*. :type: routing_policy_type: int :param: routing_policy_type: (Optional) The type of the routing policy. Possible values are represented by the following constants: :data:google.cloud.bigtable.enums.RoutingPolicyType.ANY :data:google.cloud.bigtable.enums.RoutingPolicyType.SINGLE :type: description: str :param: description: (Optional) Long form description of the use case for this AppProfile. :type: cluster_id: str :param: cluster_id: (Optional) Unique cluster_id which is only required when routing_policy_type is ROUTING_POLICY_TYPE_SINGLE. :type: multi_cluster_ids: list :param: multi_cluster_ids: (Optional) The set of clusters to route to. The order is ignored; clusters will be tried in order of distance. If left empty, all clusters are eligible. :type: allow_transactional_writes: bool :param: allow_transactional_writes: (Optional) If true, allow transactional writes for ROUTING_POLICY_TYPE_SINGLE.

Inheritance

builtins.object > AppProfile

Properties

instance_admin_client

Shortcut to instance_admin_client

Returns
TypeDescription
`.bigtable_admin_pb2.BigtableInstanceAdmin`A BigtableInstanceAdmin instance.

name

AppProfile name used in requests.

.. literalinclude:: snippets.py :start-after: [START bigtable_api_app_profile_name] :end-before: [END bigtable_api_app_profile_name] :dedent: 4

The AppProfile name is of the form "projects/../instances/../app_profile/{app_profile_id}"

Returns
TypeDescription
strThe AppProfile name.

Methods

create

create(ignore_warnings=None)

Create this AppProfile.

.. literalinclude:: snippets.py :start-after: [START bigtable_api_create_app_profile] :end-before: [END bigtable_api_create_app_profile] :dedent: 4

:type: ignore_warnings: bool :param: ignore_warnings: (Optional) If true, ignore safety checks when creating the AppProfile.

delete

delete(ignore_warnings=None)

Delete this AppProfile.

For example:

.. literalinclude:: snippets.py :start-after: [START bigtable_api_delete_app_profile] :end-before: [END bigtable_api_delete_app_profile] :dedent: 4

:type: ignore_warnings: bool :param: ignore_warnings: If true, ignore safety checks when deleting the AppProfile.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason. google.api_core.exceptions.RetryError: If the request failed due to a retryable error and retry attempts failed. ValueError: If the parameters are invalid.

exists

exists()

Check whether the AppProfile already exists.

For example:

.. literalinclude:: snippets.py :start-after: [START bigtable_api_app_profile_exists] :end-before: [END bigtable_api_app_profile_exists] :dedent: 4

Returns
TypeDescription
boolTrue if the AppProfile exists, else False.

from_pb

from_pb(app_profile_pb, instance)

Creates an instance app_profile from a protobuf.

Parameters
NameDescription
app_profile_pb `instance.app_profile_pb`

An instance protobuf object.

instance Instance

The instance that owns the cluster.

Exceptions
TypeDescription
`ValueErro
Returns
TypeDescription
`AppProfile`The AppProfile parsed from the protobuf response.

reload

reload()

Reload the metadata for this cluster

For example:

.. literalinclude:: snippets.py :start-after: [START bigtable_api_reload_app_profile] :end-before: [END bigtable_api_reload_app_profile] :dedent: 4

update

update(ignore_warnings=None)

Update this app_profile.

.. literalinclude:: snippets.py :start-after: [START bigtable_api_update_app_profile] :end-before: [END bigtable_api_update_app_profile] :dedent: 4