Update docs for new api endpoints

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2015-12-04 14:44:08 -08:00
parent 72ee22ad60
commit 8af8c56510
4 changed files with 175 additions and 48 deletions

View file

@ -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,
}

View file

@ -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{

View file

@ -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 {