Calyptia core_instance_file API

The core_instance_file API from Calyptia — 2 operation(s) for core_instance_file.

OpenAPI Specification

calyptia-core-instance-file-api-openapi.yml Raw ↑
openapi: 3.0.4
info:
  title: Calyptia Cloud agent core_instance_file API
  version: '1.0'
  description: HTTP API service of Calyptia Cloud
  contact:
    name: Calyptia
    email: hello@calyptia.com
    url: https://cloud.calyptia.com
  termsOfService: https://calyptia.com/terms/
servers:
- url: https://cloud-api.calyptia.com
  description: prod
- url: https://cloud-api-dev.calyptia.com
  description: dev
- url: https://cloud-api-staging.calyptia.com
  description: staging
- url: http://localhost:{port}
  description: local
  variables:
    port:
      default: '5000'
tags:
- name: core_instance_file
paths:
  /v1/core_instances/{coreInstanceID}/files:
    parameters:
    - name: coreInstanceID
      in: path
      schema:
        type: string
        format: uuid
      required: true
    post:
      operationId: createCoreInstanceFile
      summary: Create Core Instance File
      description: 'Create a new file within a core instance.

        The file will be created with the given name and content.

        If `encypted` is set to `true`, the file will be encrypted using the

        core instance''s encryption key.

        The name must be unique among all files within the core instance.'
      tags:
      - core_instance_file
      security:
      - user: []
      - project: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCoreInstanceFile'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Created'
    get:
      operationId: coreInstanceFiles
      summary: Core Instance Files
      description: Files from a core instance with backward pagination.
      tags:
      - core_instance_file
      security:
      - user: []
      - project: []
      parameters:
      - name: last
        schema:
          type: integer
          minimum: 0
        in: query
        description: Limit to the last files.
      - name: before
        schema:
          type: string
        in: query
        description: Paginate files before the given cursor.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CoreInstanceFiles'
  /v1/core_instance_files/{coreInstanceFileID}:
    parameters:
    - name: coreInstanceFileID
      in: path
      schema:
        type: string
        format: uuid
      required: true
    patch:
      operationId: updateCoreInstanceFile
      summary: Update Core Instance File
      description: 'Update a file within a core instance.

        The file will be updated with the given name and content.

        If `encypted` is set to `true`, the file will be encrypted using the

        core instance''s encryption key.'
      tags:
      - core_instance_file
      security:
      - user: []
      - project: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCoreInstanceFile'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Updated'
    delete:
      operationId: deleteCoreInstanceFile
      summary: Delete Core Instance File
      description: Delete a file within a core instance.
      tags:
      - core_instance_file
      security:
      - user: []
      - project: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deleted'
components:
  schemas:
    CreateCoreInstanceFile:
      type: object
      properties:
        name:
          type: string
          example: myfile
        contents:
          type: string
          format: byte
          description: The contents of the file to be created in base 64 format.
        encrypted:
          type: boolean
          default: false
      required:
      - name
      - contents
      - encrypted
    CoreInstanceFiles:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/CoreInstanceFile'
        endCursor:
          type: string
          nullable: true
        count:
          type: number
          format: int32
      required:
      - items
      - endCursor
      - count
    UpdateCoreInstanceFile:
      type: object
      properties:
        name:
          type: string
          nullable: true
          default: null
          example: myfile
        contents:
          type: string
          format: byte
          nullable: true
          default: null
          description: Optional contents of the file to be updated in base 64 format.
        encrypted:
          type: boolean
          nullable: true
          default: null
    Created:
      type: object
      properties:
        id:
          type: string
          format: uuid
        createdAt:
          type: string
          format: date-time
      required:
      - id
      - createdAt
    Deleted:
      type: object
      properties:
        deleted:
          type: boolean
        deletedAt:
          type: string
          format: date-time
          nullable: true
          default: null
      required:
      - deleted
      - deletedAt
    Updated:
      type: object
      properties:
        updatedAt:
          type: string
          format: date-time
      required:
      - updatedAt
    CoreInstanceFile:
      type: object
      properties:
        id:
          type: string
          format: uuid
        coreInstanceID:
          type: string
          format: uuid
        name:
          type: string
          example: myfile
        contents:
          type: string
          format: byte
          description: 'The contents of the file in base 64 format.

            If the file is encrypted, the contents will be the encrypted

            version of the file.'
        encrypted:
          type: boolean
          default: false
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
      - id
      - coreInstanceID
      - name
      - contents
      - encrypted
      - createdAt
      - updatedAt
  securitySchemes:
    user:
      type: http
      scheme: bearer
    project:
      name: X-Project-Token
      type: apiKey
      in: header
    auth0:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://sso.calyptia.com/oauth/token
          scopes: {}
        authorizationCode:
          authorizationUrl: https://sso.calyptia.com/authorize
          tokenUrl: https://sso.calyptia.com/oauth/token
          scopes: {}