# PlannerController Resource

This controller is responsible for planing the type of resources to be provisopned based on a TOSCA description.

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

Security Roles Allowed
  ADMIN

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

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

#### Example

##### Request

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

##### Response

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

    ...

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

Gets the IDs of all the stored plans

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 IDs
application/xml | list of string (XML)

#### Example

##### Request

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

##### Response

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

    ...

### POST /user/v1.0/planner/vereify_plan

verifies plan. Checks if this is a concrete plan

Security Roles Allowed
  ADMIN, USER

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

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

Response Body
media type | data type | description
--- | --- | ---
application/json | boolean (JSON) | the id of the created plan
application/xml | boolean (XML)

#### Example

##### Request

    POST /user/v1.0/planner/vereify_plan
    Content-Type: application/json
    Accept: application/json

    ...

##### Response

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

    ...

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

Deletes the plan.

Security Roles Allowed
  ADMIN, USER

Request Parameters
name | type | description | constraints
--- | --- | --- | ---
id | path | . The ID of the plan | required

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

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

#### Example

##### Request

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

##### Response

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

    ...

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

Gets a plan

Security Roles Allowed
  ADMIN, USER

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

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

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

#### Example

##### Request

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

##### Response

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

    ...

### GET /user/v1.0/planner/plan/{tosca_id}

Plans resources (number, size of VMs etc).

Security Roles Allowed
  ADMIN, USER

Request Parameters
name | type | description | constraints
--- | --- | --- | ---
tosca_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 created plan
application/xml | string (XML)

#### Example

##### Request

    GET /user/v1.0/planner/plan/{tosca_id}
    Accept: application/json

##### Response

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

    ...

### POST /user/v1.0/planner/post/{name}

Security Roles Allowed
  ADMIN, USER

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

Request Body
media type | data type
--- | ---
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/xml | string (XML)

#### Example

##### Request

    POST /user/v1.0/planner/post/{name}
    Content-Type: application/json
    Accept: application/json

    ...

##### Response

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

    ...

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

Gets the ID of the TOSCA description that was used to generate the plan. The plan is represented by its ID

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 TOSCA description ID
application/xml | string (XML)

#### Example

##### Request

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

##### Response

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

    ...

### POST /user/v1.0/planner/post/{level}/{name}/{id}

Security Roles Allowed
  ADMIN, USER

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

Request Body
media type | data type
--- | ---
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/xml | string (XML)

#### Example

##### Request

    POST /user/v1.0/planner/post/{level}/{name}/{id}
    Content-Type: application/json
    Accept: application/json

    ...

##### Response

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

    ...