跳到正文

制品与目录 ​

已发布的制品:列表、详细信息、内容、注解、引用、搜索、目录审计及其变更流。

本组中的操作及其访问规则、重试规则、参数和响应。每个请求都需携带密钥:Authorization: Bearer <密钥>(参见“身份验证”)。

操作 ​

获取制品的注解 ​

GET HEAD /api/v1/repositories/{repository}/artifacts/{id}/annotations

访问: 仓库权限:annotation.read; 文件密钥:read · 重试: 可安全重试(读取)

返回已发布制品当前的标签、元数据和集合及其 revision。修订版本 0 表示它们从未被替换过:标签和元数据是创建上传时给出的值,集合为空。将该修订版本作为 expectedRevision 传给 setAnnotations。

参数

名称位置类型必需规则
repository路径string是匹配 ^[a-z0-9][a-z0-9_-]{0,63}$
id路径string (uuid)是—

响应 200

字段类型必需规则
revisioninteger是0–2147483647
labels数组(string)是最多 32 项
metadata映射(string)是最多 32 个条目
collections数组(string)是最多 32 项

响应: 200, 400, 401, 403, 404, 409, 422, 503, 507

示例

bash
curl -X GET "$ARKVORY_URL/api/v1/repositories/$REPOSITORY/artifacts/$ID/annotations" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

替换制品的注解 ​

PUT /api/v1/repositories/{repository}/artifacts/{id}/annotations

访问: 仓库权限:annotation.write, artifact.read; 文件密钥:read, write · 重试: 仅在携带预期修订版本时重试(compare-and-swap)

一次性替换已发布制品的 labels、metadata 和 collections;value 中省略的字段会变为空。expectedRevision 必须是当前修订版本(首次变更时为 0),否则返回 409 revision_mismatch:请重新读取注解,再重新应用变更。最多 32 个标签、32 个集合(每个 1–64 个字母、数字或 _.:-)和 32 个元数据条目(值最长 1024 个字符);字节和原始描述符永远不会改变。

参数

名称位置类型必需规则
repository路径string是匹配 ^[a-z0-9][a-z0-9_-]{0,63}$
id路径string (uuid)是—

请求正文 (application/json)

字段类型必需规则
expectedRevisioninteger是0–2147483646
valueobject是—
value.labels数组(string)否最多 32 项
value.metadata映射(string)否最多 32 个条目
value.collections数组(string)否最多 32 项

响应 200

字段类型必需规则
revisioninteger是0–2147483647
labels数组(string)是最多 32 项
metadata映射(string)是最多 32 个条目
collections数组(string)是最多 32 项

响应: 200, 400, 401, 403, 404, 405, 409, 413, 415, 422, 503, 507

示例

bash
curl -X PUT "$ARKVORY_URL/api/v1/repositories/$REPOSITORY/artifacts/$ID/annotations" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"expectedRevision":0,"value":{}}'

将制品注册为 UPack 包 ​

POST /api/v1/repositories/{repository}/artifacts/{id}/package

访问: 仓库权限:package.publish, artifact.read; 文件密钥:read, write · 重试: 可安全重试:相同的请求效果相同

将已发布的制品作为 UPack ZIP 打开,读取根目录下的 upack.json(name、可选的 group、SemVer version),并为其注册该包版本;不安全或无效的归档会被拒绝并返回 400。版本不可变:再次注册同一个制品会返回相同的条目,而用另一个制品注册已存在的包组、名称和版本(比较时不区分大小写)则返回 409 version_exists。此后该版本会出现在 listPackages 中,并可按名称、版本范围和阶段解析。

参数

名称位置类型必需规则
repository路径string是匹配 ^[a-z0-9][a-z0-9_-]{0,63}$
id路径string (uuid)是—

响应 200

字段类型必需规则
groupstring否—
namestring否—
versionstring否—
artifactIdstring (uuid)否—
manifestobject否—

响应: 200, 400, 401, 403, 404, 405, 409, 422, 503, 507

示例

bash
curl -X POST "$ARKVORY_URL/api/v1/repositories/$REPOSITORY/artifacts/$ID/package" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

搜索制品 ​

GET HEAD /api/v1/repositories/{repository}/search

访问: 仓库权限:artifact.list; 文件密钥:read · 重试: 可安全重试(读取)

按以下条件查找已发布的制品:q(名称或当前元数据值的子串,不区分大小写)、精确匹配的当前 label、collection,以及精确匹配的 metadataKey/metadataValue 键值对(两者须同时提供);所有给出的过滤条件必须同时满足。结果按每页 100 条、按 ID 排序,每项包含大小、创建和发布时间、当前标签和晋级阶段;将 after 设为 next 即可继续。不返回元数据和集合:请用 getAnnotations 读取。

参数

名称位置类型必需规则
repository路径string是匹配 ^[a-z0-9][a-z0-9_-]{0,63}$
q查询string否—
label查询string否—
collection查询string否—
after查询string否—
metadataKey查询string否匹配 ^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$; 最多 64 个字符; Exact metadata key; requires metadataValue.
metadataValue查询string否最多 1024 个字符; Exact case-sensitive value; requires metadataKey. Empty string is allowed.

响应 200

字段类型必需规则
items数组(object)是最多 100 项
items[].idstring (uuid)是—
items[].namestring是—
items[].sizestring是用十进制数字表示的整数,以字符串形式发送; 字节大小,十进制字符串
items[].createdAtstring (date-time)是上传预留时间
items[].publishedAtstring (date-time)是可以为 null; 发布时间;仅在没有记录时为 null
items[].labels数组(string)是最多 32 项; 当前标签:已被替换时取自注解,否则取自上传描述符
items[].stages数组(string)是最多 16 项; 每项:匹配 ^[a-z0-9][a-z0-9_.-]{0,31}$; 当前晋级阶段,按字节顺序排列
nextstring (uuid)是可以为 null; 满页时为最后一个 ID;作为 after 传入

响应: 200, 400, 401, 403, 404, 409, 422, 503, 507

示例

bash
curl -X GET "$ARKVORY_URL/api/v1/repositories/$REPOSITORY/search" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

读取仓库的目录审计 ​

GET HEAD /api/v1/repositories/{repository}/audit

访问: 仓库权限:audit.read; 文件密钥:write · 重试: 可安全重试(读取)

按从旧到新的顺序,返回仓库在序号 after(默认 0)之后的最多 100 条目录变更:发布、删除、注解和附件变更、包注册、文件路径变更、引用、阶段和晋级,每条包含操作者、操作、制品和时间。要继续读取,请将页面中最后一个 sequence 作为 after 传入;没有 next 字段。其中不含下载和登录;镜像使用 listCatalogChanges 来跟进变更,该接口省略操作者。

参数

名称位置类型必需规则
repository路径string是匹配 ^[a-z0-9][a-z0-9_-]{0,63}$
after查询string否—

响应 200

字段类型必需规则
items数组(object)否—
items[].sequencestring否—
items[].actorstring否—
items[].actionstring否—
items[].artifactIdstring否—
items[].occurredAtstring (date-time)否—

响应: 200, 400, 401, 403, 404, 409, 422, 503, 507

示例

bash
curl -X GET "$ARKVORY_URL/api/v1/repositories/$REPOSITORY/audit" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

为制品添加引用 ​

POST /api/v1/repositories/{repository}/artifacts/{id}/references

访问: 仓库权限:reference.write, artifact.read; 文件密钥:read, write · 重试: 可安全重试:相同的请求效果相同

记录 Arkvory 之外的某个对象正在使用此制品,使用您自选的 key(1–256 个字母、数字或 _.:/-),例如某个部署的名称。被引用的制品在所有引用都被移除之前,不能被删除,也不会被保留规则移除。引用属于调用方;用相同的键再次添加不会产生任何变化。

参数

名称位置类型必需规则
repository路径string是匹配 ^[a-z0-9][a-z0-9_-]{0,63}$
id路径string (uuid)是—

请求正文 (application/json)

字段类型必需规则
keystring是最多 256 个字符

响应: 204, 400, 401, 403, 404, 405, 409, 413, 415, 422, 503, 507

示例

bash
curl -X POST "$ARKVORY_URL/api/v1/repositories/$REPOSITORY/artifacts/$ID/references" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"key":"<key>"}'

移除制品的引用 ​

DELETE /api/v1/repositories/{repository}/artifacts/{id}/references

访问: 仓库权限:reference.write, artifact.read; 文件密钥:read, write · 重试: 可安全重试:相同的请求效果相同

从制品中移除调用方自己的引用 key;其他调用方的引用保持不变。移除不存在的键同样会成功。

参数

名称位置类型必需规则
repository路径string是匹配 ^[a-z0-9][a-z0-9_-]{0,63}$
id路径string (uuid)是—

请求正文 (application/json)

字段类型必需规则
keystring是最多 256 个字符

响应: 204, 400, 401, 403, 404, 405, 409, 413, 415, 422, 503, 507

示例

bash
curl -X DELETE "$ARKVORY_URL/api/v1/repositories/$REPOSITORY/artifacts/$ID/references" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"key":"<key>"}'

列出制品 ​

GET HEAD /api/v1/repositories/{repository}/artifacts

访问: 仓库权限:artifact.list; 文件密钥:read · 重试: 可安全重试(读取)

按 ID 排序,列出仓库中已发布的制品,每页 limit 项(1–100,默认 50);将 after 设为 next 即可继续。只要页面已满就会设置 next,因此最后一页可能为空。每项带有上传时给出的描述符;当前的标签和元数据见 getAnnotations。

参数

名称位置类型必需规则
repository路径string是匹配 ^[a-z0-9][a-z0-9_-]{0,63}$
after查询string (uuid)否—
limit查询integer否1–100; 默认值 50

响应 200

字段类型必需规则
items数组(object)否—
items[].idstring (uuid)是—
items[].repositorystring是—
items[].statusstring是取值之一:pending, available, cancelled
items[].createdAtstring (date-time)是—
items[].expiresAtstring (date-time)是—
items[].descriptorobject是—
items[].descriptor.namestring是1–240 个字符
items[].descriptor.sizestring是用十进制数字表示的整数,以字符串形式发送
items[].descriptor.sha256string是SHA-256:64 位小写十六进制数字
items[].descriptor.labels数组(string)否最多 32 项; 每项:最多 64 个字符
items[].descriptor.metadata映射(string)否最多 32 个条目
nextstring否可以为 null

响应: 200, 400, 401, 403, 404, 409, 422, 503, 507

示例

bash
curl -X GET "$ARKVORY_URL/api/v1/repositories/$REPOSITORY/artifacts" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

获取制品 ​

GET HEAD /api/v1/repositories/{repository}/artifacts/{id}

访问: 仓库权限:artifact.read; 文件密钥:read · 重试: 可安全重试(读取)

返回已发布的制品:其 ID、仓库、状态、创建时间,以及上传时给出的描述符(名称、大小、SHA-256、原始标签和元数据)。待完成、已取消和已删除的制品返回 404。要读取字节,请使用 downloadArtifact。

参数

名称位置类型必需规则
repository路径string是匹配 ^[a-z0-9][a-z0-9_-]{0,63}$
id路径string (uuid)是—

响应 200

字段类型必需规则
idstring (uuid)是—
repositorystring是—
statusstring是取值之一:pending, available, cancelled
createdAtstring (date-time)是—
expiresAtstring (date-time)是—
descriptorobject是—
descriptor.namestring是1–240 个字符
descriptor.sizestring是用十进制数字表示的整数,以字符串形式发送
descriptor.sha256string是SHA-256:64 位小写十六进制数字
descriptor.labels数组(string)否最多 32 项; 每项:最多 64 个字符
descriptor.metadata映射(string)否最多 32 个条目

