Getting Information About an OMI Export or Import Task

You can get information about the state and characteristics of one or more OMI exports or imports to a bucket.

These actions enable you to either copy an OMI to another account, or to create a backup of it stored in a bucket. For more information, see Exporting an OMI to a Bucket.

Getting Information About an OMI Export or Import Task Using OSC CLI

The ReadImageExportTasks command lists one or more image export tasks.

Request sample
$ osc-cli api ReadImageExportTasks --profile "default" \
    --Filters '{
        "TaskIds": ["image-export-12345678"]
      }'

This command contains the following attributes that you need to specify:

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • Filters: (optional) One or more filters.

    • TaskIds: (optional) The IDs of the export tasks.

  • NextPageToken: (optional) The token to request the next page of results. Each token refers to a specific page.

  • ResultsPerPage: (optional) The maximum number of logs returned in a single response (between 1 and 1000, both included). By default, 100.

The ReadImageExportTasks command returns the following elements:

  • ImageExportTasks: Information about one or more image export tasks.

    • Comment: If the OMI export task fails, an error message appears.

    • ImageId: The ID of the OMI to be exported.

    • OsuExport: Information about the OMI export task.

      • DiskImageFormat: The format of the export disk (qcow2 | raw).

      • OsuBucket: The name of the OOS bucket the OMI is exported to.

      • OsuManifestUrl: The URL of the manifest file.

      • OsuPrefix: The prefix for the key of the OOS object corresponding to the image.

    • Progress: The progress of the OMI export task, as a percentage.

    • State: The state of the OMI export task (pending/queued | pending | completed | failed | cancelled).

    • Tags: One or more tags associated with the image export task.

      • Key: The key of the tag, with a minimum of 1 character.

      • Value: The value of the tag, between 0 and 255 characters.

    • TaskId: The ID of the OMI export task.

  • NextPageToken: The token to request the next page of results. Each token refers to a specific page.

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "ImageExportTasks": [
    {
      "Tags": [],
      "ImageId": "ami-12345678",
      "TaskId": "image-export-12345678",
      "Comment": "Export of image ami-12345678",
      "OsuExport": {
        "OsuPrefix": "PREFIX/ami-12345678/",
        "OsuBucket": "BUCKET",
        "DiskImageFormat": "qcow2"
      },
      "State": "pending/queued",
      "Progress": 0
    }
  ]
}

Getting Information About an OMI Export or Import Task Using oapi-cli

The ReadImageExportTasks command lists one or more image export tasks.

Request sample
$ oapi-cli --profile "default" ReadImageExportTasks \
    --Filters '{
        "TaskIds": ["image-export-12345678"]
      }'

This command contains the following attributes that you need to specify:

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • Filters: (optional) One or more filters.

    • TaskIds: (optional) The IDs of the export tasks.

  • NextPageToken: (optional) The token to request the next page of results. Each token refers to a specific page.

  • ResultsPerPage: (optional) The maximum number of logs returned in a single response (between 1 and 1000, both included). By default, 100.

The ReadImageExportTasks command returns the following elements:

  • ImageExportTasks: Information about one or more image export tasks.

    • Comment: If the OMI export task fails, an error message appears.

    • ImageId: The ID of the OMI to be exported.

    • OsuExport: Information about the OMI export task.

      • DiskImageFormat: The format of the export disk (qcow2 | raw).

      • OsuBucket: The name of the OOS bucket the OMI is exported to.

      • OsuManifestUrl: The URL of the manifest file.

      • OsuPrefix: The prefix for the key of the OOS object corresponding to the image.

    • Progress: The progress of the OMI export task, as a percentage.

    • State: The state of the OMI export task (pending/queued | pending | completed | failed | cancelled).

    • Tags: One or more tags associated with the image export task.

      • Key: The key of the tag, with a minimum of 1 character.

      • Value: The value of the tag, between 0 and 255 characters.

    • TaskId: The ID of the OMI export task.

  • NextPageToken: The token to request the next page of results. Each token refers to a specific page.

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "ImageExportTasks": [
    {
      "Tags": [],
      "ImageId": "ami-12345678",
      "TaskId": "image-export-12345678",
      "Comment": "Export of image ami-12345678",
      "OsuExport": {
        "OsuPrefix": "PREFIX/ami-12345678/",
        "OsuBucket": "BUCKET",
        "DiskImageFormat": "qcow2"
      },
      "State": "pending/queued",
      "Progress": 0
    }
  ]
}

Related Pages

Corresponding API Methods