Update docs for new api endpoints
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
72ee22ad60
commit
8af8c56510
4 changed files with 175 additions and 48 deletions
|
@ -20,9 +20,10 @@ type Client struct {
|
|||
|
||||
// Start starts a container with the specified id and path to the container's
|
||||
// bundle on the system.
|
||||
func (c *Client) Start(id, path string) error {
|
||||
func (c *Client) Start(id, path, checkpoint string) error {
|
||||
container := Container{
|
||||
BundlePath: path,
|
||||
Checkpoint: checkpoint,
|
||||
}
|
||||
buf := bytes.NewBuffer(nil)
|
||||
if err := json.NewEncoder(buf).Encode(container); err != nil {
|
||||
|
@ -53,7 +54,7 @@ func (c *Client) Containers() ([]Container, error) {
|
|||
return s.Containers, nil
|
||||
}
|
||||
|
||||
func (c *Client) Signal(id string, pid, signal int) error {
|
||||
func (c *Client) SignalProcess(id string, pid, signal int) error {
|
||||
sig := Signal{
|
||||
Signal: signal,
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ func NewServer(supervisor *containerd.Supervisor) http.Handler {
|
|||
r.HandleFunc("/containers/{id:.*}", s.updateContainer).Methods("PATCH")
|
||||
|
||||
// internal method for replaying the journal
|
||||
r.HandleFunc("/event", s.event).Methods("POST")
|
||||
// r.HandleFunc("/event", s.event).Methods("POST")
|
||||
r.HandleFunc("/events", s.events).Methods("GET")
|
||||
|
||||
// containerd handlers
|
||||
|
@ -263,9 +263,9 @@ func (s *server) createContainer(w http.ResponseWriter, r *http.Request) {
|
|||
e := containerd.NewEvent(containerd.StartContainerEventType)
|
||||
e.ID = id
|
||||
e.BundlePath = c.BundlePath
|
||||
if c.Checkpoint != nil {
|
||||
if c.Checkpoint != "" {
|
||||
e.Checkpoint = &runtime.Checkpoint{
|
||||
Name: c.Checkpoint.Name,
|
||||
Name: c.Checkpoint,
|
||||
}
|
||||
}
|
||||
e.Stdio = &runtime.Stdio{
|
||||
|
|
|
@ -29,7 +29,7 @@ type Container struct {
|
|||
Stdout string `json:"stdout,omitempty"`
|
||||
Stderr string `json:"stderr,omitempty"`
|
||||
State *ContainerState `json:"state,omitempty"`
|
||||
Checkpoint *Checkpoint `json:"checkpoint,omitempty"`
|
||||
Checkpoint string `json:"checkpoint,omitempty"`
|
||||
}
|
||||
|
||||
type User struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue