Admiral

Components

Retrieve a version

GET
/v1/components/{component}/versions/{version}
  • NOT_FOUND when no version has that resource name.

Scope: component:read

Authorization

bearerAuth
AuthorizationBearer <token>

An API key, or an access token minted from one. Pass it in the Authorization header: Bearer admp_...

In: header

Path Parameters

component*string

The component id.

version*string

The version id.

Response Body

application/json

curl -X GET "https://example.com/v1/components/string/versions/string"
{  "version": {    "id": "string",    "resource_name": "string",    "component_id": "string",    "digest": "string",    "kind": "KIND_UNSPECIFIED",    "size_bytes": "string",    "contract": {      "inputs": [        {          "name": "string",          "type": "string",          "description": "string",          "required": true,          "default": null,          "sensitive": true,          "ephemeral": true,          "nullable": true,          "deprecated": "string",          "validations": [            {              "condition": "string",              "error_message": "string"            }          ],          "schema": {            "property1": null,            "property2": null          }        }      ],      "outputs": [        {          "name": "string",          "description": "string",          "sensitive": true        }      ]    },    "baseline_values_json": "string",    "requirements": {      "infra": {        "required_version": "string",        "providers": [          "string"        ]      }    },    "provenance": {      "kind": "KIND_UNSPECIFIED",      "uri": "string",      "ref": "string",      "commit": "string",      "path": "string",      "dependencies": [        {          "source": "string",          "constraint": "string",          "resolved": "string"        }      ],      "credentials": [        {          "credential_id": "string",          "name": "string",          "hosts": [            "string"          ]        }      ],      "commit_message": "string",      "commit_author": "string",      "source_id": "string"    },    "findings": [      {        "severity": "FINDING_SEVERITY_UNSPECIFIED",        "source": "string",        "code": "string",        "message": "string",        "path": "string"      }    ],    "tags": [      "string"    ],    "status": "STATUS_UNSPECIFIED",    "status_reason": "string",    "status_changed_at": "2023-01-15T01:30:15.01Z",    "created_by": {      "id": "string",      "display_name": "string",      "email": "string"    },    "created_at": "2023-01-15T01:30:15.01Z"  }}

Retrieve a component GET

- NOT_FOUND when no component has that resource name. Scope: `component:read`

Import an artifact from a registry, repository or URL POST

`resource_name` is the component, always. The import that creates it needs `source_id` and sets the component's origin to that source and artifact. A later import under the same name is a bump: `source_id` and `artifact` may be left empty, and the origin supplies them. `version` is an exact version as ListSourceVersions spells it, the keyword `latest`, or a semver range such as `^2`, `~2.39` or `>=2.39 <3`. Admiral resolves a range or `latest` once, against a fresh read of the upstream rather than the cached list ListSourceVersions serves, and only over the versions the source's `allows` permits. It stores the exact version. A range or a keyword never reaches a changeset or an environment pin. Any member who can read the source may import a new version of an existing component through its origin, since the caller chooses only which allowed version to take. Creating a component by import needs no permission to create components, since the source already bounds it. - INVALID_ARGUMENT when the import would create the component and names no `source_id`. - FAILED_PRECONDITION when the component was published by hand, or when `source_id` or `artifact` differs from its origin. The message names SetComponentOrigin, which moves the origin. - FAILED_PRECONDITION when the artifact or the resolved version is outside the source's `allows`, when the resolved version is revoked, or when no permitted version matches `version`. An archive at a URL is not importable, since an archive has no versions. A git source at a tag covers it. Scope: `component:publish`