deleteSite()
Cloud Run is in Alpha, which means APIs may change in any version and documentation is not yet finished. See the changelog to stay up to date with breaking changes.
Removes a Remotion project from your Cloud Storage bucket.
Each project is located in the sites/
subdirectory of your Cloud Storage bucket. Calling this function is equivalent of deleting all files inside a subfolder of your sites/
subdirectory.
Example
Gets all sites and deletes them.
ts
import {GcpRegion ,deleteSite ,getSites } from "@remotion/cloudrun";constregion :GcpRegion = "australia-southeast1";const {sites } = awaitgetSites (region );for (constsite ofsites ) {awaitdeleteSite ({bucketName :site .bucketName ,siteName :site .id ,});console .log (`Site ${site .id } deleted.`);}
ts
import {GcpRegion ,deleteSite ,getSites } from "@remotion/cloudrun";constregion :GcpRegion = "australia-southeast1";const {sites } = awaitgetSites (region );for (constsite ofsites ) {awaitdeleteSite ({bucketName :site .bucketName ,siteName :site .id ,});console .log (`Site ${site .id } deleted.`);}
Arguments
An object with the following properties:
bucketName
string
The name of the Cloud Storage bucket in which your site resides in.
siteName
string
The unique ID of the project you want to delete.
Return value
A promise resolving to an object with the following property:
totalSizeInBytes
Nothing. If the deletion failed, the service rejects with an error.