arazzo: 1.0.1
info:
title: Amazon Data Exchange Export Revision To S3
summary: Export all assets of a revision to an S3 bucket by creating, starting, and polling a job.
description: >-
The consumer (or producer) export path for AWS Data Exchange. The workflow
creates an EXPORT_REVISIONS_TO_S3 job pointed at a chosen data set and
revision, starts the job, and polls until it reaches a terminal state,
branching on completion versus failure. Every step spells out its request
inline so the flow can be read and executed without opening the underlying
OpenAPI description.
version: 1.0.0
sourceDescriptions:
- name: jobsApi
url: ../openapi/amazon-data-exchange-jobs-api-openapi.yml
type: openapi
workflows:
- workflowId: export-revision-to-s3
summary: Export a revision's assets to S3 and wait for the job to finish.
description: >-
Creates an EXPORT_REVISIONS_TO_S3 job for the supplied data set and
revision, starts it, and polls the job state until COMPLETED or a failure
state.
inputs:
type: object
required:
- dataSetId
- revisionId
- bucket
properties:
dataSetId:
type: string
description: The ID of the data set whose revision is exported.
revisionId:
type: string
description: The ID of the revision to export.
bucket:
type: string
description: The destination S3 bucket for the exported assets.
keyPattern:
type: string
description: The key pattern for naming exported objects.
default: ${Revision.CreatedAt}/${Asset.Name}
steps:
- stepId: createExportJob
description: >-
Create an EXPORT_REVISIONS_TO_S3 job that writes the revision's assets to
the destination bucket.
operationId: CreateJob
requestBody:
contentType: application/json
payload:
Type: EXPORT_REVISIONS_TO_S3
Details:
ExportRevisionsToS3:
DataSetId: $inputs.dataSetId
RevisionDestinations:
- RevisionId: $inputs.revisionId
Bucket: $inputs.bucket
KeyPattern: $inputs.keyPattern
successCriteria:
- condition: $statusCode == 201
outputs:
jobId: $response.body#/Id
jobState: $response.body#/State
- stepId: startExportJob
description: >-
Start the export job, transitioning it out of the WAITING state.
operationId: StartJob
parameters:
- name: JobId
in: path
value: $steps.createExportJob.outputs.jobId
successCriteria:
- condition: $statusCode == 202
outputs:
startedState: $response.body#/State
- stepId: pollExportJob
description: >-
Poll the export job until terminal. Loops while WAITING or IN_PROGRESS,
branches to success on COMPLETED and to failure on ERROR or TIMED_OUT.
operationId: GetJob
parameters:
- name: JobId
in: path
value: $steps.createExportJob.outputs.jobId
successCriteria:
- condition: $statusCode == 200
outputs:
state: $response.body#/State
onSuccess:
- name: exportDone
type: end
criteria:
- condition: $response.body#/State == 'COMPLETED'
- name: exportPending
type: goto
stepId: pollExportJob
criteria:
- condition: $response.body#/State == 'WAITING' || $response.body#/State == 'IN_PROGRESS'
- name: exportFailed
type: goto
stepId: reportFailure
criteria:
- condition: $response.body#/State == 'ERROR' || $response.body#/State == 'TIMED_OUT'
- stepId: reportFailure
description: >-
Re-read the failed job to capture its error details for reporting.
operationId: GetJob
parameters:
- name: JobId
in: path
value: $steps.createExportJob.outputs.jobId
successCriteria:
- condition: $statusCode == 200
outputs:
state: $response.body#/State
errors: $response.body#/Errors
outputs:
jobId: $steps.createExportJob.outputs.jobId
finalState: $steps.pollExportJob.outputs.state
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.