Updated on 2023-04-04 GMT+08:00

Creating an Automatic Image Synchronization Task

Function

Create an automatic image synchronization task.

URI

POST /v2/manage/namespaces/{namespace}/repos/{repository}/sync_repo

Table 1 describes the parameters.

Table 1 Parameter description

Parameter

Mandatory

Type

Description

namespace

Yes

String

Organization name

repository

Yes

String

Image repository name

Request

  • Request parameters
    Table 2 Request body parameter description

    Parameter

    Mandatory

    Type

    Description

    remoteRegionId

    Yes

    String

    Target region ID

    remoteNamespace

    Yes

    String

    Target organization

    syncAuto

    No

    Boolean

    (Reserved field) Automatic synchronization. You are recommended to retain the default value false.

    override

    No

    Boolean

    Whether to overwrite. The default value is false, which indicates not to overwrite any nonidentical image that has the same name in the target organization.

  • Example request
    POST https://{Endpoint}/v2/manage/namespaces/group/repos/busybox/sync_repo

    Body:

    {
        "remoteRegionId": "region-2",
        "remoteNamespace": "sdsad",
        "syncAuto": true,
        "override": true
    }

Response

  • Response parameters

    N/A

  • Example response
    {}

Status Code

Status Code

Description

200

Creation successful.

400

Request error.

401

Authentication failed.

404

The organization does not exist.

500

Failed to complete the request because of an internal service error.