Network

Host network interfaces.

2 endpoints · Plakar Control Plane v0.18 · Base URL, authentication and errors

List the network interfaces

GET /api/v1/network/interfaces
Badge

Response 200 OK application/json

  • interfaces array[object]
    • addresses array[string]
    • mac string
    • mtu integer
    • name string
    • oper_state string
    • up boolean

Errors

  • 400 Bad Request (validation or deserialization error)
  • 401 Missing, invalid or expired credentials
  • 403 The caller may not do this
  • 500 Internal Server Error (panics)

Every error returns the standard error body.

Request

curl 'https://pcp.example.com/api/v1/network/interfaces' \
  -H 'Authorization: Bearer <badge>'

Response 200

{
  "interfaces": [
    {
      "addresses": [
        "string"
      ],
      "mac": "string",
      "mtu": 0,
      "name": "string",
      "oper_state": "string",
      "up": true
    }
  ]
}

Configure a network interface

POST /api/v1/network/interfaces
Badge

Request body application/json required

  • interface string required
  • mtu integer

Response 200 OK application/json

  • addresses array[string]
  • mac string
  • mtu integer
  • name string
  • oper_state string
  • up boolean

Errors

  • 400 Bad Request (validation or deserialization error)
  • 401 Missing, invalid or expired credentials
  • 403 The caller may not do this
  • 500 Internal Server Error (panics)

Every error returns the standard error body.

Request

curl -X POST 'https://pcp.example.com/api/v1/network/interfaces' \
  -H 'Authorization: Bearer <badge>' \
  -H 'Content-Type: application/json' \
  -d '{
  "interface": "string",
  "mtu": 0
}'

Response 200

{
  "addresses": [
    "string"
  ],
  "mac": "string",
  "mtu": 0,
  "name": "string",
  "oper_state": "string",
  "up": true
}