swagger: "2.0"
info:
  description: "SURE Simple qUeRy sErvice TOSCA. "
  version: "3.0.0"
  title: "SURE TOSCA"
  contact:
    email: "S.Koulouzis@uva.nl"
  license:
    name: "Apache 2.0"
    url: "http://www.apache.org/licenses/LICENSE-2.0.html"
basePath: "/sure_tosca"
schemes:
- "https"
- "http"
paths:
  /tosca_template/validate:
    get:
      summary: "validate tosca template file"
      description: ""
      operationId: "validateToscaTemplate"
      consumes:
      - "multipart/form-data"
      parameters:
      - in: "formData"
        name: "file"
        type: file
        description: "tosca Template description"
        required: true
      responses:
        200:
          description: "successful operation"
          schema:
            type: "string"
        405:
          description: "Invalid input"  
  /tosca_template/{id}/node_templates:
    get:
      summary: ""
      description: ""
      operationId: "getNodeTemplates"
      produces:
        - "application/json"      
      parameters:
      - name: "id"
        in: "path"
        description: "ID of topolog template uplodaed"
        required: true
        type: "string"
      - in: query
        name: node_type
        type: string
        description: The node type to return
      responses:
        200:
          description: "successful operation"
          schema:
            $ref: '#/definitions/ArrayOfNodeTemplate'
        405:
          description: "Invalid input"
  /tosca_template/{id}/node_templates/type_name:
    get:
      summary: ""
      description: ""
      operationId: "getNodeTypeName"
      produces:
        - "application/json"      
      parameters:
      - name: "id"
        in: "path"
        description: "ID of topolog template uplodaed"
        required: true
        type: "string"
      - in: "body"
        name: "body"
        description: ""
        required: true
        schema:
          $ref: '#/definitions/NodeTemplate'
      responses:
        200:
          description: "successful operation"
          schema:
            type: "string"
        405:
          description: "Invalid input"      
  /tosca_template/{id}/node_templates/requirements:
    get:
      summary: ""
      description: ""
      operationId: "getNodeRequirements"
      produces:
        - "application/json"      
      parameters:
      - name: "id"
        in: "path"
        description: "ID of topolog template uplodaed"
        required: true
        type: "string"
      - in: "body"
        name: "body"
        description: ""
        required: true
        schema:
          $ref: '#/definitions/NodeTemplate'
      responses:
        200:
          description: "successful operation"
          schema:
            type: object
            additionalProperties:
              type: string     
        405:
          description: "Invalid input"       
          
  /tosca_template/{id}/node_templates/parent_type_name:
    get:
      summary: ""
      description: ""
      operationId: "getParentTypeName"
      produces:
        - "application/json"      
      parameters:
      - name: "id"
        in: "path"
        description: "ID of topolog template uplodaed"
        required: true
        type: "string"
      - in: "body"
        name: "body"
        description: ""
        required: true
        schema:
          $ref: '#/definitions/NodeTemplate'
      responses:
        200:
          description: "successful operation"
          schema:
            type: string
        405:
          description: "Invalid input"      
  /tosca_template/{id}/node_templates/ancestors_requirements:
    get:
      summary: ""
      description: ""
      operationId: "getAncestorsRequirements"
      produces:
        - "application/json"      
      parameters:
      - name: "id"
        in: "path"
        description: "ID of topolog template uplodaed"
        required: true
        type: "string"
      - in: "body"
        name: "body"
        description: ""
        required: true
        schema:
          $ref: '#/definitions/NodeTemplate'
      responses:
        200:
          description: "successful operation"
          schema:
            type: object
            additionalProperties:
              type: string
        405:
          description: "Invalid input"    
securityDefinitions:
  drip_auth:
    type: "oauth2"
    authorizationUrl: "http://localhost/oauth/dialog"
    flow: "implicit"
    scopes:
      write:ToscaTemplate: "modify topolog template in your account"
      read:ToscaTemplate: "read your topolog template"
      admin:User: "Grants access to admin operations"
      write:Credentials: "modify cloud credentials in your account"
      read:Credentials: "read your cloud credentials"
definitions:
  ToscaTemplate:
    type: "object"
    properties:
      tosca_definitions_version:
        type: "string"
      tosca_default_namespace:
        type: "string"  
      template_name:
        type: "string"         
      imports:
        type: "array"
        items:
          type: object
          additionalProperties:
            type: string
      repositories:
        type: object
        additionalProperties:
          type: string     
      dsl_definitions:
        type: object
        additionalProperties:
          type: string      
      node_types:
        type: object
        additionalProperties:
          type: object     
      topology_template:
        $ref: "#/definitions/TopologyTemplate" 
      relationship_types:
        type: object
        additionalProperties:
          type: object    
      relationship_templates:
        type: object
        additionalProperties:
          type: object      
      capability_types:
        type: object
        additionalProperties:
          type: object      
      artifact_types:
        type: object
        additionalProperties:
          type: object        
      data_types:
        type: object
        additionalProperties:
          type: object 
      interface_types:
        type: object
        additionalProperties:
          type: object     
      policy_types:
        type: object
        additionalProperties:
          type: string  
      group_types:
        type: object
        additionalProperties:
          type: object   
      description:
        type: "string"
      template_author:
        type: "string"
  TopologyTemplate:
    type: "object"
    properties:
      description:
        type: "string"
      inputs:
        type: "array"
        items:
          type: object
          additionalProperties:
            type: object
      policies:
        type: "array"
        items:
          type: object
          additionalProperties:
            type: object            
      outputs:
        type: "array"
        items:
          type: object
          additionalProperties:
            type: object       
      node_templates:
        type: object
        additionalProperties:
          type: object     
      relationship_templates:
        type: object
        additionalProperties:
          type: object        
      groups:
        type: object
        additionalProperties:
          type: object    
      substitution_mappings:
        type: object
        additionalProperties:
          type: object    
  NodeTemplate:
    type: "object"
    properties:
      name:
        type: "string"
      type:
        type: "string"      
      requirements:
        type: "array"
        items:
          type: object
          additionalProperties:
            type: object
      artifacts:
        type: object
        additionalProperties:
          type: object      
      properties:
        type: object
        additionalProperties:
          type: object   
      interfaces:
        type: object
        additionalProperties:
          type: object     
      capabilities:
        type: object
        additionalProperties:
          type: object    
      workflows:
        type: object
        additionalProperties:
          type: object     
          
  ArrayOfNodeTemplate:
    type: "array"
    items: 
      $ref: "#/definitions/NodeTemplate" 
    

          
externalDocs:
  description: "Find out more about DRIP"
  url: "https://github.com/QCAPI-DRIP/DRIP-integration/wiki"
