Network Link¶
Represents a network link that connect two or more Execution Environment.
Schema¶
Field |
Type |
Required |
Readonly |
Auto Managed |
Example |
---|---|---|---|---|---|
|
String |
True |
True |
False |
eth0 |
|
String |
True |
False |
False |
pnt2pnt |
|
String |
False |
False |
False |
To connect HTTP and DB Servers. |
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.type_id
should be one of those stored in Network Link Type.
Create¶
To create a new network link use the following REST call:
-
POST
/network-link/
(string: id)¶ with the request body in JSON format:
POST /network-link HTTP/1.1 Host: cb-manager.example.com Content-Type: application/json { "id": "<network-link-id>", "type_id": "<network-link-type-id>", "description":"<human-readable-description>" }
- Parameters
id – optional network link id.
- Request Headers
Authorization – HTTP Basic Authentication with username and password.
Content-Type – application/json
- Response Headers
Content-Type – application/json
- Status Codes
201 Created – Network links correctly created.
204 No Content – No content to create network links based on the request.
400 Bad Request – Request not valid.
401 Unauthorized – Authentication failed.
406 Not Acceptable – Request validation failed.
415 Unsupported Media Type – Media type not supported.
422 Unprocessable Entity – Not possible to create ore or more network links based on the request.
500 Internal Server Error – Server not available to satisfy the request.
Replace the data with the correct values, for example
network-link-id
witheth0
.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": "Network link with id=<network-link-id> correctly created" } ]
Otherwise, if, for example, a network link 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
type_id
), the response could be:HTTP/1.1 406 Not Acceptable Content-Type: application/json [ { "status": "Not Acceptable", "code": 406, "error": true, "message": { "type_id": "required" } } ]
Read¶
To get the list of network links:
-
GET
/network-link/(string: id)
¶ The response includes all the network links created.
It is possible to filter the results using the following request body:
GET /network-link HTTP/1.1 Host: cb-manager.example.com Content-Type: application/json { "select": [ "type_id" ], "where": { "equals": { "target:" "id", "expr": "<network-link-id>" } } }
- Parameters
id – optional network link id.
- Request Headers
Authorization – HTTP Basic Authentication with username and password.
Content-Type – application/json
- Response Headers
Content-Type – application/json
- Status Codes
200 OK – List of network links filtered by the query in the request body.
400 Bad Request – Request not valid.
401 Unauthorized – Authentication failed.
404 Not Found – Network links based on the request query not found.
406 Not Acceptable – Request validation failed.
415 Unsupported Media Type – Media type not supported.
422 Unprocessable Entity – Not possible to get network links with the request query.
500 Internal Server Error – Server not available to satisfy the request.
In this way, it will be returned only the
type_id
of the network link withid
= “<network-link-id>”.
Update¶
To update a network link, use:
-
PUT
/network-link/
(string: id)¶ PUT /network-link HTTP/1.1 Host: cb-manager.example.com Content-Type: application/json { "id": "<network-link-id>", "type_id":"<new-network-link-type-id>", }
- Parameters
id – optional network link id.
- Request Headers
Authorization – HTTP Basic Authentication with username and password.
Content-Type – application/json
- Response Headers
Content-Type – application/json
- Status Codes
200 OK – All network links correctly updated.
204 No Content – No content to update network links based on the request.
304 Not Modified – Update for one or more network links not necessary.
400 Bad Request – Request not valid.
401 Unauthorized – Authentication failed.
406 Not Acceptable – Request validation failed.
415 Unsupported Media Type – Media type not supported.
422 Unprocessable Entity – Not possible to update one or more network links based on the request.
500 Internal Server Error – Server not available to satisfy the request.
This example set the new
type_id
for the network link withid
= “<network-link-id>”.Note
Allso during the update it is possible to add additional data for the specific network link.
A possible response is:
HTTP/1.1 200 OK Content-Type: application/json [ { "status": "OK", "code": 200, "error": false, "message": "Network link with id=<network-link-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 network link with id=<network-link-id> not necessary" } ]
Delete¶
To delete network links, use:
-
DELETE
/network-link/
(string: id)¶ DELETE /network-link HTTP/1.1 Host: cb-manager.example.com Content-Type: application/json { "where": { "equals": { "target:" "id", "expr": "<network-link-id>" } } }
- Parameters
id – optional network link id.
- Request Headers
Authorization – HTTP Basic Authentication with username and password.
Content-Type – application/json
- Response Headers
Content-Type – application/json
- Status Codes
205 Reset Content – All network links correctly deleted.
400 Bad Request – Request not valid.
401 Unauthorized – Authentication failed.
404 Not Found – Network links based on the request query not found.
406 Not Acceptable – Request validation failed.
415 Unsupported Media Type – Media type not supported.
422 Unprocessable Entity – Not possible to delete one or more network links based on the request query.
500 Internal Server Error – Server not available to satisfy the request.
This request removes the network link with
id
= “<network-link-id>”.This is a possible response:
HTTP/1.1 205 Reset Content Content-Type: application/json [ { "status": "Reset Content", "code": 200, "error": false, "message": "Network link with id=<network-link-id> correctly deleted" } ]
Caution
Without request body, it removes all the network links.