Incus network-address-sets API

The network-address-sets API from Incus — 3 operation(s) for network-address-sets.

OpenAPI Specification

incus-network-address-sets-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-address-sets API
  version: '1.0'
tags:
- name: network-address-sets
paths:
  /1.0/network-address-sets:
    get:
      description: Returns a list of network address sets (URLs).
      operationId: network_address_sets_get
      parameters:
      - description: Project name
        example: default
        in: query
        name: project
        type: string
      - description: Retrieve network address sets from all projects
        example: true
        in: query
        name: all-projects
        type: boolean
      - description: Collection filter
        example: default
        in: query
        name: filter
        type: string
      produces:
      - application/json
      responses:
        '200':
          description: API endpoints
          schema:
            description: Sync response
            properties:
              metadata:
                description: List of endpoints
                example: "[\n  \"/1.0/network-address-sets/foo\",\n  \"/1.0/network-address-sets/bar\"\n]"
                items:
                  type: string
                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 address sets
      tags:
      - network-address-sets
    post:
      consumes:
      - application/json
      description: Creates a new network address set.
      operationId: network_address_sets_post
      parameters:
      - description: Project name
        example: default
        in: query
        name: project
        type: string
      - description: address set
        in: body
        name: address set
        required: true
        schema:
          $ref: '#/definitions/NetworkAddressSetsPost'
      produces:
      - application/json
      responses:
        '200':
          $ref: '#/responses/EmptySyncResponse'
        '400':
          $ref: '#/responses/BadRequest'
        '403':
          $ref: '#/responses/Forbidden'
        '500':
          $ref: '#/responses/InternalServerError'
      summary: Add a network address set
      tags:
      - network-address-sets
  /1.0/network-address-sets/{name}:
    delete:
      description: Removes the network address set.
      operationId: network_address_set_delete
      parameters:
      - description: Address set name
        in: path
        name: name
        required: true
        type: string
      - description: Project name
        example: default
        in: query
        name: project
        type: string
      produces:
      - application/json
      responses:
        '200':
          $ref: '#/responses/EmptySyncResponse'
        '400':
          $ref: '#/responses/BadRequest'
        '403':
          $ref: '#/responses/Forbidden'
        '500':
          $ref: '#/responses/InternalServerError'
      summary: Delete the network address set
      tags:
      - network-address-sets
    get:
      description: Gets a specific network address set.
      operationId: network_address_set_get
      parameters:
      - description: Address set name
        in: path
        name: name
        required: true
        type: string
      - description: Project name
        example: default
        in: query
        name: project
        type: string
      produces:
      - application/json
      responses:
        '200':
          description: address set
          schema:
            description: Sync response
            properties:
              metadata:
                $ref: '#/definitions/NetworkAddressSet'
              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 address set
      tags:
      - network-address-sets
    patch:
      consumes:
      - application/json
      description: Updates a subset of the network address set configuration.
      operationId: network_address_set_patch
      parameters:
      - description: Address set name
        in: path
        name: name
        required: true
        type: string
      - description: Project name
        example: default
        in: query
        name: project
        type: string
      - description: Address set configuration
        in: body
        name: address set
        required: true
        schema:
          $ref: '#/definitions/NetworkAddressSetPut'
      produces:
      - application/json
      responses:
        '200':
          $ref: '#/responses/EmptySyncResponse'
        '400':
          $ref: '#/responses/BadRequest'
        '403':
          $ref: '#/responses/Forbidden'
        '412':
          $ref: '#/responses/PreconditionFailed'
        '500':
          $ref: '#/responses/InternalServerError'
      summary: Partially update the network address set
      tags:
      - network-address-sets
    post:
      consumes:
      - application/json
      description: Renames an existing network address set.
      operationId: network_address_set_post
      parameters:
      - description: Address set name
        in: path
        name: name
        required: true
        type: string
      - description: Project name
        example: default
        in: query
        name: project
        type: string
      - description: Address set rename request
        in: body
        name: address set
        required: true
        schema:
          $ref: '#/definitions/NetworkAddressSetPost'
      produces:
      - application/json
      responses:
        '200':
          $ref: '#/responses/EmptySyncResponse'
        '400':
          $ref: '#/responses/BadRequest'
        '403':
          $ref: '#/responses/Forbidden'
        '500':
          $ref: '#/responses/InternalServerError'
      summary: Rename the network address set
      tags:
      - network-address-sets
    put:
      consumes:
      - application/json
      description: Updates the entire network address set configuration.
      operationId: network_address_set_put
      parameters:
      - description: Address set name
        in: path
        name: name
        required: true
        type: string
      - description: Project name
        example: default
        in: query
        name: project
        type: string
      - description: Address set configuration
        in: body
        name: address set
        required: true
        schema:
          $ref: '#/definitions/NetworkAddressSetPut'
      produces:
      - application/json
      responses:
        '200':
          $ref: '#/responses/EmptySyncResponse'
        '400':
          $ref: '#/responses/BadRequest'
        '403':
          $ref: '#/responses/Forbidden'
        '412':
          $ref: '#/responses/PreconditionFailed'
        '500':
          $ref: '#/responses/InternalServerError'
      summary: Update the network address set
      tags:
      - network-address-sets
  /1.0/network-address-sets?recursion=1:
    get:
      description: Returns a list of network address sets (structs).
      operationId: network_address_sets_get_recursion1
      parameters:
      - description: Project name
        example: default
        in: query
        name: project
        type: string
      - description: Retrieve network address sets from all projects
        example: true
        in: query
        name: all-projects
        type: boolean
      - description: Collection filter
        example: default
        in: query
        name: filter
        type: string
      produces:
      - application/json
      responses:
        '200':
          description: API endpoints
          schema:
            description: Sync response
            properties:
              metadata:
                description: List of network address sets
                items:
                  $ref: '#/definitions/NetworkAddressSet'
                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 address sets
      tags:
      - network-address-sets
