Skip to content

fetch-url

Ask the agent to perform an HTTP GET to a target URL and stream the response back to the caller. The request runs from the agent host’s network vantage point (its egress IP), which lets a pipeline fetch a resource from where the agent sits rather than from the CI runner.

Unlike the other commands, fetch-url uses a single, fixed config file — config/fetch-url.json — regardless of the URL. It only carries apiKeys:

config/fetch-url.json
{
"type": "FETCH_URL",
"apiKeys": {
"REPLACE_WITH_A_LONG_RANDOM_SECRET": "gitlab-ci"
}
}

There are no other configurable fields; the connect/read/write timeouts are fixed at 30 seconds.

.gitlab-ci.yml job
curl \
--fail \
-H "api-key: $FETCH_KEY" \
"https://dc-agent.example.com/dc-agent/fetch-url/https://internal.example.com/health"

GET /dc-agent/fetch-url/{targetUrl} — the target URL is taken from the request: the part of the path after /fetch-url/ together with any query string.

Name Description Default Required
apiKeys Accepted secrets → owner labels (in config/fetch-url.json) — yes (without it every call gets 401)
type FETCH_URL; must match the endpoint — another type gets 401, a missing or misspelled one is accepted with a warning in the agent log — recommended

The upstream response body is streamed back to the caller.