OpsMill Storage API

The Storage API from OpsMill — 6 operation(s) for storage.

OpenAPI Specification

opsmill-storage-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Infrahub Artifact Storage API
  version: 1.10.0
tags:
- name: Storage
paths:
  /api/storage/files/by-hfid/{kind}:
    get:
      summary: Download File Object By Hfid
      description: "Download a file by the FileObject node's Human-Friendly ID (HFID).\n\nRequires `VIEW` permission on the FileObject node.\nReturns the binary file content with `Content-Type` from the node's `file_type` attribute and `Content-Disposition` header with the original\nfilename.\n\nRaises:\n    HTTPException: When the requested kind does not inherit from the FileObject schema."
      operationId: download_file_object_by_hfid_api_storage_files_by_hfid__kind__get
      security:
      - HTTPBearer: []
      - APIKeyHeader: []
      parameters:
      - name: kind
        in: path
        required: true
        schema:
          type: string
          title: Kind
      - name: hfid
        in: query
        required: true
        schema:
          type: array
          items:
            type: string
          description: HFID component values in order
          title: Hfid
        description: HFID component values in order
      - name: preview
        in: query
        required: false
        schema:
          type: boolean
          description: Return file for inline display rather than as an attachment
          default: false
          title: Preview
        description: Return file for inline display rather than as an attachment
      - name: branch
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Name of the branch to use for the query
          title: Branch
        description: Name of the branch to use for the query
      - name: at
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Time to use for the query, in absolute or relative format
          title: At
        description: Time to use for the query, in absolute or relative format
      responses:
        '200':
          description: File content with Content-Type matching the file's MIME type
          content:
            '*/*':
              schema:
                type: string
                format: binary
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Storage
  /api/storage/files/by-storage-id/{storage_id}:
    get:
      summary: Download File Object By Storage Id
      description: "Download a file from storage by its storage_id.\n\nRequires `VIEW` permission on the FileObject node.\nReturns the binary file content with `Content-Type` from the node's `file_type` attribute and `Content-Disposition` header with the original\nfilename.\n\nRaises:\n    NodeNotFoundError: When no FileObject node matches the provided storage_id."
      operationId: download_file_object_by_storage_id_api_storage_files_by_storage_id__storage_id__get
      security:
      - HTTPBearer: []
      - APIKeyHeader: []
      parameters:
      - name: storage_id
        in: path
        required: true
        schema:
          type: string
          title: Storage Id
      - name: preview
        in: query
        required: false
        schema:
          type: boolean
          description: Return file for inline display rather than as an attachment
          default: false
          title: Preview
        description: Return file for inline display rather than as an attachment
      - name: branch
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Name of the branch to use for the query
          title: Branch
        description: Name of the branch to use for the query
      - name: at
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Time to use for the query, in absolute or relative format
          title: At
        description: Time to use for the query, in absolute or relative format
      responses:
        '200':
          description: File content with Content-Type matching the file's MIME type
          content:
            '*/*':
              schema:
                type: string
                format: binary
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Storage
  /api/storage/files/{node_id}:
    get:
      summary: Download File Object
      description: 'Download a file by the FileObject node''s UUID.


        Requires `VIEW` permission on the FileObject node.

        Returns the binary file content with `Content-Type` from the node''s `file_type` attribute and `Content-Disposition` header with the original

        filename.'
      operationId: download_file_object_api_storage_files__node_id__get
      security:
      - HTTPBearer: []
      - APIKeyHeader: []
      parameters:
      - name: node_id
        in: path
        required: true
        schema:
          type: string
          title: Node Id
      - name: preview
        in: query
        required: false
        schema:
          type: boolean
          description: Return file for inline display rather than as an attachment
          default: false
          title: Preview
        description: Return file for inline display rather than as an attachment
      - name: branch
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Name of the branch to use for the query
          title: Branch
        description: Name of the branch to use for the query
      - name: at
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Time to use for the query, in absolute or relative format
          title: At
        description: Time to use for the query, in absolute or relative format
      responses:
        '200':
          description: File content with Content-Type matching the file's MIME type
          content:
            '*/*':
              schema:
                type: string
                format: binary
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Storage
  /api/storage/object/{identifier}:
    get:
      summary: Get File
      operationId: get_file_api_storage_object__identifier__get
      security:
      - HTTPBearer: []
      - APIKeyHeader: []
      parameters:
      - name: identifier
        in: path
        required: true
        schema:
          type: string
          title: Identifier
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Storage
  /api/storage/upload/content:
    post:
      summary: Upload Content
      operationId: upload_content_api_storage_upload_content_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UploadContentPayload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
      - APIKeyHeader: []
      tags:
      - Storage
  /api/storage/upload/file:
    post:
      summary: Upload File
      operationId: upload_file_api_storage_upload_file_post
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_upload_file_api_storage_upload_file_post'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
      - APIKeyHeader: []
      tags:
      - Storage
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    Body_upload_file_api_storage_upload_file_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
      type: object
      required:
      - file
      title: Body_upload_file_api_storage_upload_file_post
    UploadContentPayload:
      properties:
        content:
          type: string
          title: Content
      type: object
      required:
      - content
      title: UploadContentPayload
    UploadResponse:
      properties:
        identifier:
          type: string
          title: Identifier
        checksum:
          type: string
          title: Checksum
      type: object
      required:
      - identifier
      - checksum
      title: UploadResponse
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-INFRAHUB-KEY