响应: 200, 400, 401, 403, 404, 409, 422, 503, 507

示例

bash
curl -X GET "$ARKVORY_URL/api/v1/repositories/$REPOSITORY/artifacts/$ID" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

删除制品 ​

DELETE /api/v1/repositories/{repository}/artifacts/{id}

访问: 仓库权限:artifact.delete · 重试: 可安全重试:相同的请求效果相同

逻辑删除已发布的制品:它会立即从列表、搜索和下载中消失,其字节在宽限期后由仓库的在线物理清理(setCleanup,默认关闭)回收。expectedAnnotationRevision 必须等于当前的注解修订版本。响应为 200,带有 outcome:deleted、already_deleted、changed(修订版本不同)、not_found,或 protected 并附带阻止删除的 blockers(引用、文件路径修订版本、构建附件或晋级阶段)。请事先用 inspectArtifactDeletion 检查。

参数

名称位置类型必需规则
repository路径string是匹配 ^[a-z0-9][a-z0-9_-]{0,63}$
id路径string (uuid)是—

请求正文 (application/json)

字段类型必需规则
expectedAnnotationRevisioninteger是0–2147483647

响应 200

字段类型必需规则
idstring (uuid)是—
outcomestring是取值之一:deleted, already_deleted, protected, changed, not_eligible, not_found
blockers数组(string)是最多 4 项; 不允许重复项; 每项:取值之一:reference, asset_history, attachment_history, protected_label, promotion_stage

响应: 200, 400, 401, 403, 404, 405, 409, 413, 415, 422, 503, 507

示例

bash
curl -X DELETE "$ARKVORY_URL/api/v1/repositories/$REPOSITORY/artifacts/$ID" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"expectedAnnotationRevision":0}'

下载制品 ​

GET HEAD /api/v1/repositories/{repository}/artifacts/{id}/content

访问: 仓库权限:content.read; 文件密钥:read · 重试: 可安全重试(读取)

以流式返回原始字节,附带 Content-Length、Content-Disposition(制品名称)和强 ETag("sha256:<hex>")。单个 Range 返回 206(无法满足时返回 416);带 ETag 的 If-Range 可安全续传,If-None-Match 返回 304。HEAD 返回相同的响应头但没有响应体,并忽略 Range。请求也可以不带 Authorization 头,而是把 createDownloadLink 生成的下载链接作为 token 携带;下载会等待服务器下载准入的空闲槽位。

参数

名称位置类型必需规则
repository路径string是匹配 ^[a-z0-9][a-z0-9_-]{0,63}$
id路径string (uuid)是—
Range标头string否—
If-Range标头string否—
If-None-Match标头string否—
Arkvory-Download-Id标头string否匹配 ^[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标头string否最多 80 个字符; 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标头string否取值之一: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.
token查询string否匹配 ^dtl_[A-Za-z0-9_-]{43}$; Download link from POST …/artifacts/{id}/links, instead of an Authorization header

响应: 200, 206, 304, 400, 401, 403, 404, 409, 416, 422, 503, 507

示例

bash
curl -X GET "$ARKVORY_URL/api/v1/repositories/$REPOSITORY/artifacts/$ID/content" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -o file

读取站点概览 ​

GET HEAD /api/v1/fleet/overview

访问: 管理员 · 重试: 可安全重试(读取)

受管站点和本安装的告警,最严重的在前(critical、warning、info),以及它们之间的镜像关联。根据最近的后台读取构建,最多每 5 秒一次。没有受管站点在其地址上应答的源记为 external:<origin>;本安装为 self,只有设置了 ARKVORY_SITE_URL 时才会出现指向它的关联。仅由写入进程应答。

响应 200

字段类型必需规则
generatedAtstring (date-time)是—
selfobject是—
self.namestring是—
self.versionstring是—
self.urlstring是可以为 null
alerts数组(object)是—
alerts[].sitestring是—
alerts[].namestring是—
alerts[].kindstring是取值之一:unreachable, certificate, revoked, refused, invalid, stale, not-writable, copies, single-copy, mirror-failing, mirror-lag, updates-failed, version-skew
alerts[].severitystring是取值之一:critical, warning, info
alerts[].subjectstring是可以为 null
alerts[].sincestring (date-time)是可以为 null
links数组(object)是—
links[].fromstring是—
links[].tostring是—
links[].repositorystring是—
links[].sourceRepositorystring是—
links[].modestring是取值之一:mirror, import
links[].lagChangesstring是用十进制数字表示的整数,以字符串形式发送; 可以为 null
links[].failingboolean是—
links[].staleboolean否—
external数组(string)是—

响应: 200, 400, 401, 403, 404, 409, 422, 503, 507

示例

bash
curl -X GET "$ARKVORY_URL/api/v1/fleet/overview" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

列出受管站点 ​

GET HEAD /api/v1/fleet/sites

访问: 管理员 · 重试: 可安全重试(读取)

列出本安装管理的站点(ADR 0077)及每个站点最后报告的内容:state(ok,或未能读取的原因:unreachable、certificate、revoked、invalid、refused)、最后一次可见的时间以及最后的 topology。站点每 30 秒在后台读取一次。从不返回站点密钥。

响应 200

字段类型必需规则
items数组(object)是最多 256 项
items[].idstring (uuid)是—
items[].namestring是—
items[].urlstring是—
items[].fingerprintstring是匹配 ^[0-9a-f]{64}$; 可以为 null
items[].addedBystring是—
items[].addedAtstring (date-time)是—
items[].seenAtstring (date-time)是可以为 null
items[].statestring是取值之一:pending, ok, unreachable, certificate, revoked, invalid, refused
items[].errorstring是可以为 null
items[].topologyobject是可以为 null
items[].topology.collectedAtstring (date-time)是—
items[].topology.siteobject是—
items[].topology.healthobject是—
items[].topology.replicationobject是可以为 null
items[].topology.gateways数组(object)是最多 16 项
items[].topology.mirrors数组(object)是最多 64 项
items[].topology.updatesobject是可以为 null
items[].topology.downloadsobject是—

响应: 200, 400, 401, 403, 404, 409, 422, 503, 507

示例

bash
curl -X GET "$ARKVORY_URL/api/v1/fleet/sites" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

与站点配对 ​

POST /api/v1/fleet/sites

访问: 管理员 · 重试: 请勿自动重试

与站点配对:控制站点重新连接,证书必须仍具有管理员确认的 fingerprint(loopback 上的 HTTP 为 null),在站点上生成的配对 code 被换成密钥,密钥用 ARKVORY_FLEET_KEY_FILE 封存。应答前读取一次站点。没有密钥文件时应答 503。

请求正文 (application/json)

字段类型必需规则
urlstring是—
fingerprintstring是匹配 ^[0-9a-f]{64}$; 可以为 null
codestring是最多 32 个字符

响应 201

字段类型必需规则
idstring (uuid)是—
namestring是—
urlstring是—
fingerprintstring是匹配 ^[0-9a-f]{64}$; 可以为 null
addedBystring是—
addedAtstring (date-time)是—
seenAtstring (date-time)是可以为 null
statestring是取值之一:pending, ok, unreachable, certificate, revoked, invalid, refused
errorstring是可以为 null
topologyobject是可以为 null
topology.collectedAtstring (date-time)是—
topology.siteobject是—
topology.site.namestring是—
topology.site.versionstring是—
topology.site.schemainteger是不小于 0
topology.site.rolestring是取值之一:api, reader
topology.healthobject是—
topology.health.availableboolean是—
topology.health.writableboolean是—
topology.health.drainingboolean是—
topology.replicationobject是可以为 null
topology.replication.copiesinteger是0–16
topology.replication.requiredinteger是1–16
topology.replication.singleCopyUntilstring (date-time)是可以为 null
topology.replication.nodestring否最多 63 个字符
topology.replication.profilestring否取值之一:ha-2, ha-3
topology.replication.peers数组(object)否最多 16 项
topology.gateways数组(object)是最多 16 项
topology.gateways[].slotinteger是不小于 0
topology.gateways[].activeboolean是—
topology.gateways[].expiresAtstring (date-time)是—
topology.mirrors数组(object)是最多 64 项
topology.mirrors[].repositorystring是—
topology.mirrors[].modestring是取值之一:mirror, import
topology.mirrors[].upstreamstring是—
topology.mirrors[].sourceRepositorystring是—
topology.mirrors[].phasestring是—
topology.mirrors[].errorCodestring是可以为 null
topology.mirrors[].checkedAtstring (date-time)是可以为 null
topology.mirrors[].syncedAtstring (date-time)是可以为 null
topology.mirrors[].lagChangesstring是用十进制数字表示的整数,以字符串形式发送; 可以为 null
topology.mirrors[].copiedArtifactsinteger是不小于 0
topology.mirrors[].copiedBytesstring是用十进制数字表示的整数,以字符串形式发送
topology.updatesobject是可以为 null
topology.updates.currentVersionstring是—
topology.updates.lateststring是可以为 null
topology.updates.phasestring是—
topology.updates.errorstring是可以为 null
topology.updates.automaticboolean是—
topology.updates.heartbeatAtstring (date-time)是—
topology.downloadsobject是—
topology.downloads.strategystring是取值之一:ordered, smallest-first, shared
topology.downloads.sessionsinteger是不小于 0
topology.downloads.activeinteger是不小于 0
topology.downloads.waitinginteger是不小于 0
topology.downloads.oldestWaitSecondsinteger是不小于 0
topology.downloads.bytesPerSecondinteger是不小于 0

响应: 201, 400, 401, 403, 404, 405, 409, 413, 415, 422, 503, 507

示例

bash
curl -X POST "$ARKVORY_URL/api/v1/fleet/sites" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"<url>","fingerprint":"<fingerprint>","code":"<code>"}'

读取站点证书 ​

POST /api/v1/fleet/sites/probe

访问: 管理员 · 重试: 可安全重试:相同的请求效果相同

连接到该地址并读取站点出示的证书,不发送任何内容:配对前将其 fingerprint 与站点管理员看到的指纹进行比较。

请求正文 (application/json)

字段类型必需规则
urlstring是—

响应 200

字段类型必需规则
urlstring是—
certificateobject是可以为 null
certificate.fingerprintstring是匹配 ^[0-9a-f]{64}$
certificate.subjectstring是—
certificate.issuerstring是—
certificate.validTostring (date-time)是—

响应: 200, 400, 401, 403, 404, 405, 409, 413, 415, 422, 503, 507

示例

bash
curl -X POST "$ARKVORY_URL/api/v1/fleet/sites/probe" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"<url>"}'

忘记站点 ​

DELETE /api/v1/fleet/sites/{id}

访问: 管理员 · 重试: 可安全重试:相同的请求效果相同

在此处删除站点及其封存的密钥。也请在站点上撤销此控制站点;在此之前密钥在那里仍然有效。

参数

名称位置类型必需规则
id路径string (uuid)是—

响应: 204, 400, 401, 403, 404, 405, 409, 422, 503, 507

示例

bash
curl -X DELETE "$ARKVORY_URL/api/v1/fleet/sites/$ID" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

读取站点目录 ​

GET HEAD /api/v1/fleet/sites/{id}/read

访问: 管理员 · 重试: 可安全重试(读取)

将一次目录读取转发给受管站点,并原样返回其应答:仓库、搜索、制品、注释、阶段、包、文件页面和历史、存储用量、镜像状态。path 是站点路由及其查询。其他路由和文件字节以 400 拒绝。

参数

