Export to S3
Provide a record ID, format, and bucket information to synchronously export to an S3 bucket. This utility carries out the export action within the task the utility runs in, regardless of whether the Call external API automation is running synchronously or asynchronously.
ExportToS3: function (_sRecordID, _sFormat, _sRecipients, _oBucketInformation)
+ _oBucketInformation.BucketName:
+ _oBucketInformation.AWSRegion:
+ _oBucketInformation.Path:
+ _oBucketInformation.CredentialType:
+ _oBucketInformation.KMSEncryptionKeyID:
+ _oBucketInformation.CannedACL:
+ _oBucketInformation.AccessKeyID:
+ _oBucketInformation.SecretAccessKey:
+ _oBucketInformation.RoleARN:
This utility doesn’t use a success or failure callback attribute in the request parameter.
Note
This utility is available beginning in Orange Logic Milan.
Request parameter attributes
Attribute | Type | Description | Required |
---|---|---|---|
RecordID | string | The record ID of the asset to export. | yes |
Format | string | The asset format to export. ℹ️ Note Proxy formats are not generated when this utility runs. Therefore, this utility can only export existing proxy files. If necessary, use a separate call (such as the Generate or regenerate proxies call) to generate the proxy for export. | yes |
Recipients | string | A comma-separated string of emails. A notification is sent to these addresses whenever this utility runs, notifying users of success or failure. | yes |
BucketInformation | object | Details about the S3 bucket to export to. | yes |
The Bucket Information
object uses the following string attributes:
Attribute | Description | Required |
---|---|---|
BucketName | An AWS S3 bucket name. | yes |
AWSRegion | An AWS S3 region code. | yes |
Path | An AWS S3 bucket path. | no |
CredentialType | An AWS S3 credential type. Enter one of the following values:
| yes |
KMSEncryptionKeyID | An AWS KMS encryption key. | no |
CannedACL | An AWS canned access control list grant. Enter one of the following values:
| no |
AccessKeyID | An AWS IAM user access key ID. Required only when the credential type is IAMUser . | no |
SecretAccessKey | An AWS IAM user secret access key. Required only when the credential type is IAMUser . | no |
RoleARN | An AWS IAM user role ARN. Required only when the credential type is STSDefault . | no |
Response parameter
Structure
{
"Response": {
"Results": [
{
"Success": true | false,
"AmazonError": “Error code from AWS”,
"ErrorMessage": “Internal error message”
}
],
"Message": "Schedule Export to S3 success for asset <recordid> and bucket <bucketname>”
},
"HTTPCode": -1,
"Code": <SUCCESS | FAIL>
}
Example
var response = Utils.ExportToS3(
// Record ID
'2Y8V7CB92PR',
// Format
'TRX',
// Email for receiving response email, separate by ,
[],
// Bucket information
{
BucketName: 'testBucket', // Required
AWSRegion: 'ap-southeast-2', // Required
Path: '2Y8V7CB92PR.mp4', // Required
CredentialType: 'IAMUser', // Required. (IAMUser | STSDefault | Passthrough)
AccessKeyID: '[Secrets.2Y8VTW5MLW9-AccessKeyID]',
SecretAccessKey: '[Secrets.2Y8VTW5MDC8-SecretAccessKey]',
KMSEncryptionKeyID: '',
CannedACL: '',
}
);
Utils.ExecuteHttpRequest('https://webhook.site/48be8d47-2ee1-464b-9a34-2119cf3150e9',
{
Method: 'POST',
Data:response
},
// Success callback function
function (oHttp) {
var oResult = JsonConvert.DeserializeObject(oHttp.responseText);
Log.Info('Executed successfully: ' + oResult)
},
// Failure callback function
function (oHttp) {
var oResult = JsonConvert.DeserializeObject(oHttp.responseText);
Log.Warn('Execution failed: ' + oResult)
}
);
Example response
{
"Response": {
"Results": [
{
"Success": true,
"AmazonError": "",
"ErrorMessage": null
}
],
"Message": "Schedule Export to S3 success for asset <recordid> and bucket <bucketname>”
},
"HTTPCode": -1,
"Code": "SUCCESS"
}
Updated 13 days ago