github.com/squaremo/docker@v1.3.2-0.20150516120342-42cfc9554972/api/types/types.go (about)

     1  package types
     2  
     3  import (
     4  	"time"
     5  
     6  	"github.com/docker/docker/daemon/network"
     7  	"github.com/docker/docker/pkg/version"
     8  	"github.com/docker/docker/runconfig"
     9  )
    10  
    11  // ContainerCreateResponse contains the information returned to a client on the
    12  // creation of a new container.
    13  type ContainerCreateResponse struct {
    14  	// ID is the ID of the created container.
    15  	ID string `json:"Id"`
    16  
    17  	// Warnings are any warnings encountered during the creation of the container.
    18  	Warnings []string `json:"Warnings"`
    19  }
    20  
    21  // POST /containers/{name:.*}/exec
    22  type ContainerExecCreateResponse struct {
    23  	// ID is the exec ID.
    24  	ID string `json:"Id"`
    25  }
    26  
    27  // POST /auth
    28  type AuthResponse struct {
    29  	// Status is the authentication status
    30  	Status string `json:"Status"`
    31  }
    32  
    33  // POST "/containers/"+containerID+"/wait"
    34  type ContainerWaitResponse struct {
    35  	// StatusCode is the status code of the wait job
    36  	StatusCode int `json:"StatusCode"`
    37  }
    38  
    39  // POST "/commit?container="+containerID
    40  type ContainerCommitResponse struct {
    41  	ID string `json:"Id"`
    42  }
    43  
    44  // GET "/containers/{name:.*}/changes"
    45  type ContainerChange struct {
    46  	Kind int
    47  	Path string
    48  }
    49  
    50  // GET "/images/{name:.*}/history"
    51  type ImageHistory struct {
    52  	ID        string `json:"Id"`
    53  	Created   int64
    54  	CreatedBy string
    55  	Tags      []string
    56  	Size      int64
    57  	Comment   string
    58  }
    59  
    60  // DELETE "/images/{name:.*}"
    61  type ImageDelete struct {
    62  	Untagged string `json:",omitempty"`
    63  	Deleted  string `json:",omitempty"`
    64  }
    65  
    66  // GET "/images/json"
    67  type Image struct {
    68  	ID          string `json:"Id"`
    69  	ParentId    string
    70  	RepoTags    []string
    71  	RepoDigests []string
    72  	Created     int
    73  	Size        int
    74  	VirtualSize int
    75  	Labels      map[string]string
    76  }
    77  
    78  // GET "/images/{name:.*}/json"
    79  type ImageInspect struct {
    80  	Id              string
    81  	Parent          string
    82  	Comment         string
    83  	Created         time.Time
    84  	Container       string
    85  	ContainerConfig *runconfig.Config
    86  	DockerVersion   string
    87  	Author          string
    88  	Config          *runconfig.Config
    89  	Architecture    string
    90  	Os              string
    91  	Size            int64
    92  	VirtualSize     int64
    93  }
    94  
    95  // GET  "/containers/json"
    96  type Port struct {
    97  	IP          string
    98  	PrivatePort int
    99  	PublicPort  int
   100  	Type        string
   101  }
   102  
   103  type Container struct {
   104  	ID         string            `json:"Id"`
   105  	Names      []string          `json:",omitempty"`
   106  	Image      string            `json:",omitempty"`
   107  	Command    string            `json:",omitempty"`
   108  	Created    int               `json:",omitempty"`
   109  	Ports      []Port            `json:",omitempty"`
   110  	SizeRw     int               `json:",omitempty"`
   111  	SizeRootFs int               `json:",omitempty"`
   112  	Labels     map[string]string `json:",omitempty"`
   113  	Status     string            `json:",omitempty"`
   114  }
   115  
   116  // POST "/containers/"+containerID+"/copy"
   117  type CopyConfig struct {
   118  	Resource string
   119  }
   120  
   121  // GET "/containers/{name:.*}/top"
   122  type ContainerProcessList struct {
   123  	Processes [][]string
   124  	Titles    []string
   125  }
   126  
   127  type Version struct {
   128  	Version       string
   129  	ApiVersion    version.Version
   130  	GitCommit     string
   131  	GoVersion     string
   132  	Os            string
   133  	Arch          string
   134  	KernelVersion string `json:",omitempty"`
   135  }
   136  
   137  // GET "/info"
   138  type Info struct {
   139  	ID                 string
   140  	Containers         int
   141  	Images             int
   142  	Driver             string
   143  	DriverStatus       [][2]string
   144  	MemoryLimit        bool
   145  	SwapLimit          bool
   146  	CpuCfsPeriod       bool
   147  	CpuCfsQuota        bool
   148  	IPv4Forwarding     bool
   149  	Debug              bool
   150  	NFd                int
   151  	OomKillDisable     bool
   152  	NGoroutines        int
   153  	SystemTime         string
   154  	ExecutionDriver    string
   155  	LoggingDriver      string
   156  	NEventsListener    int
   157  	KernelVersion      string
   158  	OperatingSystem    string
   159  	IndexServerAddress string
   160  	RegistryConfig     interface{}
   161  	InitSha1           string
   162  	InitPath           string
   163  	NCPU               int
   164  	MemTotal           int64
   165  	DockerRootDir      string
   166  	HttpProxy          string
   167  	HttpsProxy         string
   168  	NoProxy            string
   169  	Name               string
   170  	Labels             []string
   171  }
   172  
   173  // This struct is a temp struct used by execStart
   174  // Config fields is part of ExecConfig in runconfig package
   175  type ExecStartCheck struct {
   176  	// ExecStart will first check if it's detached
   177  	Detach bool
   178  	// Check if there's a tty
   179  	Tty bool
   180  }
   181  
   182  type ContainerState struct {
   183  	Running    bool
   184  	Paused     bool
   185  	Restarting bool
   186  	OOMKilled  bool
   187  	Dead       bool
   188  	Pid        int
   189  	ExitCode   int
   190  	Error      string
   191  	StartedAt  time.Time
   192  	FinishedAt time.Time
   193  }
   194  
   195  // GET "/containers/{name:.*}/json"
   196  type ContainerJSON struct {
   197  	Id              string
   198  	Created         time.Time
   199  	Path            string
   200  	Args            []string
   201  	Config          *runconfig.Config
   202  	State           *ContainerState
   203  	Image           string
   204  	NetworkSettings *network.Settings
   205  	ResolvConfPath  string
   206  	HostnamePath    string
   207  	HostsPath       string
   208  	LogPath         string
   209  	Name            string
   210  	RestartCount    int
   211  	Driver          string
   212  	ExecDriver      string
   213  	MountLabel      string
   214  	ProcessLabel    string
   215  	Volumes         map[string]string
   216  	VolumesRW       map[string]bool
   217  	AppArmorProfile string
   218  	ExecIDs         []string
   219  	HostConfig      *runconfig.HostConfig
   220  }