# ToscaController Resource

This controller is responsible for storing TOSCA descriptions that can be used by the planner.

### DELETE /user/v1.0/tosca/all

Gets the IDs of all the stored TOSCA descriptions.

Security Roles Allowed
  ADMIN

Response Codes
code | condition
--- | ---
401 | Bad credentials

Response Body
media type | data type | description
--- | --- | ---
application/json | string (JSON) | a list of all the IDs
application/json | string (JSON)
application/xml | string (XML)

#### Example

##### Request

    DELETE /user/v1.0/tosca/all
    Accept: application/json

##### Response

    HTTP/1.1 204 Looks Good
    Content-Type: application/json

    ...

### GET /user/v1.0/tosca/ids

Gets the IDs of all the stored TOSCA descriptions.

Security Roles Allowed
  ADMIN, USER

Response Codes
code | condition
--- | ---
401 | Bad credentials

Response Body
media type | data type | description
--- | --- | ---
application/json | array of string (JSON) | a list of all the IDs
application/json | array of string (JSON)
application/xml | list of string (XML)

#### Example

##### Request

    GET /user/v1.0/tosca/ids
    Accept: application/json

##### Response

    HTTP/1.1 200 Looks Good
    Content-Type: application/json

    ...

### POST /user/v1.0/tosca/post

Security Roles Allowed
  ADMIN, USER

Request Body
media type | data type
--- | ---
application/json | string (JSON)
application/json | string (JSON)
application/xml | string (XML)

Response Codes
code | condition
--- | ---
401 | Bad credentials

Response Body
media type | data type
--- | ---
application/json | string (JSON)
application/json | string (JSON)
application/xml | string (XML)

#### Example

##### Request

    POST /user/v1.0/tosca/post
    Content-Type: application/json
    Accept: application/json

    ...

##### Response

    HTTP/1.1 201 Looks Good
    Content-Type: application/json

    ...

### POST /user/v1.0/tosca/upload

Uploads and stores a TOSCA description file

Security Roles Allowed
  ADMIN, USER

Request Parameters
name | type | description | constraints
--- | --- | --- | ---
file | query |  | required

Response Codes
code | condition
--- | ---
401 | Bad credentials

Response Body
media type | data type | description
--- | --- | ---
application/json | string (JSON) | the ID of the TOSCA description
application/json | string (JSON)
application/xml | string (XML)

#### Example

##### Request

    POST /user/v1.0/tosca/upload
    Accept: application/json

##### Response

    HTTP/1.1 201 Looks Good
    Content-Type: application/json

    ...

### DELETE /user/v1.0/tosca/{id}

Deletes the TOSCA description.

Security Roles Allowed
  ADMIN, USER

Request Parameters
name | type | description | constraints
--- | --- | --- | ---
id | path |  | required

Response Codes
code | condition
--- | ---
401 | Bad credentials

Response Body
media type | data type | description
--- | --- | ---
application/json | string (JSON) | The ID of the deleted TOSCA description.
application/json | string (JSON)
application/xml | string (XML)

#### Example

##### Request

    DELETE /user/v1.0/tosca/{id}
    Accept: application/json

##### Response

    HTTP/1.1 204 Looks Good
    Content-Type: application/json

    ...

### GET /user/v1.0/tosca/{id}

Gets the TOSCA description.

Security Roles Allowed
  ADMIN, USER

Request Parameters
name | type | description | constraints
--- | --- | --- | ---
id | path | the ID TOSCA description. | required
format | query |  | required

Response Codes
code | condition
--- | ---
401 | Bad credentials

Response Body
media type | data type | description
--- | --- | ---
application/json | string (JSON) | the TOSCA description.
application/json | string (JSON)
application/xml | string (XML)

#### Example

##### Request

    GET /user/v1.0/tosca/{id}
    Accept: application/json

##### Response

    HTTP/1.1 200 Looks Good
    Content-Type: application/json

    ...

### GET /user/v1.0/tosca/transform/{id}

Transforms the TOSCA description to docker compose

Security Roles Allowed
  ADMIN, USER

Request Parameters
name | type | description | constraints
--- | --- | --- | ---
id | path | the ID TOSCA description. | required
type | query |  | required

Response Codes
code | condition
--- | ---
401 | Bad credentials

Response Body
media type | data type | description
--- | --- | ---
application/json | string (JSON) | the docker-compose ID.
application/json | string (JSON)
application/xml | string (XML)

#### Example

##### Request

    GET /user/v1.0/tosca/transform/{id}
    Accept: application/json

##### Response

    HTTP/1.1 200 Looks Good
    Content-Type: application/json

    ...