• Image Management Service

ims
  1. Help Center
  2. Image Management Service
  3. Developer Guide
  4. Querying an Images List

Querying an Images List

Scenario

Images can be created using search criteria.

NOTE:
  • You can type question marks (?) and ampersands (&) at the end of the URI to define multiple search criteria. For details, see the example request.
  • The token obtained from IAM is valid for only 24 hours. If you want to use a token for authentication, you can cache it to avoid frequently calling the IAM API.

Involved APIs

If you use a token for authentication, you must obtain the token and add X-Auth-Token to the request header of the IMS API when making an API call.

  • IAM API used to obtain the token

    URI format: POST https://IAM endpoint/v3/auth/tokens

  • IMS API used to query the image list

    URI format: GET /v2/cloudimages

Procedure

  1. Obtain the token by referring to Token Authentication.
  2. Send GET https://IMS endpoint/v2/cloudimages.
  3. Add X-Auth-Token to the request header.
  4. Type question marks (?) and ampersands (&) at the end of the URI to define multiple search criteria, for example, https://IMS endpoint/v2/cloudimages?__imagetype=gold&sort_key=name&limit=1.
  5. Refer to "Querying Images" in the Image Management Service API Reference for parameter descriptions and response details.
  6. Refer to Status Code for details about the returned values if an abnormal value is returned.

Common Query Methods

  • Public images

    GET /v2/images?__imagetype=gold&visibility=public&protected=true

  • Private images

    GET /v2/images?owner={project_id}

  • Shared images

    GET /v2/images?member_status=accepted&visibility=shared&__imagetype=shared

  • Rejected images

    GET /v2/images?member_status=rejected&visibility=shared&__imagetype=shared

  • Unaccepted images

    GET /v2/images?member_status=pending&visibility=shared&__imagetype=shared