v1

latestOpenAPI 3.0.0Creative Commons Attribution 3.02026-07-1338139174.7 KB
projects

Create a database.

post/v1/{+parent}/databases

Path parameters

parentstring required

Required. A parent name of the form projects/{project_id}

Query parameters

databaseIdstring

Required. The ID to use for the database, which will become the final component of the database's resource name. This value should be 4-63 characters. Valid characters are /a-z-/ with first character a letter and the last a letter or a number. Must not be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. "(default)" database ID is also valid if the database is Standard edition.

Request body

keyPrefixstring

Output only. The key_prefix for this database. This key_prefix 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 project_id (eg: foo instead of vfoo).

mongodbCompatibleDataAccessMode'DATA_ACCESS_MODE_UNSPECIFIED' | 'DATA_ACCESS_MODE_ENABLED' | 'DATA_ACCESS_MODE_DISABLED'

Optional. The MongoDB compatible API data access mode to use for this database. If not set on write, the default value is DATA_ACCESS_MODE_ENABLED for Enterprise Edition. The value is always DATA_ACCESS_MODE_DISABLED for Standard Edition.

concurrencyMode'CONCURRENCY_MODE_UNSPECIFIED' | 'OPTIMISTIC' | 'PESSIMISTIC' | 'OPTIMISTIC_WITH_ENTITY_GROUPS'

The default concurrency control mode to use for this database. If unspecified in a CreateDatabase request, this will default based on the database edition: Optimistic for Enterprise and Pessimistic for all other databases. While transactions can explicitly specify their own concurrency mode, this setting defines the default behavior when left unspecified. Important: This database-level setting is not respected for Firestore with MongoDB compatibility. All transactions through the MongoDB compatibility layer will use optimistic concurrency control, regardless of this setting.

updateTimestring google-datetime

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.

versionRetentionPeriodstring google-duration

Output only. The period during which past versions of data are retained in the database. Any read or query can specify a read_time 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.

createTimestring google-datetime

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

uidstring

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

realtimeUpdatesMode'REALTIME_UPDATES_MODE_UNSPECIFIED' | 'REALTIME_UPDATES_MODE_ENABLED' | 'REALTIME_UPDATES_MODE_DISABLED'

Immutable. The default Realtime Updates mode to use for this database.

pointInTimeRecoveryEnablement'POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED' | 'POINT_IN_TIME_RECOVERY_ENABLED' | 'POINT_IN_TIME_RECOVERY_DISABLED'

Whether to enable the PITR feature on this database.

earliestVersionTimestring google-datetime

Output only. The earliest timestamp at which older versions of the data can be read from the database. See [version_retention_period] above; this field is populated with now - version_retention_period. 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.

locationIdstring

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

deleteProtectionState'DELETE_PROTECTION_STATE_UNSPECIFIED' | 'DELETE_PROTECTION_DISABLED' | 'DELETE_PROTECTION_ENABLED'

State of delete protection for the database.

freeTierboolean

Output only. Background: Free tier is the ability of a Firestore database to use a small amount of resources every day without being charged. Once usage exceeds the free tier limit further usage is charged. Whether this database can make use of the free tier. Only one database per project can be eligible for the free tier. The first (or next) database that is created in a project without a free tier database will be marked as eligible for the free tier. Databases that are created while there is a free tier database will not be eligible for the free tier.

deleteTimestring google-datetime

Output only. The timestamp at which this database was deleted. Only set if the database has been deleted.

appEngineIntegrationMode'APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED' | 'ENABLED' | 'DISABLED'

The App Engine integration mode to use for this database.

previousIdstring

Output only. The database resource's prior database ID. This field is only populated for deleted databases.

databaseEdition'DATABASE_EDITION_UNSPECIFIED' | 'STANDARD' | 'ENTERPRISE'

Immutable. The edition of the database.

namestring

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

type'DATABASE_TYPE_UNSPECIFIED' | 'FIRESTORE_NATIVE' | 'DATASTORE_MODE'

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

tagsobject

Optional. Input only. Immutable. Tag keys/values directly bound to this resource. For example: "123/environment": "production", "123/costCenter": "marketing"

etagstring

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.

firestoreDataAccessMode'DATA_ACCESS_MODE_UNSPECIFIED' | 'DATA_ACCESS_MODE_ENABLED' | 'DATA_ACCESS_MODE_DISABLED'

Optional. The Firestore API data access mode to use for this database. If not set on write: - the default value is DATA_ACCESS_MODE_DISABLED for Enterprise Edition. - the default value is DATA_ACCESS_MODE_ENABLED for Standard Edition.

Response

Successful response