Execution Environment Type

Describes the type of the Execution Environment including additional info.

Each execution environment belongs to a specific type that is referred with the type_id field (see Create).

Schema

Field

Type

Required

Readonly

Auto Managed

Example

id

String

True

True

False

vm

name

String

True

False

False

Virtual Machine

description

String

False

False

False

The service is deployed in virtual machine.

Warning

  • It is not possible to update readonly fields.

  • it is not possible to set the auto managed fields.

Note

  • id is required but it is auto-generated if not provided. It is recommended to provide a friendly for simplify the retrieve of connected date in other indices.

Create

To create a new execution environment type use the following REST call:

POST /type/exec-env/(string: id)

with the request body in JSON format:

POST /type/exec-env HTTP/1.1
Host: cb-manager.example.com
Content-Type: application/json

{
    "id": "<type-id>",
    "name": "<formal-name>"
}
Parameters
  • id – optional execution environment type id.

Request Headers
Response Headers
Status Codes

Replace the data with the correct values, for example <type-id>, and <formal-name> with “vm” and “Virtual Machine”, respectively.

Note

It is possible to add additional data specific for this execution environment type.

If the creation is correctly executed the response is:

HTTP/1.1 201 Created
Content-Type: application/json

[
    {
        "status": "Created",
        "code": 201,
        "error": false,
        "message": "Executed environment type with id=<exec-env-type-id> correctly created"
    }
]

Otherwise, if, for example, an execution environment type with the given id is already found, this is the response:

HTTP/1.1 406 Not Acceptable
Content-Type: application/json

[
    {
        "status": "Not Acceptable",
        "code": 406,
        "error": true,
        "message": "Id already found"
    }
]

If some required data is missing (for example name), the response could be:

HTTP/1.1 406 Not Acceptable
Content-Type: application/json

[
    {
        "status": "Not Acceptable",
        "code": 406,
        "error": true,
        "message": {
            "name": "required"
        }
    }
]

Read

To get the list of execution environment types:

GET /type/exec-env/(string: id)

The response includes all the execution environment types created.

It is possible to filter the results using the following request body:

GET /type/exec-env HTTP/1.1
Host: cb-manager.example.com
Content-Type: application/json

{
    "select": [ "name" ],
    "where": {
        "equals": {
            "target": "id",
            "expr": "<exec-env-type-id>"
        }
    }
}
Parameters
  • id – optional execution environment type id.

Request Headers
Response Headers
Status Codes

In this way, it will be returned only the name of the execution environment type with id = “<type-id>”.

Update

To update an execution environment type, use:

PUT /type/exec-env/(string: id)
PUT /type/exec-env HTTP/1.1
Host: cb-manager.example.com
Content-Type: application/json

{
    "id": "<exec-env-type-id>",
    "name"":<new-formal-name>",
}
Parameters
  • id – optional execution environment type id.

Request Headers
Response Headers
Status Codes

This example set the new name for the execution environment type with id = “<type-id>”.

A possible response is:

HTTP/1.1 200 OK
Content-Type: application/json

[
    {
        "status": "OK",
        "code": 200,
        "error": false,
        "message": "Execution environment type with id=<exec-env-id> correctly updated"
    }
]

Instead, if the are not changes the response is:

HTTP/1.1 304 Not Modified
Content-Type: application/json

[
    {
        "status": "Not Modified",
        "code": 304,
        "error": false,
        "message": "Update for execution environment type with id=<exec-env-id> not necessary"
    }
]

Delete

To delete an execution environment type, use:

DELETE /type/exec-env/(string: id)
DELETE /type/exec-env HTTP/1.1
Host: cb-manager.example.com
Content-Type: application/json

{
    "where": {
        "equals": {
            "target": "id",
            "expr": "<exec-env-type-id>"
        }
    }
}
Parameters
  • id – optional execution environment type id.

Request Headers
Response Headers
Status Codes

This request removes the execution environment type with id = “<exec-env-id>”.

This is a possible response:

HTTP/1.1 205 Reset Content
Content-Type: application/json

[
    {
        "status": "Reset Content",
        "code": 200,
        "error": false,
        "message": "Execution environment type with id=<exec-env-type-id> correctly deleted"
    }
]

Caution

Without request body, it removes all the execution environment types.

Loaded data

This data is already available:

GET /type/exec-env
HTTP/1.1 200 OK
Content-Type: application/json

[
    {
        "id": "vm",
        "name": "Virtual Machine",
        "description": "The service is deployed in a virtual machine."
    },
    {
        "id": "container",
        "name": "Container",
        "description": "The service is deployed in a container."
    },
    {
        "id": "host",
        "name": "Host",
        "description": "The service is deployed in a physical machine."
    }
]