Incus network-allocations API

The network-allocations API from Incus — 1 operation(s) for network-allocations.

OpenAPI Specification

incus-network-allocations-api-openapi.yml Raw ↑
swagger: '2.0'
info:
  contact:
    email: lxc-devel@lists.linuxcontainers.org
    name: Incus upstream
    url: https://github.com/lxc/incus
  description: 'This is the REST API used by all Incus clients.

    Internal endpoints aren''t included in this documentation.


    The Incus API is available over both a local unix+http and remote https API.

    Authentication for local users relies on group membership and access to the unix socket.

    For remote users, the default authentication method is TLS client

    certificates.'
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  title: Incus external REST certificates network-allocations API
  version: '1.0'
tags:
- name: network-allocations
paths:
  /1.0/network-allocations:
    get:
      description: Returns a list of network allocations.
      operationId: network_allocations_get
      parameters:
      - description: Project name
        example: default
        in: query
        name: project
        type: string
      - description: Retrieve entities from all projects
        in: query
        name: all-projects
        type: boolean
      produces:
      - application/json
      responses:
        '200':
          description: API endpoints
          schema:
            properties:
              metadata:
                description: List of network allocations used by a consuming entity
                items:
                  $ref: '#/definitions/NetworkAllocations'
                type: array
              status:
                description: Status description
                example: Success
                type: string
              status_code:
                description: Status code
                example: 200
                type: integer
              type:
                description: Response type
                example: sync
                type: string
            type: object
        '403':
          $ref: '#/responses/Forbidden'
        '500':
          $ref: '#/responses/InternalServerError'
      summary: Get the network allocations in use (`network`, `network-forward` and `load-balancer` and `instance`)
      tags:
      - network-allocations
definitions:
  NetworkAllocations:
    description: 'NetworkAllocations used for displaying network addresses used by a consuming entity

      e.g, instance, network forward, load-balancer, network...'
    properties:
      addresses:
        description: The network address of the allocation (in CIDR format)
        example: 192.0.2.1/24
        type: string
        x-go-name: Address
      hwaddr:
        description: Hwaddr is the MAC address of the entity consuming the network address
        type: string
        x-go-name: Hwaddr
      nat:
        description: Whether the entity comes from a network that performs egress source NAT
        type: boolean
        x-go-name: NAT
      type:
        description: Type of the entity consuming the network address
        type: string
        x-go-name: Type
      used_by:
        description: Name of the entity consuming the network address
        type: string
        x-go-name: UsedBy
    type: object
    x-go-package: github.com/lxc/incus/v7/shared/api
responses:
  Forbidden:
    description: Forbidden
    schema:
      properties:
        error:
          example: not authorized
          type: string
          x-go-name: Error
        error_code:
          example: 403
          format: int64
          type: integer
          x-go-name: ErrorCode
        type:
          example: error
          type: string
          x-go-name: Type
      type: object
  InternalServerError:
    description: Internal Server Error
    schema:
      properties:
        error:
          example: internal server error
          type: string
          x-go-name: Error
        error_code:
          example: 500
          format: int64
          type: integer
          x-go-name: ErrorCode
        type:
          example: error
          type: string
          x-go-name: Type
      type: object