REST Resource: projects.databases

Resource: Database

A Cloud Firestore Database.

JSON representation
{
  "name": string,
  "uid": string,
  "createTime": string,
  "updateTime": string,
  "locationId": string,
  "type": enum (DatabaseType),
  "concurrencyMode": enum (ConcurrencyMode),
  "versionRetentionPeriod": string,
  "earliestVersionTime": string,
  "pointInTimeRecoveryEnablement": enum (PointInTimeRecoveryEnablement),
  "appEngineIntegrationMode": enum (AppEngineIntegrationMode),
  "keyPrefix": string,
  "deleteProtectionState": enum (DeleteProtectionState),
  "etag": string
}
Fields
name

string

The resource name of the Database. Format: projects/{project}/databases/{database}

uid

string

Output only. The system-generated UUID4 for this Database.

createTime

string (Timestamp format)

Output only. The timestamp at which this database was created. Databases created before 2016 do not populate createTime.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

updateTime

string (Timestamp format)

Output only. The timestamp at which this database was most recently updated. Note this only includes updates to the database resource and not data contained by the database.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

locationId

string

The location of the database. Available locations are listed at https://cloud.google.com/firestore/docs/locations.

type

enum (DatabaseType)

The type of the database. See https://cloud.google.com/datastore/docs/firestore-or-datastore for information about how to choose.

concurrencyMode

enum (ConcurrencyMode)

The concurrency control mode to use for this database.

versionRetentionPeriod

string (Duration format)

Output only. The period during which past versions of data are retained in the database.

Any read or query can specify a readTime within this window, and will read the state of the database at that time.

If the PITR feature is enabled, the retention period is 7 days. Otherwise, the retention period is 1 hour.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

earliestVersionTime

string (Timestamp format)

Output only. The earliest timestamp at which older versions of the data can be read from the database. See [versionRetentionPeriod] above; this field is populated with now - versionRetentionPeriod.

This value is continuously updated, and becomes stale the moment it is queried. If you are using this value to recover data, make sure to account for the time from the moment when the value is queried to the moment when you initiate the recovery.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

pointInTimeRecoveryEnablement

enum (PointInTimeRecoveryEnablement)

Whether to enable the PITR feature on this database.

appEngineIntegrationMode

enum (AppEngineIntegrationMode)

The App Engine integration mode to use for this database.

keyPrefix

string

Output only. The keyPrefix for this database. This keyPrefix is used, in combination with the project id ("~") to construct the application id that is returned from the Cloud Datastore APIs in Google App Engine first generation runtimes.

This value may be empty in which case the appid to use for URL-encoded keys is the projectId (eg: foo instead of v~foo).

deleteProtectionState

enum (DeleteProtectionState)

State of delete protection for the database.

etag

string

This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.

DatabaseType

The type of the database. See https://cloud.google.com/datastore/docs/firestore-or-datastore for information about how to choose.

Mode changes are only allowed if the database is empty.

Enums
DATABASE_TYPE_UNSPECIFIED The default value. This value is used if the database type is omitted.
FIRESTORE_NATIVE Firestore Native Mode
DATASTORE_MODE Firestore in Datastore Mode.

ConcurrencyMode

The type of concurrency control mode for transactions.

Enums
CONCURRENCY_MODE_UNSPECIFIED Not used.
OPTIMISTIC Use optimistic concurrency control by default. This mode is available for Cloud Firestore databases.
PESSIMISTIC

Use pessimistic concurrency control by default. This mode is available for Cloud Firestore databases.

This is the default setting for Cloud Firestore.

OPTIMISTIC_WITH_ENTITY_GROUPS

Use optimistic concurrency control with entity groups by default.

This is the only available mode for Cloud Datastore.

This mode is also available for Cloud Firestore with Datastore Mode but is not recommended.

PointInTimeRecoveryEnablement

Point In Time Recovery feature enablement.

Enums
POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED Not used.
POINT_IN_TIME_RECOVERY_ENABLED

Reads are supported on selected versions of the data from within the past 7 days:

  • Reads against any timestamp within the past hour
  • Reads against 1-minute snapshots beyond 1 hour and within 7 days

versionRetentionPeriod and earliestVersionTime can be used to determine the supported versions.

POINT_IN_TIME_RECOVERY_DISABLED Reads are supported on any version of the data from within the past 1 hour.

AppEngineIntegrationMode

The type of App Engine integration mode.

Enums
APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED Not used.
ENABLED If an App Engine application exists in the same region as this database, App Engine configuration will impact this database. This includes disabling of the application & database, as well as disabling writes to the database.
DISABLED

App Engine has no effect on the ability of this database to serve requests.

This is the default setting for databases created with the Firestore API.

DeleteProtectionState

The delete protection state of the database.

Enums
DELETE_PROTECTION_STATE_UNSPECIFIED The default value. Delete protection type is not specified
DELETE_PROTECTION_DISABLED Delete protection is disabled
DELETE_PROTECTION_ENABLED Delete protection is enabled

Methods

create

Create a database.

delete

Deletes a database.

exportDocuments

Exports a copy of all or a subset of documents from Google Cloud Firestore to another storage system, such as Google Cloud Storage.

get

Gets information about a database.

importDocuments

Imports documents into Google Cloud Firestore.

list

List all the databases in the project.

patch

Updates a database.

restore

Creates a new database by restoring from an existing backup.