This API enables the user to toggle a port of a switch. The endpoint is /switch/{id}/port and the post body contains
type SwitchPortToggleRequest struct {
NicName string `json:"nic" description:"the nic of the switch you want to change"`
Status SwitchPortStatus `json:"status" description:"sets the port status" enum:"UP|DOWN"`
}
When this endpoint is invoked, the system stores the status as the new desired state (if it differs from the current state). The switch uses metal-core to regularly fetch the switch state. If it finds a desired state which differs from the current state, it will change the switch configuration to reflect this state and send a notification to /switch/{id}/notify and report the new state. If the new state is equal to the desired state, metal-api will store this new state and remove the desired state from the persistence layer.
This API enables the user to toggle a port of a switch. The endpoint is
/switch/{id}/port
and the post body containsWhen this endpoint is invoked, the system stores the
status
as the new desired state (if it differs from the current state). The switch uses metal-core to regularly fetch the switch state. If it finds a desired state which differs from the current state, it will change the switch configuration to reflect this state and send a notification to/switch/{id}/notify
and report the new state. If the new state is equal to the desired state, metal-api will store this new state and remove the desired state from the persistence layer.Dependencies: