Image API
Prerequisites
- Successfully [Create Enterprise Edition Instance](CCR/Enterprise Edition API Reference/Enterprise Edition Instance APIs.md).
- Each instance must contain at least one namespace. For detailed information, refer to [Manage Namespace](CCR/Enterprise Edition API Reference/Namespace APIs.md).
- At least one image registry must exist in the namespace. For details, refer to [Image Registry APIs](CCR/Enterprise Edition API Reference/Image Registry APIs.md).
Query image registry tag list
API description
Retrieve the registry tag list for the target image.
Request structure
1GET /v1/instances/{instanceId}/projects/{projectName}/repositories/{repositoryName}/tags?tagName={tagName}&pageNo={pageNo}&pageSize={pageSize} HTTP/1.1
2Host: ccr.bd.baidubce.com
3Authorization: authorization string
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| instanceId | String | Yes | Path | CCR instance ID |
| projectName | String | Yes | Path | Namespace name |
| repositoryName | String | Yes | Path | Image registry name |
| tagName | String | No | Query | Tag name, available for fuzzy query |
| pageNo | Integer | No | Query | Current page, defaulting to 1 |
| pageSize | Integer | No | Query | Record count per page, defaulting to 10, with the maximum of 100 |
Response headers
There are no special headers required beyond the common headers.
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| total | Integer | Total number of image registry tags |
| pageNo | Integer | Current page |
| pageSize | Integer | Records count per page |
| Items | List<[Tag](CCR/Enterprise Edition API Reference/Appendix.md#Tag)> | Tag result list |
Request example
1GET /v1/instances/instances-test/projects/ns-test/repositories/ubuntu/tags?tagName=18.051&pageNo=1&pageSize=10 HTTP/1.1
2Host: ccr.bd.baidubce.com
3Authorization: bce-auth-v1/123456/2022-08-01T08:26:41Z/1800/host/0a859ce949951fe15a4eb6874a9765f9e8a6f7147f206cf47e270c34c862b8c6
Response example
1HTTP/1.1 200 OK
2Content-Type: application/json; charset=utf-8
3Date: Mon, 01 Aug 2022 08:26:41 GMT
4X-Bce-Gateway-Region: BJ
5X-Bce-Request-Id: 6cee2df3-0505-4044-9f12-65db07ebbcd7
6
7{
8 "total": 1,
9 "pageNo": 1,
10 "pageSize": 10,
11 "items": [
12 {
13 "tagName": "18.051",
14 "digest": "sha256:ed8e0d11fdf57ec2d2c7bef1bb38b117c1e757a0b5e853f67047c1c0bd8f0e5b",
15 "projectId": 8,
16 "pullTime": "0001-01-01T00:00:00.000Z",
17 "pushTime": "2022-08-01T02:51:42.007Z",
18 "repositoryId": 4,
19 "architecture": "amd64",
20 "os": "linux",
21 "author": "",
22 "type": "IMAGE",
23 "size": 36001590,
24 "scanOverview": {
25 "scanStatus": "None",
26 "startTime": "",
27 "endTime": "",
28 "reportId": "",
29 "severity": "None"
30 }
31 }
32 ]
33}
Query image tag details
API description
Get detailed information for a specific image tag.
Request structure
1GET /v1/instances/{instanceId}/projects/{projectName}/repositories/{repositoryName}/tags/{tagName} HTTP/1.1
2Host: ccr.bd.baidubce.com
3Authorization: authorization string
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| instanceId | String | Yes | Path | CCR instance ID |
| projectName | String | Yes | Path | Namespace name |
| repositoryName | String | Yes | Path | Image registry name |
| tagName | String | Yes | Path | Tag name |
Response headers
There are no special headers required beyond the common headers.
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| architecture | String | Image registry architecture |
| author | String | Publisher |
| digest | String | Artifact hash value |
| os | String | OS type |
| projectId | Integer | Namespace ID to which the artifact belongs |
| pullTime | String | Latest tag pull time, in date-time format |
| pushTime | String | Tag push time, in date-time format |
| repositoryId | Integer | Image registry ID to which the artifact belongs |
| scanOverview | [Tag.ScanOverview](CCR/Enterprise Edition API Reference/Appendix.md#Tag.ScanOverview) | Vulnerability scan information |
| size | Integer | Artifact size |
| tagName | String | Tag name |
| type | String | Artifact category, e.g.: image, chart |
Request example
1GET /v1/instances/ccr-4k74gw7d/projects/ns-test/repositories/ubuntu/tags/18.051 HTTP/1.1
2Host: ccr.bd.baidubce.com
3Authorization: bce-auth-v1/123456/2022-08-01T13:07:36Z/1800/host/0a859ce949951fe15a4eb6874a9765f9e8a6f7147f206cf47e270c34c862b8c6
Response example
1HTTP/1.1 200 OK
2Content-Type: application/json; charset=utf-8
3Date: Mon, 01 Aug 2022 13:07:37 GMT
4X-Bce-Gateway-Region: BJ
5X-Bce-Request-Id: d8bb93db-9e4e-436e-b67c-91847b161c43
6
7{
8 "tagName": "18.051",
9 "digest": "sha256:ed8e0d11fdf57ec2d2c7bef1bb38b117c1e757a0b5e853f67047c1c0bd8f0e5b",
10 "projectId": 8,
11 "pullTime": "0001-01-01T00:00:00.000Z",
12 "pushTime": "2022-08-01T02:51:42.007Z",
13 "repositoryId": 4,
14 "architecture": "",
15 "os": "",
16 "author": "",
17 "type": "IMAGE",
18 "size": 36001590,
19 "scanOverview": {
20 "scanStatus": "None",
21 "startTime": "",
22 "endTime": "",
23 "reportId": "",
24 "severity": "None"
25 }
26}
Delete a single image tag
API description
Delete a specific image tag.
Request structure
1DELETE /v1/instances/{instanceId}/projects/{projectName}/repositories/{repositoryName}/tags/{tagName} HTTP/1.1
2Host: ccr.bd.baidubce.com
3Authorization: authorization string
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| instanceId | String | Yes | Path | CCR instance ID |
| projectName | String | Yes | Path | Namespace name |
| repositoryName | String | Yes | Path | Image registry name |
| tagName | String | Yes | Path | Tag name |
Response headers
There are no special headers required beyond the common headers.
Response parameters
If the request is successful, no response parameters are returned. In case of failure, a standard error structure is provided.
Request example
1DELETE /v1/instances/instances-test/projects/ns-test/repositories/ubuntu/tags/18.051 HTTP/1.1
2Host: ccr.bd.baidubce.com
3Authorization: bce-auth-v1/123456/2022-08-01T08:26:41Z/1800/host/0a859ce949951fe15a4eb6874a9765f9e8a6f7147f206cf47e270c34c862b8c6
Response example
1HTTP/1.1 200 OK
2Content-Type: application/json; charset=utf-8
3Date: Mon, 01 Aug 2022 12:30:44 GMT
4X-Bce-Gateway-Region: BJ
5X-Bce-Request-Id: fed4cbbf-fc67-46ed-a3f5-2dcdc30a08ed
Delete image tags in batch
API description
Remove image tags in bulk.
Request structure
1DELETE /v1/instances/{instanceId}/projects/{projectName}/repositories/{repositoryName}/tags HTTP/1.1
2Host: ccr.bd.baidubce.com
3Authorization: authorization string
4
5{
6 "items": {items}
7}
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| instanceId | String | Yes | Path | CCR instance ID |
| projectName | String | Yes | Path | Namespace name |
| repositoryName | String | Yes | Path | Image registry name |
| items | List |
Yes | Body | Tag name array |
Response headers
There are no special headers required beyond the common headers.
Response parameters
If the request is successful, no response parameters are returned. In case of failure, a standard error structure is provided.
Request example
1DELETE /v1/instances/instances-test/projects/ns-test/repositories/ubuntu/tags HTTP/1.1
2Host: ccr.bd.baidubce.com
3Authorization: bce-auth-v1/123456/2022-08-01T08:26:41Z/1800/host/0a859ce949951fe15a4eb6874a9765f9e8a6f7147f206cf47e270c34c862b8c6
4
5{
6 "items": [
7 "18.053",
8 "18.054"
9 ]
10}
Response example
1HTTP/1.1 200 OK
2Content-Type: application/json; charset=utf-8
3Date: Mon, 01 Aug 2022 12:30:44 GMT
4X-Bce-Gateway-Region: BJ
5X-Bce-Request-Id: fed4cbbf-fc67-46ed-a3f5-2dcdc30a08ed
Query building history
API description
View the build history of a specified image tag.
Request structure
1GET /v1/instances/{instanceId}/projects/{projectName}/repositories/{repositoryName}/tags/{tagName}/buildhistory HTTP/1.1
2Host: ccr.bd.baidubce.com
3Authorization: authorization string
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| instanceId | String | Yes | Path | CCR instance ID |
| projectName | String | Yes | Path | Namespace name |
| repositoryName | String | Yes | Path | Image registry name |
| tagName | String | Yes | Path | Tag name |
Response headers
There are no special headers required beyond the common headers.
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| items | List<[BuildHistory](CCR/Enterprise Edition API Reference/Appendix.md#BuildHistory)> | Collection of target tag building history |
Request example
1GET /v1/instances/ccr-4k74gw7d/projects/ns-test/repositories/ubuntu/tags/18.051/buildhistory HTTP/1.1
2Host: ccr.bd.baidubce.com
3Authorization: bce-auth-v1/123456/2022-08-01T13:07:36Z/1800/host/0a859ce949951fe15a4eb6874a9765f9e8a6f7147f206cf47e270c34c862b8c6
Response example
1HTTP/1.1 200 OK
2Content-Type: application/json; charset=utf-8
3Date: Mon, 01 Aug 2022 13:59:42 GMT
4X-Bce-Gateway-Region: BJ
5X-Bce-Request-Id: 330eb4d3-1ad9-4a3d-ac12-e5c6f447f4a1
6
7{
8 "items": [
9 {
10 "created": "2020-07-24T14:38:19.482Z",
11 "comment": "",
12 "createdBy": "/bin/sh -c #(nop) ADD file:7d9bbf45a5b2510d44d3206a028cf6502757884d49e46d3d2e6356c3a92c4309 in / ",
13 "emptyLayer": false
14 },
15 {
16 "created": "2020-07-24T14:38:20.335Z",
17 "comment": "",
18 "createdBy": "/bin/sh -c [ -z \"$(apt-get indextargets)\" ]",
19 "emptyLayer": false
20 }
21 ]
22}
Trigger image scan
API description
Scan the specified tag for images.
Request structure
1POST /v1/instances/{instanceId}/projects/{projectName}/repositories/{repositoryName}/tags/{tagName}/scan HTTP/1.1
2Host: ccr.bd.baidubce.com
3Authorization: authorization string
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| instanceId | String | Yes | Path | CCR instance ID |
| projectName | String | Yes | Path | Namespace name |
| repositoryName | String | Yes | Path | Image registry name |
| tagName | String | Yes | Path | Tag name |
Response headers
There are no special headers required beyond the common headers.
Response parameters
If the request is successful, no response parameters are returned. In case of failure, a standard error structure is provided.
Request example
1POST /v1/instances/ccr-4k74gw7d/projects/ns-test/repositories/ubuntu/tags/18.051/scan HTTP/1.1
2Host: ccr.bd.baidubce.com
3Authorization: bce-auth-v1/123456/2022-08-01T13:07:36Z/1800/host/0a859ce949951fe15a4eb6874a9765f9e8a6f7147f206cf47e270c34c862b8c6
Response example
1HTTP/1.1 200 OK
2Content-Type: application/json; charset=utf-8
3Date: Mon, 01 Aug 2022 14:15:13 GMT
4X-Bce-Gateway-Region: BJ
5X-Bce-Request-Id: 3eff2bc8-2310-4f95-874c-e65ed3a68a7b
Query image vulnerability results
API description
Check vulnerability details found in the scan results for a specific image tag.
Request structure
1GET /v1/instances/{instanceId}/projects/{projectName}/repositories/{repositoryName}/tags/{tagName}/scanoverview?pageNo={pageNo}&pageSize={pageSize} HTTP/1.1
2Host: ccr.bd.baidubce.com
3Authorization: authorization string
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| instanceId | String | Yes | Path | CCR instance ID |
| projectName | String | Yes | Path | Namespace name |
| repositoryName | String | Yes | Path | Image registry name |
| tagName | String | Yes | Path | Tag name |
| pageNo | Integer | No | Query | Current page |
| pageSize | Integer | No | Query | Records count per page |
Response headers
There are no special headers required beyond the common headers.
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| items | List<[Artifact.ScanOverview](CCR/Enterprise Edition API Reference/Namespace APIs.md#Artifact.ScanOverview)> | Vulnerability scanning result list |
| lastScanTime | String | Last scanning time |
| pageNo | Integer | Current page, defaulting to 1 |
| pageSize | Integer | Record count per page, defaulting to 10 |
| summary | Object | Number of vulnerabilities with different severity |
| total | Integer | Total number of vulnerabilities |
Request example
1GET /v1/instances/ccr-4k74gw7d/projects/ns-test/repositories/ubuntu/tags/18.051/scanoverview HTTP/1.1
2Host: ccr.bd.baidubce.com
3Authorization: bce-auth-v1/123456/2022-08-01T13:07:36Z/1800/host/0a859ce949951fe15a4eb6874a9765f9e8a6f7147f206cf47e270c34c862b8c6
Response example
1HTTP/1.1 200 OK
2Content-Type: application/json; charset=utf-8
3Date: Mon, 01 Aug 2022 13:07:37 GMT
4X-Bce-Gateway-Region: BJ
5X-Bce-Request-Id: 0dba647a-57ae-496d-b409-b9a25e2613c2
6
7{
8 "total": 209,
9 "pageNo": 1,
10 "pageSize": 10,
11 "summary": {
12 "High": 8,
13 "Low": 103,
14 "Medium": 98
15 },
16 "items": [
17 {
18 "id": "CVE-2019-17567",
19 "package": "apache2-utils",
20 "version": "2.4.29-1ubuntu4.13",
21 "fixVersion": "",
22 "severity": "Medium",
23 "description": "Apache HTTP Server versions 2.4.6 to 2.4.46 mod_proxy_wstunnel configured on an URL that is not necessarily Upgraded by the origin server was tunneling the whole connection regardless, thus allowing for subsequent requests on the same connection to pass through with no HTTP validation, authentication or authorization possibly configured.",
24 "links": [
25 "https://avd.aquasec.com/nvd/cve-2019-17567"
26 ]
27 },
28 {
29 "id": "CVE-2021-26691",
30 "package": "apache2-utils",
31 "version": "2.4.29-1ubuntu4.13",
32 "fixVersion": "2.4.29-1ubuntu4.16",
33 "severity": "Medium",
34 "description": "In Apache HTTP Server versions 2.4.0 to 2.4.46 a specially crafted SessionHeader sent by an origin server could cause a heap overflow",
35 "links": [
36 "https://avd.aquasec.com/nvd/cve-2021-26691"
37 ]
38 },
39 {
40 "id": "CVE-2021-30641",
41 "package": "apache2-utils",
42 "version": "2.4.29-1ubuntu4.13",
43 "fixVersion": "2.4.29-1ubuntu4.16",
44 "severity": "Medium",
45 "description": "Apache HTTP Server versions 2.4.39 to 2.4.46 Unexpected matching behavior with 'MergeSlashes OFF'",
46 "links": [
47 "https://avd.aquasec.com/nvd/cve-2021-30641"
48 ]
49 },
50 {
51 "id": "CVE-2021-40438",
52 "package": "apache2-utils",
53 "version": "2.4.29-1ubuntu4.13",
54 "fixVersion": "2.4.29-1ubuntu4.18",
55 "severity": "Medium",
56 "description": "A crafted request uri-path can cause mod_proxy to forward the request to an origin server choosen by the remote user. This issue affects Apache HTTP Server 2.4.48 and earlier.",
57 "links": [
58 "https://avd.aquasec.com/nvd/cve-2021-40438"
59 ]
60 }
61 ],
62 "lastScanTime": "2022-08-01T14:15:17.329Z"
63}