名称位置类型必需规则
id路径string (uuid)是—
path查询string是匹配 ^/api/v1/; 最多 2048 个字符; A read route of the site with its query, from a fixed list: catalog metadata (repositories, search, artifacts, annotations, stages, packages, file pages and history, storage usage, mirror state), download queue settings and update state. Never file bytes.

响应: 200, 400, 401, 403, 404, 409, 422, 503, 507

示例

bash
curl -X GET "$ARKVORY_URL/api/v1/fleet/sites/$ID/read?path=$PATH" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

更改站点的设置 ​

POST /api/v1/fleet/sites/{id}/change

访问: 管理员 · 重试: 请勿自动重试

将一次更改转发给受管站点,并原样返回其应答。path 为以下路由之一:/api/v1/system/downloads/settings(下载队列设置,以 PUT 发送)或 /api/v1/system/updates/requests(更新请求,以 POST 发送)。请求体原样发送到站点;站点检查修订号或请求 id,因此重复的更改不会应用两次。其他路径以 400 拒绝。

参数

名称位置类型必需规则
id路径string (uuid)是—
path查询string是匹配 ^/api/v1/; 最多 2048 个字符; A change route of the site, from a fixed list: PUT /api/v1/system/downloads/settings, POST /api/v1/system/updates/requests.

请求正文 (application/json)

响应: 200, 202, 400, 401, 403, 404, 405, 409, 413, 415, 422, 503, 507

示例

bash
curl -X POST "$ARKVORY_URL/api/v1/fleet/sites/$ID/change?path=$PATH" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

立即读取站点 ​

POST /api/v1/fleet/sites/{id}/refresh

访问: 管理员 · 重试: 可安全重试:相同的请求效果相同

立即读取站点而不等待下一轮,并返回其新状态。

参数

名称位置类型必需规则
id路径string (uuid)是—

响应 200

字段类型必需规则
idstring (uuid)是—
namestring是—
urlstring是—
fingerprintstring是匹配 ^[0-9a-f]{64}$; 可以为 null
addedBystring是—
addedAtstring (date-time)是—
seenAtstring (date-time)是可以为 null
statestring是取值之一:pending, ok, unreachable, certificate, revoked, invalid, refused
errorstring是可以为 null
topologyobject是可以为 null
topology.collectedAtstring (date-time)是—
topology.siteobject是—
topology.site.namestring是—
topology.site.versionstring是—
topology.site.schemainteger是不小于 0
topology.site.rolestring是取值之一:api, reader
topology.healthobject是—
topology.health.availableboolean是—
topology.health.writableboolean是—
topology.health.drainingboolean是—
topology.replicationobject是可以为 null
topology.replication.copiesinteger是0–16
topology.replication.requiredinteger是1–16
topology.replication.singleCopyUntilstring (date-time)是可以为 null
topology.replication.nodestring否最多 63 个字符
topology.replication.profilestring否取值之一:ha-2, ha-3
topology.replication.peers数组(object)否最多 16 项
topology.gateways数组(object)是最多 16 项
topology.gateways[].slotinteger是不小于 0
topology.gateways[].activeboolean是—
topology.gateways[].expiresAtstring (date-time)是—
topology.mirrors数组(object)是最多 64 项
topology.mirrors[].repositorystring是—
topology.mirrors[].modestring是取值之一:mirror, import
topology.mirrors[].upstreamstring是—
topology.mirrors[].sourceRepositorystring是—
topology.mirrors[].phasestring是—
topology.mirrors[].errorCodestring是可以为 null
topology.mirrors[].checkedAtstring (date-time)是可以为 null
topology.mirrors[].syncedAtstring (date-time)是可以为 null
topology.mirrors[].lagChangesstring是用十进制数字表示的整数,以字符串形式发送; 可以为 null
topology.mirrors[].copiedArtifactsinteger是不小于 0
topology.mirrors[].copiedBytesstring是用十进制数字表示的整数,以字符串形式发送
topology.updatesobject是可以为 null
topology.updates.currentVersionstring是—
topology.updates.lateststring是可以为 null
topology.updates.phasestring是—
topology.updates.errorstring是可以为 null
topology.updates.automaticboolean是—
topology.updates.heartbeatAtstring (date-time)是—
topology.downloadsobject是—
topology.downloads.strategystring是取值之一:ordered, smallest-first, shared
topology.downloads.sessionsinteger是不小于 0
topology.downloads.activeinteger是不小于 0
topology.downloads.waitinginteger是不小于 0
topology.downloads.oldestWaitSecondsinteger是不小于 0
topology.downloads.bytesPerSecondinteger是不小于 0

响应: 200, 400, 401, 403, 404, 405, 409, 422, 503, 507

示例

bash
curl -X POST "$ARKVORY_URL/api/v1/fleet/sites/$ID/refresh" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

创建配对码 ​

POST /api/v1/system/fleet/pairings

访问: 管理员 · 重试: 请勿自动重试

创建一个一次性、十分钟有效的代码,控制站点的管理员输入它即可管理本站点。代码只显示一次,只以哈希形式保存。只有站点的全局管理员可以创建。

响应 201

字段类型必需规则
codestring是匹配 ^[0-9A-Z]{4}-[0-9A-Z]{4}-[0-9A-Z]{4}$
expiresAtstring (date-time)是—
fingerprintstring是匹配 ^[0-9a-f]{64}$; 可以为 null

响应: 201, 400, 401, 403, 404, 405, 409, 422, 503, 507

示例

bash
curl -X POST "$ARKVORY_URL/api/v1/system/fleet/pairings" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

列出本站点的控制站点 ​

GET HEAD /api/v1/system/fleet/controllers

访问: 管理员 · 重试: 可安全重试(读取)

列出可以管理本站点的控制站点:名称、由谁配对、何时配对,以及其密钥最后一次使用的时间。

响应 200

字段类型必需规则
items数组(object)是最多 100 项
items[].idstring (uuid)是—
items[].namestring是—
items[].pairedBystring是—
items[].pairedAtstring (date-time)是—
items[].usedAtstring (date-time)是可以为 null

