Skip to main content
Resource Center/Resource Pool/Image Operations
PUTImage OperationsSince 5.0.0SynchronousAuth Required

CalculateImageHash

CalculateImageHash

Execution Availability

Try It Out

Submit a mock request using the current auth context and example-driven inputs.

Path Parameters

Request Inputs

Path Parameters

  • uuidStringRequired

    The image UUID.

Body Fields

  • calculateimagehashObjectRequired

    calculateimagehash request body object.

    • backupStorageUuidStringRequired

      The backup storage uuid.

    • algorithmString

      Optional.

  • systemTagsList

    Optional. The system tags.

  • userTagsList

    Optional. The user tags.

Responses

200 OK

On success, this API returns the following response structure.

  • successbooleanRequired

    操作是否成功。

  • errorErrorCodeRequired

    The error code. If not null, the operation fails, or vice versa. For more information, see error.

    • codeStringRequired

      The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001.

    • descriptionStringRequired

      The brief description of the error.

    • detailsStringRequired

      The details about the error.

    • elaborationStringRequired

      The reserved field. Default value: null.

    • opaqueLinkedHashMapRequired

      The reserved field. Default value: null.

    • causeErrorCodeRequired

      The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null.

  • inventoryImageInventoryRequired

    See inventory.

    • uuidStringRequired

      The resource UUID.

    • nameStringRequired

      The resource name.

    • descriptionStringRequired

      The detailed description of the resource.

    • stateStringRequired

      The state of the image.

    • statusStringRequired

      The status of the image.

    • sizeLongRequired

      The image size.

    • actualSizeLongRequired

      The actual size of the image.

    • md5SumStringRequired

      The MD5 checksum of the image.

    • urlStringRequired

      The URL of the image.

    • mediaTypeStringRequired

      The image type.

    • guestOsTypeStringRequired

      The guest operating system type of the image.

    • typeStringRequired

      The reserved field.

    • platformStringRequired

      The system platform of the image.

    • architectureStringRequired

      The image architecture.

    • formatStringRequired

      The image format, for example, raw.

    • virtioBooleanRequired

      Whether the image is a system image.

    • systemBooleanRequired

      Whether virtio is supported or not.

    • createDateTimestampRequired

      The creation date.

    • lastOpDateTimestampRequired

      The last operation date.

    • backupStorageRefsListRequired

      See backupStorageRefs.

      • imageUuidStringRequired

        The image UUID.

      • backupStorageUuidStringRequired

        The backup storage UUID.

      • installPathStringRequired

        The installation path on the backup storage.

      • exportUrlStringRequired

        Exporting the url of the image.

      • exportMd5SumStringRequired

        Exporting the MD5 value of the image.

      • statusStringRequired

        The image ready status.

      • createDateTimestampRequired

        The creation date.

      • lastOpDateTimestampRequired

        The last operation date.

Endpoint

PUT/zstack/v1/images/{uuid}/actions

/zstack/v1/images/{uuid}/actions

Operation ID

CalculateImageHash

Permalink

Request Example

curl -X PUT 'http://{host}/zstack/v1/images/{uuid}/actions' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"calculateimagehash":{"backupStorageUuid":"<backupStorageUuid>","algorithm":"<algorithm>"},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

Response Example

200
{ "inventory": { "uuid": "368da584193638818c480bef63732659", "name": "TinyLinux", "md5Sum": "6fc2357e711877c14c09eec960e51aed", "url": "http://192.168.1.20/share/images/tinylinux.qcow2", "mediaType": "RootVolumeTemplate", "platform": "Linux", "format": "qcow2", "backupStorageRefs": [ { "id": 0, "imageUuid": "368da584193638818c480bef63732659", "backupStorageUuid": "17f9f8d310763247b5dc31779d880a41", "installPath": "ceph://zs-images/f0b149e053b34c7eb7fe694b182ebffd", "status": "Ready" } ] } }

Change History

This API has no change history records yet.

View all change history