api module

class api.DeleteSystemResource

Bases: api.TychoResource

System termination. Given a GUID for a Tycho system, use Tycho core to eliminate all components comprising the running system.

endpoint = 'deletesystemresource'
mediatypes()
methods = {'POST'}
post()

Delete a system based on a name. — tag: start description: Delete a system on the compute fabric. requestBody:

description: System start message. required: true content:

application/json:
schema:

$ref: ‘#/components/schemas/DeleteRequest’

responses:
‘200’:

description: Success content:

application/json:
schema:

type: string example: “Successfully validated”

‘400’:

description: Malformed message content:

text/plain:
schema:

type: string

class api.StartSystemResource

Bases: api.TychoResource

Parse, model, emit orchestrator artifacts and execute a system.

endpoint = 'startsystemresource'
mediatypes()
methods = {'POST'}
post()

Start a system based on a specification on the compute fabric.

The specification is a docker-compose yaml parsed into a JSON object. — tag: start description: Start a system on the compute fabric. requestBody:

description: System start message. required: true content:

application/json:
schema:

$ref: ‘#/components/schemas/System’

responses:
‘200’:

description: Success content:

text/plain:
schema:

type: string example: “Successfully validated”

‘400’:

description: Malformed message content:

text/plain:
schema:

type: string

class api.StatusSystemResource

Bases: api.TychoResource

Status executing systems. Given a GUID (or not) determine system status.

endpoint = 'statussystemresource'
mediatypes()
methods = {'POST'}
post()

Status running systems. — tag: start description: Status running systems. requestBody:

description: List systems. required: true content:

application/json:
schema:

$ref: ‘#/components/schemas/StatusRequest’

responses:
‘200’:

description: Success content:

application/json:
schema:

type: string example: “Successfully validated”

‘400’:

description: Malformed message content:

text/plain:
schema:

type: string

class api.TychoResource

Bases: flask_restful.Resource

Base class handler for Tycho API requests.

create_response(result=None, status='success', message='', exception=None)

Create a response. Handle formatting and modifiation of status for exceptions.

validate(request, component)

Validate a request against the schema.

api.app = <Flask 'api'>

Enable CORS.

api.debug = False

Load the schema.

api.tycho()