Skip to content

Manage environments

Alex O. Karasulu edited this page Mar 9, 2018 · 2 revisions
swagger: '2.0'
info:
  title: Console API
  description: Subutai Console API
  version: "1.0.0"
host: localhost:9999
schemes:
  - https
basePath: /rest/v1/environments
paths:
  /:
    post:
      summary: Create Environment
      description:
        The endpoint allows to create environment
      tags:
        - Environment
        - Container
      parameters:
        - name: topology
          in: body
          description: environment creation request describing environment
          required: true
          schema:
            $ref: '#/definitions/CreateEnvironmentRequest'
      responses:
        202:
          description: Http ACCEPTED status is returned in case environment creation started successfully
        default:
          description: Unexpected error
          schema:
            $ref: '#/definitions/Error'

  /{environment-id}:
    post:
      summary: Grow Environment
      description:
        The endpoint allows to grow environment
      tags:
        - Environment
        - Container
      parameters:
        - name: topology
          in: body
          description: environment modification request containing new nodes
          required: true
          schema:
            $ref: '#/definitions/GrowEnvironmentRequest'

        - name: environment-id
          in: path
          description: id of environment
          required: true
          type: string
      responses:
        202:
          description: Http ACCEPTED status is returned in case environment modification started successfully
        default:
          description: Unexpected error
          schema:
            $ref: '#/definitions/Error'
   

definitions:
  CreateEnvironmentRequest:
    type: object
    properties:
      name:
        type: string
        description: Name of future environment
      sshKey:
        type: string
        description: ssh key to add to each environment container
      nodes:
        type: array
        description: Future environment containers
        items:
          $ref: '#/definitions/Node'

  GrowEnvironmentRequest:
    type: object
    properties:
      nodes:
        type: array
        description: Future environment containers
        items:
          $ref: '#/definitions/Node'

  Node:
    type: object
    properties:
      hostname: 
        type: string
        description: Hostname of container
      templateId:
        type: string
        required: false
        description: Id of template to use for container cloning (if missing, templateName parameter is used)
      templateName:
        type: string
        required: false
        description: Name of template to use for container creation (if templateId is not specified, template is looked up by templateName among verified templates, so one of them must be present)
      peerId:
        type: string
        required: false
        description: Id of peer where container will be created (if missing, local peer is assumed)
      resourceHostId:
        type: string
        required: false
        description: Id of resource host where container will be created (if missing, management host is assumed)
      quota:
        required: false
        description: Container size (if missing, TINY size is assumed) 
        $ref: '#/definitions/ContainerQuota'
        
  ContainerQuota:
    type: object
    properties:
      containerSize: 
        type: string
        description: size of container (selects resource quotas for container and respectively effects pricing)
        enum:
          - TINY
          - SMALL
          - MEDIUM
          - LARGE
          - HUGE
    
  Error:
    type: object
    properties:
      error:
        type: string
Clone this wiki locally