X Tutup
Skip to content

Add missing properties for Status in the Inspect response#372

Closed
patelrit wants to merge 3 commits intodocker-java:masterfrom
NirmataOSS:master
Closed

Add missing properties for Status in the Inspect response#372
patelrit wants to merge 3 commits intodocker-java:masterfrom
NirmataOSS:master

Conversation

@patelrit
Copy link
Copy Markdown
Contributor

InspectContainerResponse is missing some properties #371

@patelrit
Copy link
Copy Markdown
Contributor Author

Added missing Status properties

@patelrit
Copy link
Copy Markdown
Contributor Author

Any thoughts or comments on this pull request?

Most of these properties have been in the inspect response since api version 1.19

sudo docker version

Client version: 1.7.0

Client API version: 1.19

Go version (client): go1.4.2

Git commit (client): 0baf609

OS/Arch (client): linux/amd64

Server version: 1.7.0

Server API version: 1.19

Go version (server): go1.4.2

Git commit (server): 0baf609

OS/Arch (server): linux/amd64

ubuntu@ip-10-10-129-55:~$ sudo docker inspect d3377a2140e3

[

{

"Id": "d3377a2140e3150437ade73442633b5689b7aa922f6b953fb5e34013b8de4ea6",

"Created": "2015-11-18T16:41:19.618214342Z",

"Path": "catalina.sh",

"Args": [

    "run"

],

"State": {

    "Running": true,

    "Paused": false,

    "Restarting": false,

    "OOMKilled": false,

    "Dead": false,

    "Pid": 2188,

    "ExitCode": 0,

    "Error": "",

    "StartedAt": "2015-11-18T16:41:19.807255012Z",

@marcuslinke
Copy link
Copy Markdown
Contributor

@patelrit Thanks! Will try to merge it into 2.x branch ASAP.

@patelrit
Copy link
Copy Markdown
Contributor Author

Awesome! Thank you!

On Thu, Nov 19, 2015 at 11:39 PM, marcuslinke notifications@github.com
wrote:

@patelrit https://github.com/patelrit Thanks! Will try to merge it into
2.x branch ASAP.


Reply to this email directly or view it on GitHub
#372 (comment)
.

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

@KostyaSha
Copy link
Copy Markdown
Member

@patelrit Please put @CheckForNull everywhere

@KostyaSha
Copy link
Copy Markdown
Member

@marcuslinke should this be covered with tests? Seems on old daemon we should expecte null and on new valid data.

@marcuslinke
Copy link
Copy Markdown
Contributor

As we can't test against different docker host versions I think this is not needed. In general a test, if present, should test against the supported docker version of docker-java (as stated in the README)

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.

@KostyaSha
Copy link
Copy Markdown
Member

As we can't test against different docker host versions I think this is not needed

Bad...

@KostyaSha
Copy link
Copy Markdown
Member

I will handle this PR and sync into 2.3 and master.

@KostyaSha KostyaSha self-assigned this Nov 20, 2015
@marcuslinke
Copy link
Copy Markdown
Contributor

@KostyaSha 👍

@KostyaSha KostyaSha changed the title Add missing properties for Status in the Inspect response #371 Add missing properties for Status in the Inspect response Nov 20, 2015
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

@patelrit
Copy link
Copy Markdown
Contributor Author

@checkfornull everywhere

@KostyaSha
Copy link
Copy Markdown
Member

@patelrit please hold on, i already reworked all related changes.

@KostyaSha KostyaSha mentioned this pull request Nov 20, 2015
@KostyaSha
Copy link
Copy Markdown
Member

@patelrit #378 🏧 but i continue implementing tests.

@KostyaSha
Copy link
Copy Markdown
Member

I picked your change and modified in #378 closing this.

@KostyaSha KostyaSha closed this Nov 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

X Tutup