判断Bucket是否存在
更新时间:2023-09-27
判断Bucket是否存在
-
基本流程
- 创建BosClient。
- 执行doesBucketExist()方法。
-
示例代码
JavaScript1client.doesBucketExist(<BucketName>) //指定Bucket名称 2 .then(function(response) { 3 if(response) { 4 console.log('Bucket exists'); 5 } 6 else { 7 console.log('Bucket not exists'); 8 } 9 }) 10 .catch(function() { 11 // 查询失败,添加您自己的代码,处理异常 12 });