University of Chicago bundle API

Bundle endpoints.

OpenAPI Specification

university-of-chicago-bundle-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Fence OpenAPI Specification admin/user bundle API
  version: 0.1.0
  description: Access management for Gen3 data commons. Code is available on [GitHub](https://github.com/uc-cdis/fence).
  termsOfService: http://cdis.uchicago.edu/terms/
  contact:
    email: cdis@uchicago.edu
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: https://example.domain/
tags:
- name: bundle
  description: Bundle endpoints.
paths:
  /bundle:
    post:
      tags:
      - bundle
      summary: Create a bundle.
      description: ''
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BundleResponse'
        '400':
          description: Invalid input
        '404':
          description: GUID in bundle doesn't exist.
      security:
      - authToken: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InputBundle'
        description: Body takes in GUID, bundle_name, checksum, list of bundles/objects to bundle, and size. Only list of bundles/objects is required, rest will be created by indexd if not provided.
        required: true
    get:
      summary: List all Bundles.
      description: By default lists all the bundles
      operationId: ListBundles
      parameters:
      - name: form
        in: query
        description: specify whether you want to list bundle, objects or both.
        required: false
        schema:
          type: string
          enum:
          - bundle
          - object
          - all
      - name: start
        in: query
        description: start did
        required: false
        schema:
          type: string
      - name: limit
        in: query
        description: number of records to return for this page, default to 100
        required: false
        schema:
          type: integer
      - name: page
        in: query
        description: pagination support without relying on dids. offsets results by limit*page
        required: false
        schema:
          type: integer
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListBundles'
      security: []
      tags:
      - bundle
  /bundle/{GUID}:
    get:
      tags:
      - bundle
      summary: Get bundle info for a given GUID
      parameters:
      - name: GUID
        in: path
        description: Resolves for both bundle id and object id.
        required: true
        schema:
          type: string
      - name: expand
        in: query
        description: Only shows first layer of contents when expand=false. Recursively unbundles contents when expand=true. false by default
        schema:
          type: boolean
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BundleGet'
        '404':
          description: bundle not found
    delete:
      tags:
      - bundle
      summary: delete bundle from bundle records
      description: ''
      parameters:
      - name: GUID
        in: path
        description: bundle id
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Bundle is successfully deleted
        '404':
          description: Bundle ID not found
      security:
      - authToken: []
components:
  schemas:
    OutputBundle:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/DID'
        form:
          type: string
          description: how the entry was submitted to storage
          enum:
          - object
          - container
          - multipart
          - bundle
        size:
          type: integer
          format: int64
          description: size in bytes
        name:
          type: string
        checksums:
          $ref: '#/components/schemas/Checksum'
        updated_time:
          type: string
          format: date-time
          description: last updated time
        created_time:
          type: string
          format: date-time
          description: time created
    DID:
      type: string
      pattern: ^.*[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$
    BundleResponse:
      type: object
      properties:
        bundle_id:
          $ref: '#/components/schemas/DID'
        name:
          type: string
        contents:
          type: array
          items:
            $ref: '#/components/schemas/OutputBundle'
    InputBundle:
      type: object
      required:
      - bundles
      properties:
        bundle_id:
          $ref: '#/components/schemas/DID'
        name:
          type: string
        size:
          type: integer
          format: int64
          description: size in bytes
        checksums:
          type: array
          items:
            $ref: '#/components/schemas/Checksum'
        description:
          type: string
          description: optional description of the object
        version:
          type: string
          description: optional version string of the object
        bundles:
          type: array
          items:
            type: string
          description: list of guid to be in the bundle
    Checksum:
      type: object
      required:
      - checksum
      properties:
        checksum:
          type: string
          description: The hex-string encoded checksum for the Data.
        type:
          type: string
          description: 'The digest method used to create the checksum. If left unspecified md5

            will be assumed.

            possible values:

            md5                # most blob stores provide a checksum using this

            multipart-md5      # multipart uploads provide a specialized tag in S3

            sha256

            sha512'
    BundleGet:
      type: object
      properties:
        id:
          type: string
        drs_uri:
          type: string
        name:
          type: string
        size:
          type: integer
        created_time:
          type: string
          format: date-time
        updated_time:
          type: string
          format: date-time
        checksums:
          type: array
          items:
            $ref: '#/components/schemas/Checksum'
        contents:
          type: array
          items:
            $ref: '#/components/schemas/BundleContent'
    ListBundles:
      type: object
      properties:
        ids:
          type: array
          items:
            $ref: '#/components/schemas/DID'
        records:
          type: array
          items:
            $ref: '#/components/schemas/OutputBundle'
        size:
          type: integer
          format: int64
          description: size in bytes
        start:
          type: integer
          format: int64
          description: start index for the pagination
        limit:
          type: integer
          format: int64
          description: number of dids to return
        file_name:
          type: string
        urls:
          type: array
          items:
            type: string
        acl:
          type: array
          items:
            type: string
        authz:
          type: array
          items:
            type: string
        checksums:
          $ref: '#/components/schemas/Checksum'
        metadata:
          type: object
        version:
          type: string
    BundleContent:
      type: object
      properties:
        id:
          type: string
        drs_uri:
          type: string
        name:
          type: string
        contents:
          type: array
          items:
            type: object
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: /oauth/authorize
          tokenUrl: /oauth/token
          scopes:
            user: generic user access