github.com/jandre/docker@v1.7.0/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 `json:",omitempty"`
    98  	PrivatePort int
    99  	PublicPort  int `json:",omitempty"`
   100  	Type        string
   101  }
   102  
   103  type Container struct {
   104  	ID         string `json:"Id"`
   105  	Names      []string
   106  	Image      string
   107  	Command    string
   108  	Created    int
   109  	Ports      []Port
   110  	SizeRw     int `json:",omitempty"`
   111  	SizeRootFs int `json:",omitempty"`
   112  	Labels     map[string]string
   113  	Status     string
   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  	Experimental  bool   `json:",omitempty"`
   136  }
   137  
   138  // GET "/info"
   139  type Info struct {
   140  	ID                 string
   141  	Containers         int
   142  	Images             int
   143  	Driver             string
   144  	DriverStatus       [][2]string
   145  	MemoryLimit        bool
   146  	SwapLimit          bool
   147  	CpuCfsPeriod       bool
   148  	CpuCfsQuota        bool
   149  	IPv4Forwarding     bool
   150  	Debug              bool
   151  	NFd                int
   152  	OomKillDisable     bool
   153  	NGoroutines        int
   154  	SystemTime         string
   155  	ExecutionDriver    string
   156  	LoggingDriver      string
   157  	NEventsListener    int
   158  	KernelVersion      string
   159  	OperatingSystem    string
   160  	IndexServerAddress string
   161  	RegistryConfig     interface{}
   162  	InitSha1           string
   163  	InitPath           string
   164  	NCPU               int
   165  	MemTotal           int64
   166  	DockerRootDir      string
   167  	HttpProxy          string
   168  	HttpsProxy         string
   169  	NoProxy            string
   170  	Name               string
   171  	Labels             []string
   172  	ExperimentalBuild  bool
   173  }
   174  
   175  // This struct is a temp struct used by execStart
   176  // Config fields is part of ExecConfig in runconfig package
   177  type ExecStartCheck struct {
   178  	// ExecStart will first check if it's detached
   179  	Detach bool
   180  	// Check if there's a tty
   181  	Tty bool
   182  }
   183  
   184  type ContainerState struct {
   185  	Running    bool
   186  	Paused     bool
   187  	Restarting bool
   188  	OOMKilled  bool
   189  	Dead       bool
   190  	Pid        int
   191  	ExitCode   int
   192  	Error      string
   193  	StartedAt  time.Time
   194  	FinishedAt time.Time
   195  }
   196  
   197  // GET "/containers/{name:.*}/json"
   198  type ContainerJSONBase struct {
   199  	Id              string
   200  	Created         time.Time
   201  	Path            string
   202  	Args            []string
   203  	State           *ContainerState
   204  	Image           string
   205  	NetworkSettings *network.Settings
   206  	ResolvConfPath  string
   207  	HostnamePath    string
   208  	HostsPath       string
   209  	LogPath         string
   210  	Name            string
   211  	RestartCount    int
   212  	Driver          string
   213  	ExecDriver      string
   214  	MountLabel      string
   215  	ProcessLabel    string
   216  	Volumes         map[string]string
   217  	VolumesRW       map[string]bool
   218  	AppArmorProfile string
   219  	ExecIDs         []string
   220  	HostConfig      *runconfig.HostConfig
   221  }
   222  
   223  type ContainerJSON struct {
   224  	*ContainerJSONBase
   225  	Config *runconfig.Config
   226  }
   227  
   228  // backcompatibility struct along with ContainerConfig
   229  type ContainerJSONRaw struct {
   230  	*ContainerJSONBase
   231  	Config *ContainerConfig
   232  }
   233  
   234  type ContainerConfig struct {
   235  	*runconfig.Config
   236  
   237  	// backward compatibility, they now live in HostConfig
   238  	Memory     int64
   239  	MemorySwap int64
   240  	CpuShares  int64
   241  	Cpuset     string
   242  }