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 objects
Section titled “List objects”List every object without changing the node:
doas sylve objects listInside the interactive console, omit the leading sylve:
objects listAn installation with no objects returns:
No objects found.This is a successful empty result.
Filter the list when you only need one object type:
doas sylve objects list --type networkThe console uses a positional type:
objects list networkSupported types
Section titled “Supported types”| 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.
Create an object
Section titled “Create an object”Direct commands use a repeated --value option:
doas sylve objects create \ --name private-network \ --type network \ --value 10.20.0.0/24The console uses positional values:
objects create private-network network 10.20.0.0/24An 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.
Edit an object
Section titled “Edit an object”Patch only the fields that need to change:
doas sylve objects edit --id 4 --name guest-networkThe equivalent console command is:
objects edit 4 --name guest-networkWhen --value is supplied during an edit, the provided values replace the complete existing value set. They are not appended.
Delete an object
Section titled “Delete an object”Delete an unused object by ID:
doas sylve objects delete --id 4objects delete 4An object that is still referenced by another networking resource must be detached before it can be deleted.
Use JSON output
Section titled “Use JSON output”Use JSON for scripts or when you need the complete stored representation:
doas sylve objects list --jsonobjects list --jsonAn empty collection is returned as []. After creating an object, record its ID for use by a standard switch.