Commit aa6990e1 authored by Spiros Koulouzis's avatar Spiros Koulouzis

update API

parent ecac42d8
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
<goal>generate</goal> <goal>generate</goal>
</goals> </goals>
<configuration> <configuration>
<inputSpec>${basedir}/../openAPI/API/CloudStorm-1.0.0-openapi.yaml</inputSpec> <inputSpec>${basedir}/../openAPI/API/CONF-3.0.0-swagger.yaml</inputSpec>
<generatorName>java</generatorName> <generatorName>java</generatorName>
<output>${project.build.directory}/generated-sources</output> <output>${project.build.directory}/generated-sources</output>
<apiPackage>${default.package}.handler</apiPackage> <apiPackage>${default.package}.handler</apiPackage>
......
--- ---
swagger: "2.0" swagger: "2.0"
info: info:
description: CONF allows application developers to seamlessly plan a customized virtual infrastructure based on application level constraints on QoS and resource budgets, provisioning the virtual infrastructure, deploy application components onto the virtual infrastructure, and start execution on demand using TOSCA. description: 'TOSCA Simple qUeRy sErvice (SURE). '
version: 3.0.0 version: 1.0.0
title: CONF title: tosca-sure
contact: contact:
email: z.zhao@uva.nl email: S.Koulouzis@uva.nl
license: license:
name: Apache 2.0 name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html url: http://www.apache.org/licenses/LICENSE-2.0.html
basePath: /conf-api/3.0 basePath: /tosca-sure/1.0.0
schemes: schemes:
- https - https
- http - http
...@@ -17,7 +17,7 @@ paths: ...@@ -17,7 +17,7 @@ paths:
/tosca_template: /tosca_template:
post: post:
summary: upload a tosca template description file summary: upload a tosca template description file
description: uploads and validates TOSCA template file description: upload and validate a tosca template description file
operationId: uploadToscaTemplate operationId: uploadToscaTemplate
consumes: consumes:
- multipart/form-data - multipart/form-data
...@@ -34,187 +34,312 @@ paths: ...@@ -34,187 +34,312 @@ paths:
type: string type: string
"405": "405":
description: Invalid input description: Invalid input
security: /tosca_template/{id}:
- auth: get:
- write:ToscaTemplate description: ""
- read:ToscaTemplate operationId: getToscaTemplate
/tosca_template/ids: produces:
- application/json
parameters:
- name: id
in: path
description: ID of topolog template uplodaed
required: true
type: string
responses:
"200":
description: successful operation
schema:
$ref: '#/definitions/ToscaTemplate'
"404":
description: Not found
"405":
description: Invalid input
/tosca_template/{id}/imports:
get: get:
summary: Get all topolog template IDs summary: ""
description: Returns all IDs description: returns the interface types
operationId: getToscaTemplateIDs operationId: getImports
produces: produces:
- application/json - application/json
parameters: [] parameters:
- name: id
in: path
description: ID of topolog template uplodaed
required: true
type: string
responses: responses:
"200": "200":
description: successful operation description: successful operation
schema: schema:
type: array type: array
items: items:
type: string type: object
"400": additionalProperties:
description: Invalid ID supplied type: object
properties: {}
"404": "404":
description: ToscaTemplate not found description: Not found
"405": "405":
description: Invalid input description: Invalid input
security: /tosca_template/{id}/dsl_definitions:
- auth:
- write:ToscaTemplate
- read:ToscaTemplate
/tosca_template/{id}:
get: get:
summary: Find topolog template by ID summary: ""
description: Returns a single topolog template description: returns the interface types
operationId: getToscaTemplateByID operationId: getDslDefinitions
produces: produces:
- text/plain - application/json
parameters: parameters:
- name: id - name: id
in: path in: path
description: ID of topolog template to return description: ID of topolog template uplodaed
required: true required: true
type: string type: string
- name: anchors
in: query
description: the anchors the definition is for
required: false
type: array
items:
type: string
collectionFormat: multi
- name: derived_from
in: query
description: derived from
required: false
type: string
responses: responses:
"200": "200":
description: successful operation description: successful operation
schema: schema:
type: string type: array
"400": items:
description: Invalid ID supplied type: object
additionalProperties:
type: object
properties: {}
"404": "404":
description: ToscaTemplate not found description: Not found
"405": "405":
description: Invalid input description: Invalid input
security: /tosca_template/{id}/types:
- auth: get:
- write:ToscaTemplate summary: ""
- read:ToscaTemplate description: returns the interface types
put: operationId: getTypes
summary: Updates exisintg topolog template
description: ""
operationId: updateToscaTemplateByID
consumes:
- multipart/form-data
produces: produces:
- text/plain - application/json
parameters: parameters:
- name: file
in: formData
description: tosca Template description
required: false
type: file
- name: id - name: id
in: path in: path
description: ID of topolog template to return description: ID of topolog template uplodaed
required: true required: true
type: string type: string
- name: kind_of_type
in: query
description: the type we are looking for e.g. capability_types, artifact_types. etc.
required: false
type: string
enum:
- node_types
- relationship_types
- capability_types
- artifact_types
- data_types
- interface_types
- policy_types
- group_types
- name: has_interfaces
in: query
description: filter if has interfaces
required: false
type: boolean
- name: type_name
in: query
description: The type_name
required: false
type: string
- name: has_properties
in: query
description: filter if has properties
required: false
type: boolean
- name: has_attributes
in: query
description: filter if has attributes
required: false
type: boolean
- name: has_requirements
in: query
description: filter if has requirements
required: false
type: boolean
- name: has_capabilities
in: query
description: filter if has capabilities
required: false
type: boolean
- name: has_artifacts
in: query
description: filter if has artifacts
required: false
type: boolean
- name: derived_from
in: query
description: derived from
required: false
type: string
responses: responses:
"200": "200":
description: successful operation description: successful operation
schema: schema:
type: string type: array
"400": items:
description: Invalid ID supplied type: object
additionalProperties:
type: object
properties: {}
"404": "404":
description: ToscaTemplate not found description: Not found
"405": "405":
description: Invalid input description: Invalid input
security: /tosca_template/{id}/relationship_templates:
- auth: get:
- write:ToscaTemplate summary: ""
- read:ToscaTemplate description: returns the interface types
delete: operationId: getRelationshipTemplates
summary: Deletes a tosca topology template produces:
description: "" - application/json
operationId: deleteToscaTemplateByID
parameters: parameters:
- name: id - name: id
in: path in: path
description: ID of topology template to return description: ID of topolog template uplodaed
required: true required: true
type: string type: string
- name: type_name
in: query
description: The relationship type
required: false
type: string
- name: derived_from
in: query
description: derived from
required: false
type: string
responses: responses:
"200": "200":
description: successful operation description: successful operation
schema: schema:
type: string type: array
"400": items:
description: Invalid ID supplied type: object
additionalProperties:
type: object
properties: {}
"404": "404":
description: ToscaTemplate not found description: Not found
security: "405":
- auth: description: Invalid input
- write:ToscaTemplate /tosca_template/{id}/topology_template:
- read:ToscaTemplate
/planner/plan/{id}:
get: get:
summary: plan tosca template description: r
description: Returns the ID of the planed topolog template operationId: getTopologyTemplate
operationId: planToscaTemplateByID
produces: produces:
- text/plain - application/json
parameters: parameters:
- name: id - name: id
in: path in: path
description: ID of topolog template to plan description: ID of topolog template uplodaed
required: true required: true
type: string type: string
responses: responses:
"200": "200":
description: successful operation description: successful operation
schema: schema:
type: string $ref: '#/definitions/TopologyTemplate'
"400":
description: Invalid ID supplied
"404": "404":
description: ToscaTemplate not found description: Not found
"405": "405":
description: Invalid input description: Invalid input
security: /tosca_template/{id}/topology_template/node_templates:
- auth:
- write:ToscaTemplate
- read:ToscaTemplate
/provisioner/provision/{id}:
get: get:
summary: provision tosca template description: returns nodes templates in topology
description: 'provosions the operationId: Plan Tosca Template Returns the provision ID' operationId: getNodeTemplates
operationId: provisionPlanToscaTemplateByID
produces: produces:
- text/plain - application/json
parameters: parameters:
- name: id - name: id
in: path in: path
description: ID of topolog template to plan description: ID of topolog template uplodaed
required: true required: true
type: string type: string
- name: type_name
in: query
description: The type
required: false
type: string
- name: node_name
in: query
description: the name
required: false
type: string
- name: has_interfaces
in: query
description: filter if has interfaces
required: false
type: boolean
- name: has_properties
in: query
description: filter if has properties
required: false
type: boolean
- name: has_attributes
in: query
description: filter if has attributes
required: false
type: boolean
- name: has_requirements
in: query
description: filter if has requirements
required: false
type: boolean
- name: has_capabilities
in: query
description: filter if has capabilities
required: false
type: boolean
- name: has_artifacts
in: query
description: filter if has artifacts
required: false
type: boolean
responses: responses:
"200": "200":
description: successful operation description: successful operation
schema: schema:
type: string type: array
"400": items:
description: Invalid ID supplied $ref: '#/definitions/NodeTemplate'
"404": "404":
description: ToscaTemplate not found description: Not found
"405": "405":
description: Invalid input description: Invalid input
security: /tosca_template/{id}/topology_template/node_templates/{node_name}/type_name:
- auth:
- write:ToscaTemplate
- read:ToscaTemplate
/deployer/deploy/{id}:
get: get:
summary: deploy the software tosca template summary: ""
description: Returns the deployment ID description: ""
operationId: deployProvisionToscaTemplateByID operationId: getNodeTypeName
produces: produces:
- text/plain - application/json
parameters: parameters:
- name: id - name: id
in: path in: path
description: ID of topolog template to deploy description: ID of topolog template uplodaed
required: true
type: string
- name: node_name
in: path
description: node_name
required: true required: true
type: string type: string
responses: responses:
...@@ -222,407 +347,444 @@ paths: ...@@ -222,407 +347,444 @@ paths:
description: successful operation description: successful operation
schema: schema:
type: string type: string
"400":
description: Invalid ID supplied
"404": "404":
description: ToscaTemplate not found description: Not found
"405": "405":
description: Invalid input description: Invalid input
security: /tosca_template/{id}/topology_template/node_templates/{node_name}/requirements:
- auth: get:
- write:ToscaTemplate description: 'Returns the requirements for an input node as described in the template not in the node''s definition '
- read:ToscaTemplate operationId: getNodeRequirements
/credential:
post:
summary: Create credentials
description: Creates credentials
operationId: createCredentials
consumes:
- application/json
produces: produces:
- application/json - application/json
parameters: parameters:
- in: body - name: id
name: body in: path
description: Created user object description: ID of topolog template uplodaed
required: true required: true
schema: type: string
$ref: '#/definitions/Credentials' - name: node_name
in: path
description: node_name
required: true
type: string
responses: responses:
"200": "200":
description: successful operation description: successful operation
schema: schema:
type: string type: object
"400": additionalProperties:
description: Invalid ID supplied type: object
properties: {}
"404": "404":
description: ToscaTemplate not found description: Not found
"405": "405":
description: Invalid input description: Invalid input
security: /tosca_template/{id}/topology_template/node_templates/{node_name}/derived_from:
- auth:
- write:Credentials
- read:Credentials
/credential/ids:
get: get:
summary: Get all credential IDs summary: ""
description: 'Returns all IDss ' description: ""
operationId: getCredentialIDs operationId: getParentTypeName
produces: produces:
- application/json - application/json
parameters: [] parameters:
- name: id
in: path
description: ID of topolog template uplodaed
required: true
type: string
- name: node_name
in: path
description: node_name
required: true
type: string
responses: responses:
"200": "200":
description: successful operation description: successful operation
schema: schema:
type: array
items:
type: string type: string
"400":
description: Invalid ID supplied
"404": "404":
description: ToscaTemplate not found description: Not found
"405": "405":
description: Invalid input description: Invalid input
security: /tosca_template/{id}/topology_template/node_templates/{node_name}/ancestors_requirements:
- auth: get:
- write:ToscaTemplate summary: ""
- read:ToscaTemplate description: Recursively get all requirements all the way to the ROOT including the input node's
/user: operationId: getAncestorsRequirements
post:
summary: Create user
description: This can only be done by admin.
operationId: createUser
produces: produces:
- application/json - application/json
parameters: parameters:
- in: body - name: id
name: body in: path
description: Created user object description: ID of topolog template uplodaed
required: true required: true
schema: type: string
$ref: '#/definitions/User' - name: node_name
in: path
description: node_name
required: true
type: string
responses: responses:
"200": "200":
description: successful operation description: successful operation
schema: schema:
type: string type: object
"409": additionalProperties:
description: already exists type: object
security: properties: {}
- auth: "404":
- admin:User description: Not found
/user/login: "405":
description: Invalid input
/tosca_template/{id}/topology_template/node_templates/{node_name}/ancestors_types:
get: get:
tags: summary: ""
- user description: Recursively get all requirements all the way to the ROOT including the input node's
summary: Logs user into the system operationId: getAllAncestorTypes
description: ""
produces: produces:
- application/json - application/json
parameters: parameters:
- name: username - name: id
in: query in: path
description: The user name for login description: ID of topolog template uplodaed
required: true required: true
type: string type: string
- name: password - name: node_name
in: query in: path
description: The password for login in clear text description: node_name
required: true required: true
type: string type: string
responses: responses:
"200": "200":
description: successful operation description: successful operation
headers:
X-Rate-Limit:
type: integer
format: int32
description: calls per hour allowed by the user
X-Expires-After:
type: string
format: date-time
description: date in UTC when token expires
schema: schema:
type: array
items:
type: string type: string
"400": "404":
description: Invalid username/password supplied description: Not found
/user/logout: "405":
description: Invalid input
/tosca_template/{id}/topology_template/node_templates/{node_name}/ancestors_properties:
get: get:
summary: Logs out current logged in user session summary: ""
description: "" description: Recursively get all requirements all the way to the ROOT including the input node's
operationId: getAllAncestorProperties
produces: produces:
- application/json - application/json
parameters: [] parameters:
- name: id
in: path
description: ID of topolog template uplodaed
required: true
type: string
- name: node_name
in: path
description: node_name
required: true
type: string
responses: responses:
default: "200":
description: successful operation description: successful operation
/user/{username}: schema:
type: array
items:
type: object
additionalProperties:
type: object
properties: {}
"404":
description: Not found
"405":
description: Invalid input
/tosca_template/{id}/topology_template/node_templates/{node_name}/properties:
get: get:
summary: Get user by user name summary: ""
description: "" description: s
operationId: getNodeProperties
produces: produces:
- application/json - application/json
parameters: parameters:
- name: username - name: id
in: path in: path
description: 'The name that needs to be fetched. Use user1 for testing. ' description: ID of topolog template uplodaed
required: true
type: string
- name: node_name
in: path
description: node_name
required: true required: true
type: string type: string
responses: responses:
"200": "200":
description: successful operation description: successful operation
schema: schema:
$ref: '#/definitions/User' type: object
"400": additionalProperties:
description: Invalid username supplied type: object
properties: {}
"404": "404":
description: User not found description: Not found
security: "405":
- auth: description: Invalid input
- admin:User
put: put:
tags: summary: ""
- user description: s
summary: Updated user operationId: setNodeProperties
description: This can only be done by the logged in user.
produces: produces:
- application/json - application/json
parameters: parameters:
- name: username - name: id
in: path in: path
description: name that need to be updated description: ID of topolog template uplodaed
required: true required: true
type: string type: string
- in: body - in: body
name: body name: properties
description: Updated user object required: true
schema:
type: object
additionalProperties:
type: object
properties: {}
- name: node_name
in: path
description: node_name
required: true required: true
type: string
responses:
"200":
description: successful operation
schema: schema:
$ref: '#/definitions/User' type: string
"404":
description: Not found
"405":
description: Invalid input
/tosca_template/{id}/topology_template/node_templates/{node_name}/outputs:
get:
summary: ""
description: s
operationId: getNodeOutputs
produces:
- application/json
parameters:
- name: id
in: path
description: ID of topolog template uplodaed
required: true
type: string
- name: node_name
in: path
description: node_name
required: true
type: string
responses: responses:
"400": "200":
description: Invalid user supplied description: successful operation
schema:
type: array
items:
type: object
additionalProperties:
type: object
properties: {}
"404": "404":
description: User not found description: Not found
security: "405":
- auth: description: Invalid input
- admin:User /tosca_template/{id}/topology_template/node_templates/{node_name}/related:
delete: get:
summary: Delete user summary: ""
description: This can only be done by the logged in user. description: s
operationId: getRelatedNodes
produces: produces:
- application/json - application/json
parameters: parameters:
- name: username - name: id
in: path
description: ID of topolog template uplodaed
required: true
type: string
- name: node_name
in: path in: path
description: The name that needs to be deleted description: node_name
required: true required: true
type: string type: string
responses: responses:
"400": "200":
description: Invalid username supplied description: successful operation
schema:
type: array
items:
$ref: '#/definitions/NodeTemplate'
"404": "404":
description: User not found description: Not found
security: "405":
- auth: description: Invalid input
- admin:User
securityDefinitions:
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: definitions:
User: ToscaTemplate:
type: object
Credentials:
type: object type: object
properties: properties:
protocol: tosca_definitions_version:
type: string
token_type:
type: string type: string
token: tosca_default_namespace:
type: string type: string
keys: template_name:
type: object
additionalProperties:
type: string type: string
user: topology_template:
$ref: '#/definitions/TopologyTemplate'
template_author:
type: string type: string
cloud_provider_name: template_version:
type: string type: string
NodeTemplate: description:
type: object
properties:
derived_from:
type: string type: string
properties: imports:
type: array
items:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
properties: {} properties: {}
requirements: dsl_definitions:
type: array
items:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
properties: {} properties: {}
interfaces: node_types:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
properties: {} properties: {}
capabilities: relationship_types:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
properties: {} properties: {}
type: relationship_templates:
type: string
description:
type: string
directives:
type: array
items:
type: string
attributes:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
properties: {} properties: {}
artifacts: capability_types:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
properties: {} properties: {}
TopologyTemplate: artifact_types:
type: object
properties:
description:
type: string
inputs:
type: object type: object
additionalProperties: additionalProperties:
type: string
node_templates:
type: object type: object
additionalProperties: properties: {}
$ref: '#/definitions/NodeTemplate' data_types:
relationship_templates:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
properties: {} properties: {}
outputs: interface_types:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
properties: {} properties: {}
groups: policy_types:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
properties: {} properties: {}
substitution_mappings: group_types:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
properties: {} properties: {}
policies: repositories:
type: array
items:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
properties: {} properties: {}
ToscaTemplate: TopologyTemplate:
type: object type: object
properties: properties:
tosca_definitions_version:
type: string
tosca_default_namespace:
type: string
template_name:
type: string
topology_template:
$ref: '#/definitions/TopologyTemplate'
template_author:
type: string
template_version:
type: string
description: description:
type: string type: string
imports: inputs:
type: array
items:
type: object type: object
additionalProperties: additionalProperties:
type: string
node_templates:
type: object type: object
properties: {} additionalProperties:
dsl_definitions: $ref: '#/definitions/NodeTemplate'
relationship_templates:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
properties: {} properties: {}
node_types: outputs:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
properties: {} properties: {}
relationship_types: groups:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
properties: {} properties: {}
relationship_templates: substitution_mappings:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
properties: {} properties: {}
capability_types: policies:
type: array
items:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
properties: {} properties: {}
artifact_types: NodeTemplate:
type: object
properties:
derived_from:
type: string
properties:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
properties: {} properties: {}
data_types: requirements:
type: array
items:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
properties: {} properties: {}
interface_types: interfaces:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
properties: {} properties: {}
policy_types: capabilities:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
properties: {} properties: {}
group_types: type:
type: string
description:
type: string
directives:
type: array
items:
type: string
attributes:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
properties: {} properties: {}
repositories: artifacts:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
properties: {} properties: {}
Provisioner:
type: object
CloudsStormTopTopology:
type: object
...@@ -44,14 +44,33 @@ paths: ...@@ -44,14 +44,33 @@ paths:
components: components:
schemas: schemas:
CloudsStormTopTopology: CloudsStormTopTopology:
type: "object" type: object
properties: properties:
userName: userName:
type: "string" type: string
publicKeyPath: publicKeyPath:
type: "string" type: string
topologies: topologies:
type: array type: array
items: items:
$ref: 'https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/openAPI/schema/CloudsStormSubTopology.yml#/CloudsStormSubTopology' $ref: '#/components/schemas/CloudsStormSubTopology'
CloudsStormSubTopology:
type: object
properties:
VMs:
type: array
items:
$ref: '#/components/schemas/CloudsStormVM'
CloudsStormVM:
type: object
properties:
name:
type: string
nodeType:
type: string
OSType:
type: string
script:
type: string
publicAddress:
type: string
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment