Skip to main content

deleteSite()

EXPERIMENTAL

从你的云存储桶中移除一个 Remotion 项目。

🌐 Removes a Remotion project from your Cloud Storage bucket.

每个项目都位于你的云存储桶的 sites/ 子目录中。调用此函数等同于删除 sites/ 子目录的子文件夹中的所有文件。

🌐 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.

import {GcpRegion, deleteSite, getSites} from '@remotion/cloudrun';

const region: GcpRegion = 'australia-southeast1';

const {sites} = await getSites(region);

for (const site of sites) {
  await deleteSite({
    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

你想要删除的项目的唯一ID。

🌐 The unique ID of the project you want to delete.

返回值

🌐 Return value

一个毫无结果的承诺。

🌐 A promise resolving nothing.

另请参阅

🌐 See also