响应: 200, 400, 401, 403, 404, 409, 422, 503, 507

示例

bash
curl -X GET "$ARKVORY_URL/api/v1/system/fleet/controllers" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

撤销控制站点 ​

DELETE /api/v1/system/fleet/controllers/{id}

访问: 管理员 · 重试: 可安全重试:相同的请求效果相同

撤销一个控制站点:其集群密钥立即被拒绝。要再次管理本站点,必须用新代码重新配对。

参数

名称位置类型必需规则
id路径string (uuid)是—

响应: 204, 400, 401, 403, 404, 405, 409, 422, 503, 507

示例

bash
curl -X DELETE "$ARKVORY_URL/api/v1/system/fleet/controllers/$ID" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

与控制站点配对 ​

POST /api/v1/system/fleet/enrollment

访问: 任何人,无需密钥 · 重试: 请勿自动重试

用一个有效的配对码一次性换取集群密钥。控制站点通过固定在管理员确认的指纹上的 TLS 调用它。密钥只返回一次,只能访问控制站点所需的路由。

请求正文 (application/json)

字段类型必需规则
codestring是最多 32 个字符
namestring是1–63 个字符

响应 201

字段类型必需规则
keystring是匹配 ^afk_[A-Za-z0-9_-]{43}$
siteobject是—
site.namestring是—
site.versionstring是—

响应: 201, 400, 403, 405, 413, 415, 503

示例

bash
curl -X POST "$ARKVORY_URL/api/v1/system/fleet/enrollment" \
  -H "Content-Type: application/json" \
  -d '{"code":"<code>","name":"<name>"}'

获取本站点供集群控制台使用 ​

GET HEAD /api/v1/system/topology

访问: 管理员 · 重试: 可安全重试(读取)

把本安装作为集群中的一个站点返回(ADR 0077):名称、版本、架构和角色,是否可用、是否可写,HA 副本和节点,按租约列出的只读网关,每个镜像和导入及其阶段、最后同步时间和 lagChanges(源中尚未应用的变更),更新代理状态和下载队列。只有站点的全局管理员或已配对的控制站点可以读取。

响应 200

字段类型必需规则
collectedAtstring (date-time)是—
siteobject是—
site.namestring是—
site.versionstring是—
site.schemainteger是不小于 0
site.rolestring是取值之一:api, reader
healthobject是—
health.availableboolean是—
health.writableboolean是—
health.drainingboolean是—
replicationobject是可以为 null
replication.copiesinteger是0–16
replication.requiredinteger是1–16
replication.singleCopyUntilstring (date-time)是可以为 null
replication.nodestring否最多 63 个字符
replication.profilestring否取值之一:ha-2, ha-3
replication.peers数组(object)否最多 16 项
replication.peers[].namestring是最多 63 个字符
replication.peers[].connectedboolean是—
replication.peers[].diskstring是最多 24 个字符
replication.peers[].completeboolean是—
replication.peers[].witnessboolean是—
gateways数组(object)是最多 16 项
gateways[].slotinteger是不小于 0
gateways[].activeboolean是—
gateways[].expiresAtstring (date-time)是—
mirrors数组(object)是最多 64 项
mirrors[].repositorystring是—
mirrors[].modestring是取值之一:mirror, import
mirrors[].upstreamstring是—
mirrors[].sourceRepositorystring是—
mirrors[].phasestring是—
mirrors[].errorCodestring是可以为 null
mirrors[].checkedAtstring (date-time)是可以为 null
mirrors[].syncedAtstring (date-time)是可以为 null
mirrors[].lagChangesstring是用十进制数字表示的整数,以字符串形式发送; 可以为 null
mirrors[].copiedArtifactsinteger是不小于 0
mirrors[].copiedBytesstring是用十进制数字表示的整数,以字符串形式发送
updatesobject是可以为 null
updates.currentVersionstring是—
updates.lateststring是可以为 null
updates.phasestring是—
updates.errorstring是可以为 null
updates.automaticboolean是—
updates.heartbeatAtstring (date-time)是—
downloadsobject是—
downloads.strategystring是取值之一:ordered, smallest-first, shared
downloads.sessionsinteger是不小于 0
downloads.activeinteger是不小于 0
downloads.waitinginteger是不小于 0
downloads.oldestWaitSecondsinteger是不小于 0
downloads.bytesPerSecondinteger是不小于 0

响应: 200, 400, 401, 403, 404, 409, 422, 503, 507

示例

bash
curl -X GET "$ARKVORY_URL/api/v1/system/topology" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

读取下载队列设置 ​

GET HEAD /api/v1/system/downloads/settings

访问: 管理员 · 重试: 可安全重试(读取)

返回已更改的值(overrides)、服务器环境设定的值(defaults)以及队列当前使用的值(effective),并附带更改时需传回的修订号。problem 说明已保存的设置为何不适用于此服务器;此时队列按默认值运行。

响应 200