definitions:
  NetworkAddressSetsPost:
    properties:
      addresses:
        description: List of addresses in the set
        example:
        - 192.0.0.1
        - 2001:0db8:1234::1
        items:
          type: string
        type: array
        x-go-name: Addresses
      config:
        description: Address set configuration map (refer to doc/network-address-sets.md)
        example:
          user.mykey: foo
        type: object
        x-go-name: Config
      description:
        description: Description of the address set
        example: Web servers
        type: string
        x-go-name: Description
      name:
        description: The new name of the address set
        example: '"bar"'
        type: string
        x-go-name: Name
    title: NetworkAddressSetsPost used for creating a new address set.
    type: object
    x-go-package: github.com/lxc/incus/v7/shared/api
  NetworkAddressSetPost:
    properties:
      name:
        description: The new name of the address set
        example: '"bar"'
        type: string
        x-go-name: Name
    title: NetworkAddressSetPost used for renaming an address set.
    type: object
    x-go-package: github.com/lxc/incus/v7/shared/api
  NetworkAddressSetPut:
    properties:
      addresses:
        description: List of addresses in the set
        example:
        - 192.0.0.1
        - 2001:0db8:1234::1
        items:
          type: string
        type: array
        x-go-name: Addresses
      config:
        description: Address set configuration map (refer to doc/network-address-sets.md)
        example:
          user.mykey: foo
        type: object
        x-go-name: Config
      description:
        description: Description of the address set
        example: Web servers
        type: string
        x-go-name: Description
    title: NetworkAddressSetPut used for updating an address set.
    type: object
    x-go-package: github.com/lxc/incus/v7/shared/api
  NetworkAddressSet:
    description: Refer to doc/howto/network_address_sets.md for details.
    properties:
      addresses:
        description: List of addresses in the set
        example:
        - 192.0.0.1
        - 2001:0db8:1234::1
        items:
          type: string
        type: array
        x-go-name: Addresses
      config:
        description: Address set configuration map (refer to doc/network-address-sets.md)
        example:
          user.mykey: foo
        type: object
        x-go-name: Config
      description:
        description: Description of the address set
        example: Web servers
        type: string
        x-go-name: Description
      name:
        description: The new name of the address set
        example: '"bar"'
        type: string
        x-go-name: Name
      project:
        description: Project name
        example: project1
        type: string
        x-go-name: Project
      used_by:
        description: List of URLs of objects using this profile
        example:
        - /1.0/network-acls/foo
        - /1.0/network-acls/bar
        - /1.0/network-acls/baz
        items:
          type: string
        readOnly: true
        type: array
        x-go-name: UsedBy
    title: NetworkAddressSet represents an address set.
    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
  BadRequest:
    description: Bad Request
    schema:
      properties:
        error:
          example: bad request
          type: string
          x-go-name: Error
        error_code:
          example: 400
          format: int64
          type: integer
          x-go-name: ErrorCode
        type:
          example: error
          type: string
          x-go-name: Type
      type: object
  EmptySyncResponse:
    description: Empty sync response
    schema:
      properties:
        status:
          example: Success
          type: string
          x-go-name: Status
        status_code:
          example: 200
          format: int64
          type: integer
          x-go-name: StatusCode
        type:
          example: sync
          type: string
          x-go-name: Type
      type: object
  PreconditionFailed:
    description: Precondition Failed
    schema:
      properties:
        error:
          example: precondition failed
          type: string
          x-go-name: Error
        error_code:
          example: 412
          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