Before you begin
- Select a project and activate Cloud CDN.
- Have permission to create API keys and grant the key permission to list distributions.
- Use Bash with curl, or PowerShell. The examples below do not require an SDK.
/cloud-dns/zones in place of /cloud-cdn/distributions and grant permission to list zones. Your organization needs the corresponding active service.
1. Create the credentials
In the Management Console, select your project and open Developers → Create API key. Name the key for its workload and grant only the list permission needed for this request. Save both the access key, which begins withAPTRANET_, and its secret. The secret is shown only when created or rolled. The key’s project is permanent; switching the console project does not change the key.
2. Send the request
project query parameter and organization header: the API key already identifies the project.
Bash examples elsewhere in these docs use
$APTRANET_ACCESS_KEY and $APTRANET_SECRET from this step. For unattended workloads, supply these values through your deployment’s secret store.3. Check the response
An empty Cloud DNS zone collection returns
200 with []. Do not attempt to parse a 204 response as JSON. PowerShell reports non-success HTTP responses as errors; inspect their status before retrying.
When finished with an interactive session, clear the variables:
Continue
- Request conventions explain identifiers, full-document updates, and retries.
- Update CDN configuration walks through reading, modifying, and verifying a setting.
- API keys covers rotation and revocation.
- Errors explains error bodies and trace IDs.