字段类型必需规则
revisioninteger是0–9007199254740991
overridesobject是—
overrides.strategystring否取值之一:ordered, smallest-first, shared
overrides.sessionsinteger否1–1024
overrides.reserveinteger否0–1023
overrides.perPrincipalinteger否1–1024
overrides.weightsobject否—
overrides.weights.interactiveinteger是1–1000
overrides.weights.releaseinteger是1–1000
overrides.weights.bulkinteger是1–1000
overrides.weights.backgroundinteger是1–1000
overrides.sessionMinBytesinteger否0–9007199254740991
overrides.idleSecondsinteger否1–3600
overrides.agingMinutesinteger否0–10080
overrides.preemptboolean否—
overrides.rangesPerSessioninteger否1–64
defaultsobject是—
defaults.strategystring是取值之一:ordered, smallest-first, shared
defaults.sessionsinteger是1–1024
defaults.reserveinteger是0–1023
defaults.perPrincipalinteger是1–1024
defaults.weightsobject是—
defaults.weights.interactiveinteger是1–1000
defaults.weights.releaseinteger是1–1000
defaults.weights.bulkinteger是1–1000
defaults.weights.backgroundinteger是1–1000
defaults.sessionMinBytesinteger是0–9007199254740991
defaults.idleSecondsinteger是1–3600
defaults.agingMinutesinteger是0–10080
defaults.preemptboolean是—
defaults.rangesPerSessioninteger是1–64
effectiveobject是—
effective.strategystring是取值之一:ordered, smallest-first, shared
effective.sessionsinteger是1–1024
effective.reserveinteger是0–1023
effective.perPrincipalinteger是1–1024
effective.weightsobject是—
effective.weights.interactiveinteger是1–1000
effective.weights.releaseinteger是1–1000
effective.weights.bulkinteger是1–1000
effective.weights.backgroundinteger是1–1000
effective.sessionMinBytesinteger是0–9007199254740991
effective.idleSecondsinteger是1–3600
effective.agingMinutesinteger是0–10080
effective.preemptboolean是—
effective.rangesPerSessioninteger是1–64
admissionstring是取值之一:sessions, per-request
updatedAtstring (date-time)是可以为 null
updatedBystring是可以为 null
actorstring是可以为 null
problemstring是可以为 null

响应: 200, 400, 401, 403, 404, 409, 422, 503, 507

示例

bash
curl -X GET "$ARKVORY_URL/api/v1/system/downloads/settings" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

更改下载队列设置 ​

PUT /api/v1/system/downloads/settings

访问: 管理员 · 重试: 仅在携带预期修订版本时重试(compare-and-swap)

将 overrides 保存在服务器环境之上,并在不重启的情况下应用:新的决策立即遵循它们,正在进行的下载保留其位置。所给的值替换之前的所有更改;{} 恢复为环境值。无法在此运行的设置以 400 拒绝并指出字段;过期的 expectedRevision 得到 409。只读网关保留其环境。

请求正文 (application/json)

字段类型必需规则
expectedRevisioninteger是0–9007199254740991
overridesobject是—
overrides.strategystring否取值之一:ordered, smallest-first, shared
overrides.sessionsinteger否1–1024
overrides.reserveinteger否0–1023
overrides.perPrincipalinteger否1–1024
overrides.weightsobject否—
overrides.weights.interactiveinteger是1–1000
overrides.weights.releaseinteger是1–1000
overrides.weights.bulkinteger是1–1000
overrides.weights.backgroundinteger是1–1000
overrides.sessionMinBytesinteger否0–9007199254740991
overrides.idleSecondsinteger否1–3600
overrides.agingMinutesinteger否0–10080
overrides.preemptboolean否—
overrides.rangesPerSessioninteger否1–64

响应 200

字段类型必需规则
revisioninteger是0–9007199254740991
overridesobject是—
overrides.strategystring否取值之一:ordered, smallest-first, shared
overrides.sessionsinteger否1–1024
overrides.reserveinteger否0–1023
overrides.perPrincipalinteger否1–1024
overrides.weightsobject否—
overrides.weights.interactiveinteger是1–1000
overrides.weights.releaseinteger是1–1000
overrides.weights.bulkinteger是1–1000
overrides.weights.backgroundinteger是1–1000
overrides.sessionMinBytesinteger否0–9007199254740991
overrides.idleSecondsinteger否1–3600
overrides.agingMinutesinteger否0–10080
overrides.preemptboolean否—
overrides.rangesPerSessioninteger否1–64
defaultsobject是—
defaults.strategystring是取值之一:ordered, smallest-first, shared
defaults.sessionsinteger是1–1024
defaults.reserveinteger是0–1023
defaults.perPrincipalinteger是1–1024
defaults.weightsobject是—
defaults.weights.interactiveinteger是1–1000
defaults.weights.releaseinteger是1–1000
defaults.weights.bulkinteger是1–1000
defaults.weights.backgroundinteger是1–1000
defaults.sessionMinBytesinteger是0–9007199254740991
defaults.idleSecondsinteger是1–3600
defaults.agingMinutesinteger是0–10080
defaults.preemptboolean是—
defaults.rangesPerSessioninteger是1–64
effectiveobject是—
effective.strategystring是取值之一:ordered, smallest-first, shared
effective.sessionsinteger是1–1024
effective.reserveinteger是0–1023
effective.perPrincipalinteger是1–1024
effective.weightsobject是—
effective.weights.interactiveinteger是1–1000
effective.weights.releaseinteger是1–1000
effective.weights.bulkinteger是1–1000
effective.weights.backgroundinteger是1–1000
effective.sessionMinBytesinteger是0–9007199254740991
effective.idleSecondsinteger是1–3600
effective.agingMinutesinteger是0–10080
effective.preemptboolean是—
effective.rangesPerSessioninteger是1–64
admissionstring是取值之一:sessions, per-request
updatedAtstring (date-time)是可以为 null
updatedBystring是可以为 null
actorstring是可以为 null
problemstring是可以为 null

响应: 200, 400, 401, 403, 404, 405, 409, 413, 415, 422, 503, 507

示例

bash
curl -X PUT "$ARKVORY_URL/api/v1/system/downloads/settings" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"expectedRevision":0,"overrides":{}}'

读取站点更改 ​

GET HEAD /api/v1/system/changes

访问: 管理员 · 重试: 可安全重试(读取)

返回站点代理是否在报告(agent)、待处理的请求以及最近 20 个请求及其状态:pending、applying、done 或附带原因的 failed。源密钥从不出现在这里。

响应 200

