X Tutup
Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import java.util.List;
import java.util.Map;

import javax.annotation.CheckForNull;

import org.apache.commons.lang.builder.ToStringBuilder;

import com.fasterxml.jackson.annotation.JsonIgnore;
Expand Down Expand Up @@ -225,44 +227,90 @@ public String toString() {
@JsonIgnoreProperties(ignoreUnknown = true)
public class ContainerState {

@JsonProperty("Status")
private String status;

@JsonProperty("Running")
private Boolean running;

@JsonProperty("Paused")
private Boolean paused;

@JsonProperty("Restarting")
private Boolean restarting;

@JsonProperty("OOMKilled")
private Boolean oomKilled;

@JsonProperty("Dead")
private Boolean dead;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't found in 1.17..1.21 please point on API documentation

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see:
https://docs.docker.com/v1.8/reference/api/docker_remote_api_v1.17/
"State": { "Error": "", * "ExitCode": 9, "FinishedAt":
"2015-01-06T15:47:32.080254511Z", *"OOMKilled": false
, * "Paused": false,
"Pid": 0, *"Restarting": false
*, * "Running": false, "StartedAt":
"2015-01-06T15:47:32.072697474Z" },

Also, while the docker document does not have it, I see some additional
properties in the latest 1.21 (Docker 1.9 API). I can remove them if you
strictly want to go by the documentation but usually docker documentation
is always behind..

"State": {
  •    "Status": "exited",*
    
    "Running": false,
    
    "Paused": false,
    
    "Restarting": false,
    
    "OOMKilled": false,
    
  •    "Dead": false,*
    
    "Pid": 0,
    
    "ExitCode": 0,
    
    "Error": "",
    
    "StartedAt": "2015-11-20T19:02:48.972024978Z",
    
    "FinishedAt": "2015-11-20T19:02:48.998958231Z"
    

    }

On Fri, Nov 20, 2015 at 10:54 AM, Kanstantsin Shautsou <
notifications@github.com> wrote:

In
src/main/java/com/github/dockerjava/api/command/InspectContainerResponse.java
#372 (comment)
:

     @JsonProperty("Running")
     private Boolean running;

     @JsonProperty("Paused")
     private Boolean paused;
  •    @JsonProperty("Restarting")
    
  •    private Boolean restarting;
    
  •    @JsonProperty("OOMKilled")
    
  •    private Boolean oomKilled;
    
  •    @JsonProperty("Dead")
    
  •    private Boolean dead;
    

Didn't found in 1.17..1.21 please point on API documentation


Reply to this email directly or view it on GitHub
https://github.com/docker-java/docker-java/pull/372/files#r45503748.

Ritesh
Founder @ Nirmata http://nirmata.com/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upstream merged


@JsonProperty("Pid")
private Integer pid;

@JsonProperty("ExitCode")
private Integer exitCode;

@JsonProperty("Error")
private String error;

@JsonProperty("StartedAt")
private String startedAt;

@JsonProperty("FinishedAt")
private String finishedAt;

@CheckForNull
public String getStatus() {
return status;
}

@CheckForNull
public Boolean isRunning() {
return running;
}

@CheckForNull
public Boolean isPaused() {
return paused;
}

@CheckForNull
public Boolean isRestarting() {
return restarting;
}

@CheckForNull
public Boolean isOOMKilled() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boolean shouldn't be used with isXX() as it not a primitive, use getXX()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just trying to be consistent with the existing methods isRunning & isPaused.

return oomKilled;
}

@CheckForNull
public Boolean isDead() {
return dead;
}

@CheckForNull
public Integer getPid() {
return pid;
}

@CheckForNull
public Integer getExitCode() {
return exitCode;
}

@CheckForNull
public String getError() {
return error;
}

@CheckForNull
public String getStartedAt() {
return startedAt;
}

@CheckForNull
public String getFinishedAt() {
return finishedAt;
}
Expand Down
X Tutup