git.repositories.update-mirror

Change a mirror's interval, the minute poll, or shadow CI

PATCH /git/api/repositories/{repoId}/mirrorIAM git:UpdateRepositoryChanges stateDestructive

Request syntax

PATCH /git/api/repositories/{repoId}/mirror
{
  "intervalMinutes": "number",
  "continuous": "boolean",
  "shadowCi": "object"
}

Path parameters

  • repoIdRequired

    string

    Constraints: uuid

Request body

  • intervalMinutesOptional

    number

    Minutes between full fetches

    Constraints: integer, 5-1440

  • continuousOptional

    boolean

    Check the source every minute (git ls-remote) and fetch when a ref moved

  • shadowCiOptional

    object

    Run the source workflows here on mirrored pushes to compare: no secrets, no deploy or publish jobs

    Constraints: JSON

Response

200 with the mirror's settings after the change: provider, sourceUrl, intervalMinutes, continuous, shadowCi, lastSyncedAt, lastError and hasToken.

A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.

Fields of data

  • providerAlways

    one of github, gitlab, git

    Where it comes from: GitHub, GitLab, or any git URL
  • sourceUrlAlways

    string

    The source followed, without credentials
  • intervalMinutesAlways

    number

    Minutes between full fetches
  • lastSyncedAtAlways

    string, may be null

    When the last sync finished (ISO 8601); null before the first
  • lastErrorAlways

    string, may be null

    Why the last sync failed; null when it did not
  • pullsUpdatedThroughWhen present

    string

    Pull requests changed on the source up to this time (ISO 8601) are in
  • pullsUpdatedAtCorrectedAtWhen present

    string

    When the imported pull requests' update times were taken from the source
  • mergeMethodsReadAtWhen present

    string

    When the source's merge methods were last applied here (ISO 8601)
  • continuousWhen present

    boolean

    The source is checked every minute and fetched as soon as a ref moved
  • shadowCiWhen present

    object

    Running the source's workflows here to compare; absent when never set
  • shadowCi.​enabledAlways

    boolean

    Shadow CI runs on mirrored pushes
  • shadowCi.​branchesAlways

    array of string

    Branch patterns it runs for; the default branch when empty
  • hasTokenAlways

    boolean

    A token for the source is kept (it is never shown)

Checked against the handlers: every route test validates their answers against this schema.

Errors

  • 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
  • 401No credentials, or an access key that is unknown, revoked or expired.
  • 403The caller's policies do not allow git:UpdateRepository on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
  • 404The resource does not exist in your organization.

Examples

The required parameters only, with example values. Replace id and the other placeholders with your own.

dcloud git repositories update-mirror repoId

Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_git_repositories_update-mirror.