Skip to content

Create Image Remote API Response Inconsistencies #5722

@saden1

Description

@saden1
  1. The "/images/create" request is a POST request but nothing is actually being posted. Either change the query parameters into JSON post payload for or change the request type to a GET request.

  2. The first chunk of the response contains a status JSON data that ends with "\r\n" but subsequent chunks don't end with a new line character therefore making difficult to parse the response. Bellow is the raw response I am seeing:

    {"status":"Pulling repository base"}\r\n
    {"status":"Pulling image (ubuntu-quantl) from base","progressDetail":{},"id":"b750fe79269d"}{"status":"Pulling image (ubuntu-quantl) from base, endpoint: https://cdn-registry-1.docker.io/v1/","progressDetail":{},"id":"b750fe79269d"}{"status":"Pulling dependent layers","progressDetail":{},"id":"b750fe79269d"}{"status":"Download complete","progressDetail":{},"id":"27cf78414709"}{"status":"Download complete","progressDetail":{},"id":"b750fe79269d"}{"status":"Download complete","progressDetail":{},"id":"b750fe79269d"}
  3. The "/images/create" response property names don't conform to the general pascal casing used by Docker Remote API. Change response to conform to this casing:

    {"Status":"Pulling blah", "Error": "blah", "ProgressDetail": "blah" }
  4. The "/images/create" is a blocking operation that could take some time. Instead of blocking you should utilize command/query pattern for the request. The create image request should return a token/id for the request and allow the user to query the status of the request. Break the API down to:

    Request:  "/images/create"
    Response: "{"Status": "Creating Image ....", "Id": "abc", "Error": [true|false]}"
    
    Request: "/images/create/status?Id=abc
    Response: "[
      {"Status": "Creating Image ....", "Id": "abc", "Error": [true|false]}
    ]"
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/apiAPIexp/expertkind/enhancementEnhancements are not bugs or new features but can improve usability or performance.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions