Add bucket:delete operation to AWS S3 Node (#1936)

This commit is contained in:
Iván Ovejero 2021-06-24 22:21:13 +02:00 committed by GitHub
parent 69a013d719
commit 9f94984926
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 0 deletions

View file

@ -163,6 +163,15 @@ export class AwsS3 implements INodeType {
returnData.push({ success: true });
}
// https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html
if (operation === 'delete') {
const name = this.getNodeParameter('name', i) as string;
responseData = await awsApiRequestSOAP.call(this, `${name}.s3`, 'DELETE', '', '', {}, headers);
returnData.push({ success: true });
}
//https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html
if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', 0) as boolean;

View file

@ -20,6 +20,11 @@ export const bucketOperations = [
value: 'create',
description: 'Create a bucket',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a bucket',
},
{
name: 'Get All',
value: 'getAll',
@ -152,6 +157,29 @@ export const bucketFields = [
},
],
},
/* -------------------------------------------------------------------------- */
/* bucket:delete */
/* -------------------------------------------------------------------------- */
{
displayName: 'Name',
name: 'name',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'bucket',
],
operation: [
'delete',
],
},
},
description: 'Name of the AWS S3 bucket to delete.',
},
/* -------------------------------------------------------------------------- */
/* bucket:getAll */
/* -------------------------------------------------------------------------- */