Back to Gitlabhq

Metadata API

doc/api/metadata.md

19.3.02.7 KB
Original Source

{{< details >}}

  • Tier: Free, Premium, Ultimate
  • Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated

{{< /details >}}

{{< history >}}

  • kas.externalK8sProxyUrl introduced in GitLab 17.6.

{{< /history >}}

Retrieves metadata information for a specified GitLab instance.

plaintext
GET /metadata
GET /version

Response body attributes:

AttributeTypeDescription
versionstringVersion of the GitLab instance.
revisionstringRevision of the GitLab instance.
kasobjectMetadata about the GitLab agent server for Kubernetes (KAS).
kas.enabledbooleanIndicates whether KAS is enabled.
kas.externalUrlstring or nullURL used by the agents to communicate with KAS. It's null if kas.enabled is false.
kas.externalK8sProxyUrlstring or nullURL used by the Kubernetes tooling to communicate with the KAS Kubernetes API proxy. It's null if kas.enabled is false.
kas.versionstring or nullVersion of KAS. It's null if kas.enabled is false or when the GitLab instance failed to fetch server info from KAS.
enterprisebooleanIndicates whether the GitLab instance is Enterprise Edition.

Example request:

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/metadata"
shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/version"

Example response:

json
{
  "version": "18.1.1-ee",
  "revision": "ceb07b24cb0",
  "kas": {
    "enabled": true,
    "externalUrl": "grpc://gitlab.example.com:8150",
    "externalK8sProxyUrl": "https://gitlab.example.com:8150/k8s-proxy",
    "version": "18.1.1"
  },
  "enterprise": true
}