api.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. package api
  2. import "net"
  3. const (
  4. // Version of the REST API, not implementation version.
  5. // See openapi.yaml for the definition.
  6. Version = "1.1.1"
  7. )
  8. // Info is the structure returned by `GET /info`
  9. type Info struct {
  10. APIVersion string `json:"apiVersion"` // REST API version
  11. Version string `json:"version"` // Implementation version
  12. StateDir string `json:"stateDir"`
  13. ChildPID int `json:"childPID"`
  14. NetworkDriver *NetworkDriverInfo `json:"networkDriver,omitempty"`
  15. PortDriver *PortDriverInfo `json:"portDriver,omitempty"`
  16. }
  17. // NetworkDriverInfo in Info
  18. type NetworkDriverInfo struct {
  19. Driver string `json:"driver"`
  20. DNS []net.IP `json:"dns,omitempty"`
  21. ChildIP net.IP `json:"childIP,omitempty"` // since API v1.1.1 (RootlessKit v0.14.1)
  22. DynamicChildIP bool `json:"dynamicChildIP,omitempty"` // since API v1.1.1
  23. }
  24. // PortDriverInfo in Info
  25. type PortDriverInfo struct {
  26. Driver string `json:"driver"`
  27. Protos []string `json:"protos"`
  28. DisallowLoopbackChildIP bool `json:"disallowLoopbackChildIP,omitempty"` // since API v1.1.1
  29. }