GetImageBuild

Updated at:

Retrieves the details of an image build.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

paiimage:GetImageBuild

get

*All Resource

*

None None

Request syntax

GET /api/v1/imagebuilds/{ImageBuildId} HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

ImageBuildId

string

Yes

The ID of the image build.

build-****abcd

Request parameters

Parameter

Type

Required

Description

Example

No parameters required.

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The request ID.

681192FB-****-****-****-*****C9E4

Accessibility

string

The visibility of the image build.

PUBLIC

GmtCreateTime

string

The creation time.

2025-11-04T06:22:02.000Z

WorkspaceId

string

The workspace ID.

12345

Resource

object

The runtime resources for the build job.

EcsSpec

string

The pay-as-you-go resource specifications. This parameter is not required when you use subscription resources.

ecs.c6.large

ResourceConfig

object

The resource configuration. This parameter is not required when you use pay-as-you-go resources.

CPU

string

The number of CPU cores used by the image build job. For example, 4 indicates 4 cores.

4

Memory

string

The memory capacity used by the image build job. For example, 8Gi indicates 8 GiB.

8Gi

ResourceId

string

The resource quota ID.

quota123434

ResourceType

string

The resource type. Example: Lingjun.

Lingjun

UserVpc

object

The user VPC information.

VpcId

string

The VPC ID.

vpc-abcdef**

SwitchId

string

The vSwitch ID.

vs-abcdef**

SecurityGroupId

string

The security group ID.

sg-abcdef**

DefaultRoute

string

The default route ENI egress.

eth1

ExtendedCidrs

array

The extended CIDR blocks.

string

The Classless Inter-Domain Routing (CIDR) block, which specifies the IP address and prefix length.

10.0.0.0/24

TargetRegistry

object

The target image service configuration.

InstanceId

string

The ID of the Container Registry (ACR) Enterprise instance that stores the build artifacts.

cri-**abcd

Type

string

The type of the target image service. AcrEnterprise indicates Container Registry (ACR) Enterprise Edition.

AcrEnterprise

ImageBuildId

string

The ID of the image build.

build-****ks92

OverwriteImageTag

boolean

Specifies whether to overwrite the image.

BuildConfig

object

The build configuration, which specifies the content of the Dockerfile to be built. Valid values for BuildType:

  • PackageInstallation: Installs software packages based on a specified image.

  • CustomDockerfile: Builds an image based on a custom Dockerfile.

Dockerfile

string

The content of the Dockerfile.

FROM ubuntu:18:04 RUN pip3 install numpy==1.19.5

BuildType

string

The image build method. PackageInstallation indicates installing software packages on a specified base image. CustomDockerfile indicates building an image by using a custom Dockerfile.

PackageInstallation

DockerfilePath

string

The path of the Dockerfile, which is a relative path to the mounted context path.

docker/Dockerfile

DataSources

array<object>

The list of data sources.

object

The data source object.

DataSourceId

string

The ID of the dataset in the workspace.

d-************zbs

Uri

string

The storage path, including the endpoint. This parameter is mutually exclusive with DataSourceId.

oss://{bucket-name}.oss-{region}-internal.aliyuncs.com/{subPath}/

MountPath

string

The mount path.

/mnt/data/

MountAccess

string

The read and write permissions for the contextual mount of the build.

RO

Options

string

The custom mount property for the custom dataset. Currently, only OSS is supported.

{"fs.oss.download.thread.concurrency":"10"}

DataSourceVersion

string

The version of the dataset. If you specify this parameter, you must also specify DataSourceId.

v1

ImageBuildJobId

string

The ID of the build job.

dlc-****ks92

ImageBuildJobName

string

The name of the image build job.

build-my-image

Creator

string

The creator.

12345678********

Image

object

The information about the custom image generated by the build, including the image name, description, URI, and labels.

Name

string

The display name of the generated image in the workspace.

test-v1

Description

string

The description of the generated image in the workspace.

Build test image

Uri

string

The full URI of the generated image in the target repository, including the repository domain name, namespace, repository name, and image version label (tag).

user-test-registry-vpc.cn-wulanchabu.cr.aliyuncs.com/pai-test/pai-test:test-v1

Labels

array<object>

The list of labels used to tag the image in the workspace. Each label consists of a key and a value.

object

An image label, which includes a key and a value.

Key

string

The key of the image label, which identifies the name of the label.

key1

Value

string

The value of the image label, which corresponds to the key in the same label.

value1

GmtModifiedTime

string

The time when the image build record was last updated. The time is in ISO 8601 format.

2025-11-04T06:22:02.000Z

ImageId

string

The ID of the custom image generated by the build in the PAI workspace.

image-4c62******53uor

ImageBuildJobTags

object

The user-defined tags for the image build job.

{"labelKey":"labelValue"}

Examples

Success response

JSON format

{
  "RequestId": "681192FB-****-****-****-*****C9E4",
  "Accessibility": "PUBLIC",
  "GmtCreateTime": "2025-11-04T06:22:02.000Z",
  "WorkspaceId": "12345",
  "Resource": {
    "EcsSpec": "ecs.c6.large",
    "ResourceConfig": {
      "CPU": "4",
      "Memory": "8Gi"
    },
    "ResourceId": "quota123434",
    "ResourceType": "Lingjun"
  },
  "UserVpc": {
    "VpcId": "vpc-abcdef**",
    "SwitchId": "vs-abcdef**",
    "SecurityGroupId": "sg-abcdef**",
    "DefaultRoute": "eth1",
    "ExtendedCidrs": [
      "10.0.0.0/24"
    ]
  },
  "TargetRegistry": {
    "InstanceId": "cri-**abcd",
    "Type": "AcrEnterprise"
  },
  "ImageBuildId": "build-****ks92",
  "OverwriteImageTag": false,
  "BuildConfig": {
    "Dockerfile": "FROM ubuntu:18:04\nRUN pip3 install numpy==1.19.5",
    "BuildType": "PackageInstallation",
    "DockerfilePath": "docker/Dockerfile",
    "DataSources": [
      {
        "DataSourceId": "d-************zbs",
        "Uri": "oss://{bucket-name}.oss-{region}-internal.aliyuncs.com/{subPath}/",
        "MountPath": "/mnt/data/",
        "MountAccess": "RO",
        "Options": "{\"fs.oss.download.thread.concurrency\":\"10\"}",
        "DataSourceVersion": "v1"
      }
    ]
  },
  "ImageBuildJobId": "dlc-****ks92",
  "ImageBuildJobName": "build-my-image",
  "Creator": "12345678********",
  "Image": {
    "Name": "test-v1",
    "Description": "Build test image",
    "Uri": "user-test-registry-vpc.cn-wulanchabu.cr.aliyuncs.com/pai-test/pai-test:test-v1",
    "Labels": [
      {
        "Key": "key1",
        "Value": "value1"
      }
    ]
  },
  "GmtModifiedTime": "2025-11-04T06:22:02.000Z",
  "ImageId": "image-4c62******53uor",
  "ImageBuildJobTags": {
    "labelKey": "labelValue"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.