Bucket Refresh
EXPERIMENTAL
Refresh external bucket. For Snowflake and BigQuery backends only. If the database object (DB, schema...) isn't available anymore (was deleted or revoked), the bucket in Storage will be deleted.
By default only tables whose backend LAST_ALTERED is newer than the bucket's stored lastChangeDate are refreshed. Use force=1 to ignore the stored date and refresh all tables and views (useful to recover from a stale Snowflake LAST_ALTERED on a data share), or pass lastChangeDate to override the comparison date. force takes precedence over lastChangeDate.
A regular (not external, not linked) Snowflake bucket in the default branch can be refreshed too. The refresh registers the tables of the bucket schema that Storage does not know yet - for example a table restored with UNDROP TABLE or created outside Keboola - with their columns, types, primary key and comments as descriptions, and transfers their ownership to the project role. Tables Storage already knows are never changed or removed, import staging tables (__temp_ prefix) and objects other than tables are skipped, and an empty table younger than about 15 minutes is left for a later refresh because it may belong to a table create still in progress. force and lastChangeDate do not apply.
Initial response returns job details JobResponse. The result of the asynchronous job can be fetched via /v2/storage/jobs/{id}. When the job completes, final result is RefreshJobResponse.
Parameters of job will be RefreshJobParams.
Request
- Base URLhttps://connection.keboola.com
- Auth
- API key in header X-StorageApi-Token
- or API key in header X-KBC-ManageApiToken
- or HTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
Bucket ID.
Query parameters
When true, ignore the stored lastChangeDate and refresh all tables and views. Takes precedence over lastChangeDate.
Override of the lastChangeDate used to detect altered tables. Can be a unix timestamp or any date accepted by strtotime. Examples: -2 days, 1360138863, 2013-02-12T15:19:21+00:00. Ignored when force is true.
Response
Job accepted; returns job details.
Example response
{
"id": "22077337",
"status": "waiting",
"url": "https://connection.keboola.com/v2/storage/jobs/22077337",
"tableId": null,
"operationName": "workspaceLoad",
"operationParams": {
"workspaceId": "78423",
"preserve": false,
"input": [
{
"source": "in.c-application-testing.cashier-data",
"destination": "my-table"
}
],
"queue": "main_fast"
},
"createdTime": "2017-02-13T16:41:18+0100",
"startTime": null,
"endTime": null,
"runId": null,
"results": null,
"creatorToken": {
"id": "27978",
"description": "john.doe@keboola.com"
},
"actor": {
"type": "token",
"id": "27978",
"name": "john.doe@keboola.com",
"adminId": 1234
},
"metrics": {
"inCompressed": false,
"inBytes": 0,
"inBytesUncompressed": 0,
"outCompressed": false,
"outBytes": 0,
"outBytesUncompressed": 0
}
}Changes
No recorded changes to this operation across all 1 revision of this API.