1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Hostname -> Name

Signed-off-by: Victor Vieux <vieux@docker.com>
This commit is contained in:
Victor Vieux 2014-11-17 21:54:11 +00:00
parent 6e92dfdfd8
commit 227f4bbdb3
5 changed files with 6 additions and 7 deletions

View file

@ -505,8 +505,8 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
if remoteInfo.Exists("MemTotal") { if remoteInfo.Exists("MemTotal") {
fmt.Fprintf(cli.out, "Total Memory: %s\n", units.BytesSize(float64(remoteInfo.GetInt64("MemTotal")))) fmt.Fprintf(cli.out, "Total Memory: %s\n", units.BytesSize(float64(remoteInfo.GetInt64("MemTotal"))))
} }
if remoteInfo.Exists("Hostname") { if remoteInfo.Exists("Name") {
fmt.Fprintf(cli.out, "Hostname: %s\n", remoteInfo.Get("Hostname")) fmt.Fprintf(cli.out, "Name: %s\n", remoteInfo.Get("Name"))
} }
if remoteInfo.Exists("ID") { if remoteInfo.Exists("ID") {
fmt.Fprintf(cli.out, "ID: %s\n", remoteInfo.Get("ID")) fmt.Fprintf(cli.out, "ID: %s\n", remoteInfo.Get("ID"))

View file

@ -77,7 +77,7 @@ func (daemon *Daemon) CmdInfo(job *engine.Job) engine.Status {
v.SetInt("NCPU", runtime.NumCPU()) v.SetInt("NCPU", runtime.NumCPU())
v.SetInt64("MemTotal", meminfo.MemTotal) v.SetInt64("MemTotal", meminfo.MemTotal)
if hostname, err := os.Hostname(); err == nil { if hostname, err := os.Hostname(); err == nil {
v.Set("Hostname", hostname) v.Set("Name", hostname)
} }
if _, err := v.WriteTo(job.Stdout); err != nil { if _, err := v.WriteTo(job.Stdout); err != nil {
return job.Error(err) return job.Error(err)

View file

@ -50,8 +50,7 @@ You can still call an old version of the API using
**New!** **New!**
`info` now returns the number of CPUs available on the machine (`NCPU`), `info` now returns the number of CPUs available on the machine (`NCPU`),
total memory available (`MemTotal`), the short hostname (`Hostname`). and total memory available (`MemTotal`), a name (`Name`), and the ID (`ID`).
the ID (`ID`).
`POST /containers/create` `POST /containers/create`

View file

@ -1220,7 +1220,7 @@ Display system-wide information
"KernelVersion":"3.12.0-1-amd64" "KernelVersion":"3.12.0-1-amd64"
"NCPU":1, "NCPU":1,
"MemTotal":2099236864, "MemTotal":2099236864,
"Hostname":"prod-server-42", "Name":"prod-server-42",
"ID":"7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS" "ID":"7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS"
"Debug":false, "Debug":false,
"NFd": 11, "NFd": 11,

View file

@ -856,7 +856,7 @@ For example:
Kernel Version: 3.13.0-24-generic Kernel Version: 3.13.0-24-generic
Operating System: Ubuntu 14.04 LTS Operating System: Ubuntu 14.04 LTS
CPUs: 1 CPUs: 1
Hostname: prod-server-42 Name: prod-server-42
ID: 7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS ID: 7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS
Total Memory: 2 GiB Total Memory: 2 GiB
Debug mode (server): false Debug mode (server): false