Pacotes
Pacotes UPack: registro, listagem, versões e downloads por nome, versão ou intervalo.
Operações deste grupo com a regra de acesso, a regra de repetição, os parâmetros e as respostas. Toda solicitação leva uma chave: Authorization: Bearer <chave> (consulte “Autenticação”).
Operações
Listar versões de pacotes
GET HEAD /api/v1/repositories/{repository}/packages
Acesso: Permissão no repositório: package.read; chaves em arquivo: read · Repetição: Pode ser repetida com segurança (leitura)
Lista as versões UPack registradas com seus manifestos, filtradas por group e name (exatos, sem distinção entre maiúsculas e minúsculas; group= com valor vazio seleciona o grupo raiz, e omiti-lo seleciona todos os grupos). sort (group, name, version), direction (asc, desc) e groupBy (none, group, package, que adiciona groups listando os artifactIds da página) moldam o resultado. As páginas contêm limit itens (1–100, padrão 50); continue com after definido como next e os mesmos filtros. As páginas não são um instantâneo: versões registradas nesse intervalo podem não aparecer até a próxima passagem.
Parâmetros
| Nome | Local | Tipo | Obrigatório | Regras |
|---|---|---|---|---|
repository | caminho | string | sim | corresponde a ^[a-z0-9][a-z0-9_-]{0,63}$ |
group | consulta | string | não | — |
name | consulta | string | não | — |
sort | consulta | string | não | um destes: group, name, version |
direction | consulta | string | não | um destes: asc, desc |
groupBy | consulta | string | não | um destes: none, group, package |
after | consulta | string | não | — |
limit | consulta | integer | não | 1–100 |
Resposta 200
| Campo | Tipo | Obrigatório | Regras |
|---|---|---|---|
items | array de object | sim | — |
items[].group | string | não | — |
items[].name | string | não | — |
items[].version | string | não | — |
items[].artifactId | string (uuid) | não | — |
items[].manifest | object | não | — |
next | string | sim | pode ser null |
groups | array de object | sim | — |
groups[].group | string | sim | — |
groups[].name | string | sim | pode ser null |
groups[].artifactIds | array de string (uuid) | sim | — |
Respostas: 200, 400, 401, 403, 404, 409, 422, 503, 507
Exemplo
curl -X GET "$ARKVORY_URL/api/v1/repositories/$REPOSITORY/packages" \
-H "Authorization: Bearer $ARKVORY_TOKEN"Baixar um pacote por nome e versão
GET HEAD /api/v1/repositories/{repository}/packages/content
Acesso: Permissão no repositório: content.read; chaves em arquivo: read · Repetição: Pode ser repetida com segurança (leitura)
Resolve name (em group, o grupo raiz por padrão) para uma versão registrada e a transmite como downloadArtifact; X-Arkvory-Artifact-Id e X-Arkvory-Package-Version indicam a escolha. Selecione por version exata ou por range SemVer (como ^1.4 ou >=1.0.0 <2.0.0), opcionalmente apenas versões com stage; sem nenhum dos dois, ele escolhe a versão estável mais alta, prerelease=true admite pré-lançamentos e order=promoted escolhe a versão que recebeu stage mais recentemente. O nome é resolvido a cada solicitação; portanto, retome com If-Range definido como o ETag retornado ou baixe pelo ID do artefato; resolvePackage fornece a mesma escolha sem os bytes.
Parâmetros
| Nome | Local | Tipo | Obrigatório | Regras |
|---|---|---|---|---|
repository | caminho | string | sim | corresponde a ^[a-z0-9][a-z0-9_-]{0,63}$ |
Range | cabeçalho | string | não | Single bytes range; multi-range is unsupported. HEAD ignores Range. |
If-Range | cabeçalho | string | não | Exact strong ETag; a mismatch causes a full response. |
If-None-Match | cabeçalho | string | não | Matching ETag returns 304, including HEAD. |
Arkvory-Download-Id | cabeçalho | string | não | corresponde a ^[A-Za-z0-9_-]{16,64}$; The client own id of one download, the same on every range of it: the queue keys the session by it instead of the client address, answers a waiting request at once with 503 download_queued, and may ask it to yield its place at a range boundary. Without it, a waiting request is held until its turn for a bounded time. |
Arkvory-Queue-Ticket | cabeçalho | string | não | até 80 caracteres; The last Arkvory-Queue-Ticket the server sent for this download: after a server restart the download takes its old turn. A ticket that is wrong, expired or of another download is ignored. |
Arkvory-Download-Class | cabeçalho | string | não | um destes: interactive, release, bulk, background; Queue class of the download. Only a class lower than the caller own one applies (people: interactive, services and links: release); an unknown value is 400. The response names the class applied. |
group | consulta | string | não | até 128 caracteres |
name | consulta | string | sim | 1–128 caracteres |
version | consulta | string | não | até 128 caracteres; Exact version; excludes range. |
range | consulta | string | não | até 256 caracteres; SemVer range: 1.2.3, ^1.2, ~1.2.3, 1.x, >=1.0.0 <2.0.0, a || b. |
stage | consulta | string | não | corresponde a ^[a-z0-9][a-z0-9_.-]{0,31}$; Only versions promoted to this stage. |
prerelease | consulta | string | não | um destes: true, false; Include prereleases. |
order | consulta | string | não | um destes: version, promoted; promoted picks the most recently staged version and requires stage. |
Respostas: 200, 206, 304, 400, 401, 403, 404, 409, 416, 422, 503, 507
Exemplo
curl -X GET "$ARKVORY_URL/api/v1/repositories/$REPOSITORY/packages/content?name=$NAME" \
-H "Authorization: Bearer $ARKVORY_TOKEN" \
-o file