Backblaze · Arazzo Workflow

Backblaze Large File Multi-Part Upload

Version 1.0.0

Authorize, start a large file, get a part upload URL, then finish the large file from its parts.

1 workflow 1 source API 1 provider
View Spec View on GitHub Cloud StorageObject StorageStorageBackupArazzoWorkflows

Provider

backblaze

Workflows

large-file-upload
Start, prepare, and finish a multi-part large file upload.
Authorizes the account, starts a large file, obtains a part upload URL, and finishes the file by combining the supplied part SHA1 checksums.
4 steps inputs: bucketId, contentType, fileName, partSha1Array outputs: fileId, fileName, uploadUrl
1
authorize
authorizeAccount
Log in to the B2 API to obtain the authorization token.
2
startLargeFile
startLargeFile
Prepare the large file upload, returning the fileId used by the part-url and finish steps.
3
getUploadPartUrl
getUploadPartUrl
Obtain a URL and authorization token for uploading the parts of the large file identified by the fileId.
4
finishLargeFile
finishLargeFile
Assemble the uploaded parts into a single B2 file using the ordered array of part SHA1 checksums.

Source API Descriptions

Arazzo Workflow Specification

backblaze-large-file-upload-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Backblaze Large File Multi-Part Upload
  summary: Authorize, start a large file, get a part upload URL, then finish the large file from its parts.
  description: >-
    The multi-part upload lifecycle for files over 100MB. The account is
    authorized, b2_start_large_file allocates a fileId for the large upload,
    b2_get_upload_part_url returns a URL and token for uploading parts, and
    b2_finish_large_file assembles the uploaded parts into a single file using
    the supplied ordered array of part SHA1 checksums. The fileId from the start
    step threads through the part-url and finish steps. The actual part-byte
    uploads to the returned uploadUrl happen out of band between these calls.
    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: backblazeB2
  url: ../openapi/backblaze-b2-native-api.yaml
  type: openapi
workflows:
- workflowId: large-file-upload
  summary: Start, prepare, and finish a multi-part large file upload.
  description: >-
    Authorizes the account, starts a large file, obtains a part upload URL, and
    finishes the file by combining the supplied part SHA1 checksums.
  inputs:
    type: object
    required:
    - bucketId
    - fileName
    - contentType
    - partSha1Array
    properties:
      bucketId:
        type: string
        description: The bucket to create the large file in.
      fileName:
        type: string
        description: The name of the large file being uploaded.
      contentType:
        type: string
        description: MIME type of the large file.
      partSha1Array:
        type: array
        description: Ordered SHA1 checksums of each uploaded part.
        items:
          type: string
  steps:
  - stepId: authorize
    description: Log in to the B2 API to obtain the authorization token.
    operationId: authorizeAccount
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      authorizationToken: $response.body#/authorizationToken
  - stepId: startLargeFile
    description: >-
      Prepare the large file upload, returning the fileId used by the part-url
      and finish steps.
    operationId: startLargeFile
    requestBody:
      contentType: application/json
      payload:
        bucketId: $inputs.bucketId
        fileName: $inputs.fileName
        contentType: $inputs.contentType
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      fileId: $response.body#/fileId
  - stepId: getUploadPartUrl
    description: >-
      Obtain a URL and authorization token for uploading the parts of the large
      file identified by the fileId.
    operationId: getUploadPartUrl
    requestBody:
      contentType: application/json
      payload:
        fileId: $steps.startLargeFile.outputs.fileId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      uploadUrl: $response.body#/uploadUrl
      partAuthorizationToken: $response.body#/authorizationToken
  - stepId: finishLargeFile
    description: >-
      Assemble the uploaded parts into a single B2 file using the ordered array
      of part SHA1 checksums.
    operationId: finishLargeFile
    requestBody:
      contentType: application/json
      payload:
        fileId: $steps.startLargeFile.outputs.fileId
        partSha1Array: $inputs.partSha1Array
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      fileId: $response.body#/fileId
      fileName: $response.body#/fileName
      contentLength: $response.body#/contentLength
  outputs:
    fileId: $steps.finishLargeFile.outputs.fileId
    fileName: $steps.finishLargeFile.outputs.fileName
    uploadUrl: $steps.getUploadPartUrl.outputs.uploadUrl