Skip to content

Objects

Network objects give names and types to reusable values. Standard switches can reference object IDs for their IPv4 and IPv6 networks and gateways, so objects are usually the best place to begin a networking configuration.

List every object without changing the node:

Terminal window
doas sylve objects list

Inside the interactive console, omit the leading sylve:

objects list

An installation with no objects returns:

No objects found.

This is a successful empty result.

A real Sylve 0.3.0 console session creating, listing, editing, and deleting a temporary network object.

Filter the list when you only need one object type:

Terminal window
doas sylve objects list --type network

The console uses a positional type:

objects list network
Type Intended value
host A host address
network A network range
port One or more network ports
country A country selection
list A reusable list of values
mac A MAC address
fqdn A fully qualified domain name
duid A DHCP Unique Identifier

Singular and plural names are accepted without regard to case. Sylve stores normalized type names such as Network, Port, and FQDN.

Direct commands use a repeated --value option:

Terminal window
doas sylve objects create \
--name private-network \
--type network \
--value 10.20.0.0/24

The console uses positional values:

objects create private-network network 10.20.0.0/24

An object must have a non-empty name, a supported type, and at least one value. Types such as lists and ports can contain multiple values.

Patch only the fields that need to change:

Terminal window
doas sylve objects edit --id 4 --name guest-network

The equivalent console command is:

objects edit 4 --name guest-network

When --value is supplied during an edit, the provided values replace the complete existing value set. They are not appended.

Delete an unused object by ID:

Terminal window
doas sylve objects delete --id 4
objects delete 4

An object that is still referenced by another networking resource must be detached before it can be deleted.

Use JSON for scripts or when you need the complete stored representation:

Terminal window
doas sylve objects list --json
objects list --json

An empty collection is returned as []. After creating an object, record its ID for use by a standard switch.