~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/github.com/lxc/lxd/lxd/container_get.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package main
 
2
 
 
3
import (
 
4
        "net/http"
 
5
 
 
6
        "github.com/gorilla/mux"
 
7
)
 
8
 
 
9
func containerGet(d *Daemon, r *http.Request) Response {
 
10
        name := mux.Vars(r)["name"]
 
11
        c, err := containerLoadByName(d, name)
 
12
        if err != nil {
 
13
                return SmartError(err)
 
14
        }
 
15
 
 
16
        state, err := c.Render()
 
17
        if err != nil {
 
18
                return InternalError(err)
 
19
        }
 
20
 
 
21
        return SyncResponse(true, state)
 
22
}