字段类型必需规则
agentboolean是—
updatingboolean是—
blockedstring是取值之一:expired, interrupted, key_missing, not_a_mirror, already_attached, mirror_failed, switchover_failed, single_copy_failed, unreadable, digest_mismatch, null; 可以为 null
pendingobject是可以为 null
pending.idstring (uuid)是—
pending.kindstring是取值之一:mirror-attach, mirror-key, mirror-detach, cluster-switchover, single-copy
pending.actorstring是最多 200 个字符
pending.requestedAtstring (date-time)是—
recent数组(object)是最多 20 项
recent[].idstring (uuid)是—
recent[].digeststring是匹配 ^[0-9a-f]{64}$
recent[].kindstring是取值之一:mirror-attach, mirror-key, mirror-detach, cluster-switchover, single-copy
recent[].statestring是取值之一:pending, applying, done, failed
recent[].errorstring是取值之一:expired, interrupted, key_missing, not_a_mirror, already_attached, mirror_failed, switchover_failed, single_copy_failed, unreadable, digest_mismatch, null; 可以为 null
recent[].actorstring是最多 200 个字符
recent[].requestedAtstring (date-time)是—
recent[].finishedAtstring (date-time)是可以为 null

响应: 200, 400, 401, 403, 404, 409, 422, 503, 507

示例

bash
curl -X GET "$ARKVORY_URL/api/v1/system/changes" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

将站点更改加入队列 ​

POST /api/v1/system/changes

访问: 管理员 · 重试: 可安全重试:相同的请求效果相同

为站点代理加入一项更改,代理在一分钟内以 arkvory configure 和 cluster-* 的检查与回滚应用它:连接镜像或导入、替换其源密钥、断开镜像、切换活动 HA 节点(节点名称输入两次)或决定单副本写入。id 由客户端选择;重复它不会再次加入队列。key 仅用于 mirror-attach 和 mirror-key 的源密钥:它以单独的 0600 文件交给代理,永不返回。202 表示已入队,而非已应用。

请求正文 (application/json)

字段类型必需规则
idstring (uuid)是—
changeobject是—
change.kindstring是取值之一:mirror-attach
change.repositorystring是匹配 ^[a-z0-9][a-z0-9_-]{0,63}$
change.upstreamstring是最多 255 个字符
change.sourceRepositorystring是匹配 ^[a-z0-9][a-z0-9_-]{0,63}$
change.stages数组(string)否1–16 项; 每项:匹配 ^[a-z0-9][a-z0-9_.-]{0,31}$; 可以为 null
change.repositories数组(string)是1–64 项; 每项:匹配 ^[a-z0-9][a-z0-9_-]{0,63}$
change.nodestring是匹配 ^[A-Za-z0-9][A-Za-z0-9_.-]{0,62}$
change.confirmstring是匹配 ^[A-Za-z0-9][A-Za-z0-9_.-]{0,62}$
change.untilstring (date-time)是可以为 null
change.reasonstring是1–200 个字符
keystring否16–4000 个字符

响应 202

字段类型必需规则
idstring (uuid)是—

响应: 202, 400, 401, 403, 404, 405, 409, 413, 415, 422, 503, 507

示例

bash
curl -X POST "$ARKVORY_URL/api/v1/system/changes" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"id":"00000000-0000-4000-8000-000000000000","change":{"kind":"mirror-attach","repository":"<repository>","upstream":"<upstream>","sourceRepository":"<sourceRepository>"}}'

跟踪仓库的变更流 ​

GET HEAD /api/v1/repositories/{repository}/changes

访问: 仓库权限:artifact.list; 文件密钥:read · 重试: 可安全重试(读取)

按提交顺序,返回序号 after(默认 0)之后的最多 limit 条变更(1–100,默认 100):操作、制品,以及对文件路径和阶段而言,在 detail 中给出的路径或阶段;不包含操作者,因此有列出权限即可。head 是仓库最新的序号,next 是下一页的游标,页面到达 head 时为 null。镜像会保存它最后应用的序号并从那里开始轮询。

参数

名称位置类型必需规则
repository路径string是匹配 ^[a-z0-9][a-z0-9_-]{0,63}$
after查询string否用十进制数字表示的整数,以字符串形式发送; Sequence cursor, default 0
limit查询integer否1–100

响应 200

字段类型必需规则
items数组(object)是—
items[].sequencestring是用十进制数字表示的整数,以字符串形式发送
items[].actionstring是—
items[].artifactIdstring (uuid)是—
items[].detailstring是可以为 null
headstring是用十进制数字表示的整数,以字符串形式发送
nextstring是用十进制数字表示的整数,以字符串形式发送; 可以为 null

响应: 200, 400, 401, 403, 404, 409, 422, 503, 507

示例

bash
curl -X GET "$ARKVORY_URL/api/v1/repositories/$REPOSITORY/changes" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

POST /api/v1/repositories/{repository}/artifacts/{id}/links

访问: 仓库权限:content.read; 文件密钥:read · 重试: 请勿自动重试

返回机密 token、相对于 API 源的 url 和 expiresAt,可在不带密钥的情况下对这一个制品调用 downloadArtifact;ttlSeconds 设置有效期(60 秒到一天,默认一小时)。令牌只在本次响应中显示,且无法撤销:它在过期或制品被删除后失效,通过它进行的下载计入创建者的传输限制。一个调用方最多可持有 1000 个有效链接(507 token_limit),下载链接不能再创建其他链接。

参数

名称位置类型必需规则
repository路径string是匹配 ^[a-z0-9][a-z0-9_-]{0,63}$
id路径string (uuid)是—

请求正文 (application/json)

字段类型必需规则
ttlSecondsinteger否60–86400; 默认值 3600

响应 201

字段类型必需规则
tokenstring是匹配 ^dtl_[A-Za-z0-9_-]{43}$
urlstring是—
expiresAtstring (date-time)是—

响应: 201, 400, 401, 403, 404, 405, 409, 413, 415, 422, 503, 507

示例

bash
curl -X POST "$ARKVORY_URL/api/v1/repositories/$REPOSITORY/artifacts/$ID/links" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Arkvory · ProAnimaStudio