Amagi Submit API

The Submit API from Amagi — 1 operation(s) for submit.

OpenAPI Specification

amagi-submit-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  description: 'The purpose of this application is to provide documentation of the APIs in services-amagi-tv


    # Authentication


    <!-- ReDoc-Inject: <security-definitions> -->'
  title: services-amagi-tv Add User Submit API
  contact:
    email: suvrojyoti@amagi.com
  version: null
servers:
- url: https://r5i37dwfp8.execute-api.us-east-1.amazonaws.com/dev/
  description: Development Server
- url: https://services.amagi.tv
  description: Production Server
tags:
- name: Submit
paths:
  /submit:
    post:
      security:
      - TokenAuth: []
      summary: Schedules a container job, requires operator's access
      operationId: createContainerJob
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - cloud
              - region
              - id
              - image/ami
              - customer
              - command/user_data
              properties:
                customer:
                  $ref: '#/components/schemas/customer'
                cloud:
                  $ref: '#/components/schemas/cloudProvider'
                region:
                  $ref: '#/components/schemas/region'
                env:
                  $ref: '#/components/schemas/env'
                id:
                  type: string
                  description: Submitter Job Classification Identifier
                tags:
                  $ref: '#/components/schemas/tags'
                resources:
                  $ref: '#/components/schemas/resources'
                image:
                  $ref: '#/components/schemas/dockerImage'
                command:
                  $ref: '#/components/schemas/command'
                ami:
                  $ref: '#/components/schemas/ami'
                user_data:
                  $ref: '#/components/schemas/user_data'
                priority:
                  $ref: '#/components/schemas/Priority'
                timeout:
                  $ref: '#/components/schemas/timeout'
                queue:
                  $ref: '#/components/schemas/queue'
            example:
              cloud: aws
              region: us-east-1
              env:
                asset_id: '23'
                host: example.com
              id: Transcode_23
              customer: lightning
              tags:
                channel_code: RIALT_203
              resources:
                vcpus: 1
                memory: 0.5
              image/ami: hello-world:linux
              command/user_data: '[]/<some_user_data>'
              priority/queue: HIGH/<queue_name>
      responses:
        '200':
          description: queued container job
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/newJob'
        '400':
          $ref: '#/components/responses/badRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          description: Internal Server Error
      tags:
      - Submit
components:
  schemas:
    user_data:
      title: user data which needs to be passed for EC2 job submission
      type: string
      description: User Data
    region:
      type: string
      description: Cloud Provider region where the job was scheduled
      title: region represents the region where the job was scheduled
    Priority:
      description: Job priority
      title: priority represents the Job priority
      type: string
      enum:
      - HIGH
      - LOW
    cloudProvider:
      description: Cloud provider
      title: cloud_provider represents the list of all cloud providers supported
      type: string
      enum:
      - aws
      - azure
    newJob:
      description: Provides job id for a new job request submitted
      title: newJob represents the response of new job id submitted
      type: object
      required:
      - job_id
      properties:
        job_id:
          type: string
          description: Job ID
    customer:
      description: Customer
      title: customer for which the job is run
      type: string
    command:
      description: Docker arguments
      title: command represents the docker arguments passed to the container
      type: array
      items:
        type: string
    resources:
      description: Compute resources
      title: resources represents the compute resources required to run the job
      type: object
      properties:
        vcpus:
          type: integer
          description: vcpus required to run the job
        memory:
          type: number
          format: float
          description: Memory in GB required to run the job
    dockerImage:
      title: dockerImage represents the docker image url
      type: string
      description: Docker image url
    errorMessage:
      type: object
      required:
      - error
      properties:
        error:
          type: object
          required:
          - status
          - message
          - code
          properties:
            status:
              type: integer
              description: HTTP Status Code
            message:
              type: string
              description: Error description
            code:
              type: string
              description: Pre defined Error code
    timeout:
      title: timeout for a job's execution
      type: integer
      description: Job timeout
    env:
      type: object
      additionalProperties:
        type: string
      description: Key pair values of environment variables
      title: env represents the environment variables passed to the container
    queue:
      title: Batch queue which needs to be used for Batch job submission
      type: string
      description: Job Queue
    ami:
      title: AMI which needs to be used for EC2 job submission
      type: string
      description: AMI
    tags:
      type: object
      additionalProperties: true
      description: Customer submitter tags
      title: tags represents the custom tags used to tag the job
  responses:
    badRequestError:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorMessage'
    UnauthorizedError:
      description: Token key is missing or invalid
      headers:
        WWW_Authenticate:
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorMessage'
  securitySchemes:
    access-key:
      type: apiKey
      in: header
      name: access_key
    secret-key:
      type: apiKey
      in: header
      name: secret_key