Configure a network interface
POST/api/node/:hostname/interface/:name
Writes a netplan file of the interface's own, such as /etc/netplan/osapi-osapi0.yaml for osapi0, under a netplan definition that is the interface's own, and applies it. type is ethernet, the default, or dummy. An ethernet is an interface the host has, in the netplan section that netplan status gives for it: one the host does not have is not found. A dummy goes under dummy-devices, and netplan apply makes it, so the host need not have it. dummy-devices needs netplan 0.107 or later. dhcp4 and dhcp6 are false unless given, so the interface has only the addresses given. An interface that a match defines, such as cloud-init's all for en*, is refused, because the config would change each interface the match takes, now and later. An interface osapi already configures does not change: update replaces its config. It runs on the Debian family, and elsewhere, and in a container, reports skipped.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 409
- 500
Each target host's result, with whether it changed.
The request is not valid, or the host refuses the input, such as a path that is a directory.
Unauthorized - API key required
Forbidden - Insufficient permissions
The host has no interface with that name.
osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs.
An error on the controller.