Help Center/ CodeArts Repo/ API Reference/ APIs/ Repository/ Obtaining the Repository IP Address Whitelist
Updated on 2025-03-28 GMT+08:00

Obtaining the Repository IP Address Whitelist

Function

Obtain repository IP address whitelist.

URI

GET /v4/projects/{id}/trusted-ip-addresses

Table 1 Query parameters

Parameter

Mandatory

Type

Description

id

Yes

Integer

Repository ID.

offset

No

Integer

Page number.

limit

No

Integer

Number of data records on each page.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 3 Response header

Parameter

Type

Description

X-Total

String

Total number of results of the current request.

Table 4 Response body parameters (array)

Parameter

Type

Description

id

String

Association result.

repository_id

Integer

Repository ID.

ip_range

String

IP address segment.

ip_type

Integer

Format type. The value can be a specified IP address, IP address segment, or CIDR block.

ip_start

String

Start IP Address.

ip_end

String

End IP Address.

view_flag

Integer

Whether to allow access to the repository.

download_flag

Integer

Whether to allow code download.

upload_flag

Integer

Whether to allow code commit.

remark

String

Remarks.

created_at

String

Creation time.

updated_at

String

Update time.

order_flag

Integer

Sorting order.

Table 5 Error

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

GET https://{endpoint}/v4/projects/{id}/trusted-ip-addresses

Example Responses

Status code: 200

OK
[
    {
        "id": 19324,
        "repository_id": 2111897848,
        "ip_range": "255.255.255.255",
        "ip_start": "255.255.255.255",
        "ip_end": "255.255.255.255",
        "created_at": "Jul 22, 2024 2:42:46 PM",
        "updated_at": "Jul 22, 2024 2:42:46 PM",
        "ip_type": 3,
        "view_flag": 1,
        "download_flag": 1,
        "upload_flag": 1,
        "order_flag": 0
    },
    {
        "id": 19325,
        "repository_id": 2111897848,
        "ip_range": "1:1:1:1:1:1:1:1",
        "ip_start": "1:1:1:1:1:1:1:1",
        "ip_end": "1:1:1:1:1:1:1:1",
        "created_at": "Jul 22, 2024 2:42:46 PM",
        "updated_at": "Jul 22, 2024 2:42:46 PM",
        "ip_type": 0,
        "view_flag": 1,
        "download_flag": 1,
        "upload_flag": 1,
        "order_flag": 0
    }
]

Status Code

Status Code

Description

200

OK

Error code.

See Error Codes.