systemd Links API

The Links API from systemd — 7 operation(s) for links.

Documentation

Specifications

Other Resources

OpenAPI Specification

systemd-links-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: systemd-hostnamed (org.freedesktop.hostname1) Boot Links API
  version: '1.0'
  summary: D-Bus API of systemd-hostnamed modeled as REST operations.
  description: 'Documentation/contract artifact for the `org.freedesktop.hostname1` D-Bus interface on the

    system bus. Manages the system hostname (static, transient, pretty), chassis type, deployment,

    location, icon name, and other machine info.

    '
  license:
    name: LGPL-2.1-or-later
    url: https://github.com/systemd/systemd/blob/main/LICENSES/LGPL-2.1-or-later.txt
servers:
- url: dbus://system/org.freedesktop.hostname1
tags:
- name: Links
paths:
  /links:
    get:
      tags:
      - Links
      operationId: ListLinks
      summary: List All Network Links
      description: Mirrors `ListLinks()`. Returns (ifindex, ifname, object path) tuples.
      responses:
        '200':
          description: Array of links.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Link'
  /links/{ifindex}:
    parameters:
    - name: ifindex
      in: path
      required: true
      schema:
        type: integer
    get:
      tags:
      - Links
      operationId: GetLinkByIndex
      summary: Get A Link By ifindex
      description: Mirrors `GetLinkByIndex(ifindex)`.
      responses:
        '200':
          description: Link object path.
          content:
            application/json:
              schema:
                type: object
                properties:
                  path:
                    type: string
  /links/by-name/{name}:
    parameters:
    - name: name
      in: path
      required: true
      schema:
        type: string
    get:
      tags:
      - Links
      operationId: GetLinkByName
      summary: Get A Link By Name
      description: Mirrors `GetLinkByName(name)`.
      responses:
        '200':
          description: Link object path.
  /links/{ifindex}/reconfigure:
    parameters:
    - name: ifindex
      in: path
      required: true
      schema:
        type: integer
    post:
      tags:
      - Links
      operationId: ReconfigureLink
      summary: Reconfigure A Link
      description: Mirrors `ReconfigureLink(ifindex)` — re-applies the matching .network file.
      responses:
        '204':
          description: Reconfigured.
  /links/{ifindex}/renew:
    parameters:
    - name: ifindex
      in: path
      required: true
      schema:
        type: integer
    post:
      tags:
      - Links
      operationId: RenewLink
      summary: Force DHCP Renew
      description: Mirrors `RenewLink(ifindex)`.
      responses:
        '204':
          description: Renewal triggered.
  /links/{ifindex}/dns:
    parameters:
    - name: ifindex
      in: path
      required: true
      schema:
        type: integer
    put:
      tags:
      - Links
      operationId: SetLinkDNS
      summary: Set DNS Servers For A Link
      description: Mirrors `SetLinkDNS(ifindex, dns)`.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                servers:
                  type: array
                  items:
                    type: string
      responses:
        '204':
          description: Updated.
  /links/{ifindex}/domains:
    parameters:
    - name: ifindex
      in: path
      required: true
      schema:
        type: integer
    put:
      tags:
      - Links
      operationId: SetLinkDomains
      summary: Set Search Domains For A Link
      description: Mirrors `SetLinkDomains(ifindex, domains)`.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                domains:
                  type: array
                  items:
                    type: object
                    properties:
                      domain:
                        type: string
                      search_only:
                        type: boolean
      responses:
        '204':
          description: Updated.
components:
  schemas:
    Link:
      type: object
      properties:
        ifindex:
          type: integer
        name:
          type: string
        object_path:
          type: string