CB-Manager
latest
  • Installation
  • Configuration
  • Authentication
  • Running
  • Execution Environment
  • Execution Environment Type
  • Network Link
  • Network Link Type
    • Schema
    • Create
    • Read
    • Update
    • Delete
    • Loaded data
  • Connection
  • Data
  • Event
  • Agent Catalog
  • Agent Instance
  • eBPF Program Catalog
  • eBPF Program Instance
  • Algorithm Catalog
  • Algorithm Instance
  • Pipeline
  • Chain
  • Glossary
  • API
  • License
  • Contributing
  • Changelog
CB-Manager
  • Docs »
  • Network Link Type
  • Edit on GitHub

Network Link Type¶

Describes the type of the network link including additional info.

Each Network Link 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

pnt2pnt

name

String

True

False

False

Point to Point

description

String

False

False

False

Communications connection between two communication endpoints or nodes.

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 network link type use the following REST call:

POST /type/network-link/(string: id)¶

with the request body in JSON format:

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

{
    "id": "<type-id>",
    "description": "<human-readable-description>"
    "name": "<formal-name>"
}
Parameters
  • id – optional network link type id.

Request Headers
  • Authorization – JWT Authentication.

  • Content-Type – application/json

Response Headers
  • Content-Type – application/json

Status Codes
  • 201 Created – Network link types correctly created.

  • 204 No Content – No content to create network link types 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 link types based on the request.

  • 500 Internal Server Error – Server not available to satisfy the request.

Replace the data with the correct values, for example id with p2p.

Note

It is possible to add additional data specific for this network link 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": "Network link type with id=<network-link-type-id> correctly created"
    }
]

Otherwise, if, for example, a network link 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 network Link types:

GET /type/network-link/(string: id)¶

The response includes all the network link types created.

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

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

{
    "select": [ "type_id" ],
    "where": {
        "equals": {
            "target": "id",
            "expr": "<network-link-type-id>"
        }
    }
}
Parameters
  • id – optional network link type id.

Request Headers
  • Authorization – JWT Authentication.

  • Content-Type – application/json

Response Headers
  • Content-Type – application/json

Status Codes
  • 200 OK – List of network link types filtered by the query in the request body.

  • 400 Bad Request – Request not valid.

  • 401 Unauthorized – Authentication failed.

  • 404 Not Found – Network link types 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 link types with the request query.

  • 500 Internal Server Error – Server not available to satisfy the request.

In this way, it will be returned only the name of all the network link types with id = “<network-link-type-id>”.

Update¶

To update a network Link type, use:

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

{
    "id": "<network-link-type-id>",
    "name"":<new-formal-name>",
}
Parameters
  • id – optional network link type id.

Request Headers
  • Authorization – JWT Authentication.

  • Content-Type – application/json

Response Headers
  • Content-Type – application/json

Status Codes
  • 200 OK – All network link types correctly updated.

  • 204 No Content – No content to update network link types based on the request.

  • 304 Not Modified – Update for one or more network link types 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 link types based on the request.

  • 500 Internal Server Error – Server not available to satisfy the request.

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

A possible response is:

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

[
    {
        "status": "OK",
        "code": 200,
        "error": false,
        "message": "Network link type with  id=<network-link-type-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 type with id=<network-link-type-id> not necessary"
    }
]

Delete¶

To delete network link types, use:

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

{
    "where": {
        "equals": {
            "target": "id",
            "expr": "<network-link-type-id>"
        }
    }
}
Parameters
  • id – optional network link type id.

Request Headers
  • Authorization – JWT Authentication.

  • Content-Type – application/json

Response Headers
  • Content-Type – application/json

Status Codes
  • 205 Reset Content – All network link types correctly deleted.

  • 400 Bad Request – Request not valid.

  • 401 Unauthorized – Authentication failed.

  • 404 Not Found – Network link types 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 link types based on the request query.

  • 500 Internal Server Error – Server not available to satisfy the request.

This request removes the network link type with id = “<network-link-type-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-type-id> correctly deleted"
    }
]

Caution

Without request body, it removes all the network link types.

Loaded data¶

For the demo, this data is already available:

GET /type/network-link¶
HTTP/1.1 200 OK
Content-Type: application/json

[
    {
        "id": "p2p",
        "name": "Point to Point",
        "description": "Communications connection between two communication endpoints or nodes."
    },
    {
        "id": "slide",
        "name": "Slice",
        "description": """Separation of multiple virtual networks that operate on the same physical hardware
                          for different applications, services or purposes."""
    }
]
Next Previous

© Copyright 2020-2022 - GUARD Project <http://guard-project.eu> Revision 4a97ecb8.

Built with Sphinx using a theme provided by Read the Docs.
Read the Docs v: latest
Versions
latest
stable
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.