DataStore

Represents a data store.

特性

pathstring

The resource path of the data store.

Format: universes/{universe_id}/data-stores/{data_store_id}.

createTimestring
僅限輸出

The timestamp when the data store was created. 此字串的格式為 Timestamp

idstring
僅限輸出

The ID of the data store. Matches the last segment of the path.

基本網址

https://apis.roblox.com
DataStore資源

{
"path": "universes/123/data-stores/some-data-store",
"createTime": "2023-07-05T12:34:56Z",
"id": "string"
}

DataStore

List Data Stores
Beta

GET /cloud/v2/universes/{universe_id}/data-stores

Returns a list of data stores.

範圍
universe-datastores.control:list
請求路徑參數
universe_idstring
需要

The universe ID.

查詢參數
maxPageSizenumber

The maximum number of data stores to return. The service might return fewer than this value. If unspecified, at most 10 data stores are returned. The maximum value is 100 and higher values are set to 100.

pageTokenstring

A page token, received from a previous call, to retrieve a subsequent page.

When paginating, all other parameters provided to the subsequent call must match the call that provided the page token.

filterstring

This field may be set in order to filter the resources returned.

The filter field supports a very small subset of CEL:

  • Only the id field is supported.
  • Only the startsWith function is available; no other operators nor built-ins are supported.

Example filter: id.startsWith("foo").

回應

A list of DataStores in the parent collection.

dataStoresarray<DataStore>

The DataStores from the specified Universe.

nextPageTokenstring

A token that you can send as a pageToken parameter to retrieve the next page. If this field is omitted, there are no subsequent pages.

GET /cloud/v2/universes/{universe_id}/data-stores

curl -L -X GET 'https://apis.roblox.com/cloud/v2/universes/{universe_id}/data-stores?maxPageSize=10&pageToken={string}&filter={string}' \
-H 'x-api-key: {your-api-key}'
回應

{
"dataStores": [
{
"path": "universes/123/data-stores/some-data-store",
"createTime": "2023-07-05T12:34:56Z",
"id": "string"
}
],
"nextPageToken": "string"
}

DataStore

Snapshot Data Stores
Beta

POST /cloud/v2/universes/{universe_id}/data-stores:snapshot

Takes a new snapshot of the data stores in an experience.

After a snapshot, the next write to every key in the experience will create a versioned backup of the previous data, regardless of the time of the last write.

In effect, all data current at the time of the snapshot is guaranteed to be available as a versioned backup for at least 30 days.

Snapshots can be taken once per UTC day, per experience. If the latest snapshot was taken within the same UTC day, this operation is a no-op and the time of the latest snapshot will be returned.

For more information on using snapshots, see the Data Stores Engine guide.

範圍
universe-datastores.control:snapshot
請求路徑參數
universe_idstring
需要

The universe ID.

請求主體
回應

Returns whether a new snapshot was taken and the time of the latest snapshot after the operation (regardless of whether a new snapshot was taken).

newSnapshotTakenboolean

Whether a new snapshot was taken by this operation. (Only one snapshot can be taken per experience per UTC day.).

latestSnapshotTimestring

The time of the latest snapshot after the operation (regardless of whether a new snapshot was created). This time is always returned in UTC. 此字串的格式為 Timestamp

POST /cloud/v2/universes/{universe_id}/data-stores:snapshot

curl -L -X POST 'https://apis.roblox.com/cloud/v2/universes/{universe_id}/data-stores:snapshot' \
-H 'x-api-key: {your-api-key}' \
-H 'Content-Type: application/json' \
--data '{}'
回應

{
"newSnapshotTaken": true,
"latestSnapshotTime": "2023-07-05T12:34:56Z"
}