本文へスキップ

ストレージポリシーと保持 ​

クォータ、使用量、保持ポリシーとそのプレビューおよび実行、クリーンアップ、アーティファクトの削除。

このグループの操作と、それぞれのアクセスルール、再試行ルール、パラメーター、レスポンスです。すべてのリクエストにはキーを付けます:Authorization: Bearer <key>(「認証」を参照)。

操作 ​

アーティファクトを削除できるかの確認 ​

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

アクセス: リポジトリ権限:artifact.delete · 再試行: 再試行しても安全(読み取り)

アーティファクトの名前、サイズ、公開時刻、現在のannotationRevision、および削除を妨げるblockersを返します。blockersは、reference(外部からの参照、またはコンテナイメージ、Git LFS、npmによる使用)、asset_history(現在または以前のファイルパスのリビジョン)、attachment_history、promotion_stageのいずれかです。何も変更されません。このリビジョンをdeleteArtifactのexpectedAnnotationRevisionとして渡してください。

パラメーター

名前場所型必須ルール
repositoryパスstringはい^[a-z0-9][a-z0-9_-]{0,63}$に一致
idパスstring (uuid)はい—

レスポンス 200

フィールド型必須ルール
idstring (uuid)はい—
namestringはい1~240文字
sizestringはい10進数字で表した整数(文字列として送信)
publishedAtstring (date-time)はい—
annotationRevisionintegerはい0~2147483647
blockersstringの配列はい4個以内の要素; 要素の重複なし; 各要素:次のいずれか:reference, asset_history, attachment_history, protected_label, promotion_stage

レスポンス: 200, 400, 401, 403, 404, 409, 422, 503, 507

例

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

保持ルールによる削除候補のプレビュー ​

POST /api/v1/repositories/{repository}/retention/preview

アクセス: リポジトリ権限:artifact.delete · 再試行: 再試行しても安全(読み取り)

criteria.publishedBefore(ミリ秒を含む過去のUTC時刻)より前に公開された公開済みアーティファクトをID順に列挙します。各項目にはアノテーションのリビジョンと削除を妨げるものが含まれ、protected_labelはcriteria.protectedLabels(最大32個までの明示的なリスト)のいずれかに該当することを意味します。ページにはlimit件(1〜100、既定は50)が含まれ、続きはafterにnextを設定して取得します。何も予約されません。削除する項目を選び、リビジョンとともにapplyRetentionに渡してください。そこで改めて確認されます。

パラメーター

名前場所型必須ルール
repositoryパスstringはい^[a-z0-9][a-z0-9_-]{0,63}$に一致

リクエスト本文 (application/json)

フィールド型必須ルール
criteriaobjectはい—
criteria.publishedBeforestring (date-time)はい^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d{3}Z$に一致
criteria.protectedLabelsstringの配列はい32個以内の要素; 要素の重複なし; 各要素:1~64文字
limitintegerいいえ1~100
afterstring (uuid)いいえ—

レスポンス 200

フィールド型必須ルール
itemsobjectの配列はい100個以内の要素
items[].idstring (uuid)はい—
items[].namestringはい1~240文字
items[].sizestringはい10進数字で表した整数(文字列として送信)
items[].publishedAtstring (date-time)はい—
items[].annotationRevisionintegerはい0~2147483647
items[].blockersstringの配列はい4個以内の要素; 要素の重複なし; 各要素:次のいずれか:reference, asset_history, attachment_history, protected_label, promotion_stage
nextstring (uuid)はいnullも可

レスポンス: 200, 400, 401, 403, 404, 405, 409, 413, 415, 422, 503, 507

例

bash
curl -X POST "$ARKVORY_URL/api/v1/repositories/$REPOSITORY/retention/preview" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"criteria":{"publishedBefore":"2026-01-01T00:00:00.000Z","protectedLabels":[]}}'

選択した削除候補の保持ルールによる削除 ​

POST /api/v1/repositories/{repository}/retention/apply

アクセス: リポジトリ権限:artifact.delete · 再試行: 再試行しても安全:同じリクエストは同じ効果になる

previewRetentionから選んだ1〜100件のアーティファクト(idとexpectedAnnotationRevisionを持つitems)を同じcriteriaで再確認し、対象となるものを1つのトランザクションで論理削除します。各項目にはoutcomeが付き、deleted、already_deleted、changed(アノテーションが変更された)、not_eligible(基準時刻より後に公開された)、削除を妨げるものを伴うprotected、not_foundのいずれかです。バイト列は、リポジトリの物理クリーンアップが回収するまで予約されたままです。

パラメーター

名前場所型必須ルール
repositoryパスstringはい^[a-z0-9][a-z0-9_-]{0,63}$に一致

リクエスト本文 (application/json)

フィールド型必須ルール
criteriaobjectはい—
criteria.publishedBeforestring (date-time)はい^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d{3}Z$に一致
criteria.protectedLabelsstringの配列はい32個以内の要素; 要素の重複なし; 各要素:1~64文字
itemsobjectの配列はい1~100個の要素
items[].idstring (uuid)はい—
items[].expectedAnnotationRevisionintegerはい0~2147483647

レスポンス 200

フィールド型必須ルール
itemsobjectの配列はい1~100個の要素
items[].idstring (uuid)はい—
items[].outcomestringはい次のいずれか:deleted, already_deleted, protected, changed, not_eligible, not_found
items[].blockersstringの配列はい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 POST "$ARKVORY_URL/api/v1/repositories/$REPOSITORY/retention/apply" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"criteria":{"publishedBefore":"2026-01-01T00:00:00.000Z","protectedLabels":[]},"items":[{"id":"00000000-0000-4000-8000-000000000000","expectedAnnotationRevision":0}]}'

ストレージポリシーの取得 ​

GET HEAD /api/v1/repositories/{repository}/storage/policy

アクセス: リポジトリ権限:storage.read · 再試行: 再試行しても安全(読み取り)

リポジトリの自動クリーンアップとクォータの設定をrevisionとともに返します。あわせて、次回と前回のスケジュール実行、前回の実行で削除したビルド数、およびそのエラーも返します。既定ではポリシーは無効で、リポジトリのクォータもありません(サーバー全体の容量の制限は引き続き適用されます)。

パラメーター

名前場所型必須ルール
repositoryパスstringはい^[a-z0-9][a-z0-9_-]{0,63}$に一致

レスポンス 200

フィールド型必須ルール
revisionintegerはい0~2147483647
policyobjectはい—
policy.enabledbooleanはい—
policy.groupingstringはい次のいずれか:package-channel, package, repository
policy.keepLastintegerはい1~100000
policy.channelsobjectの配列はい32個以内の要素
policy.channels[].labelstringはい1~64文字
policy.channels[].keepLastintegerはい1~100000
policy.protectedLabelsstringの配列はい32個以内の要素; 要素の重複なし; 各要素:1~64文字
policy.minAgeHoursintegerはい0~87600
policy.intervalMinutesintegerはい1~10080
policy.quotaBytesstringはい10進数字で表した整数(文字列として送信); nullも可
policy.warningPercentintegerはい1~98
policy.criticalPercentintegerはい2~99
nextRunAtstring (date-time)はいnullも可
lastRunAtstring (date-time)はいnullも可
lastDeletedintegerはい0~100
lastErrorstringはい64文字以内; nullも可

レスポンス: 200, 400, 401, 403, 404, 409, 422, 503, 507

例

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

ストレージポリシーの置換 ​

PUT /api/v1/repositories/{repository}/storage/policy

アクセス: リポジトリ権限:storage.manage · 再試行: 想定するリビジョンを指定した場合のみ再試行(compare-and-swap)

ポリシー全体を置き換えます。パッケージごと、チャンネルラベルごと(channels)、またはリポジトリごと(grouping)に登録済みのUPackビルドを直近のkeepLast件だけ保持し、protectedLabelsを持つビルドやminAgeHoursより新しいビルドは削除せず、intervalMinutesごとに実行します。また、quotaBytes(10進数の文字列、なしの場合はnull)とその警告しきい値でリポジトリを制限します。expectedRevisionは現在のリビジョンでなければならず、そうでない場合は409 revision_mismatchになります。有効にするにはartifact.deleteも必要で、スケジュールは呼び出したマネージドキーに結び付けられます。そのキーが失効するか、期限切れになるか、これらの権限を失うと、ポリシーが別のキーで保存されるまでスケジュールされた削除は停止します。通常のファイルはクォータには計上されますが、クォータによって削除されることはありません。

パラメーター

名前場所型必須ルール
repositoryパスstringはい^[a-z0-9][a-z0-9_-]{0,63}$に一致

リクエスト本文 (application/json)

フィールド型必須ルール
expectedRevisionintegerはい0~2147483647
policyobjectはい—
policy.enabledbooleanはい—
policy.groupingstringはい次のいずれか:package-channel, package, repository
policy.keepLastintegerはい1~100000
policy.channelsobjectの配列はい32個以内の要素
policy.channels[].labelstringはい1~64文字
policy.channels[].keepLastintegerはい1~100000
policy.protectedLabelsstringの配列はい32個以内の要素; 要素の重複なし; 各要素:1~64文字
policy.minAgeHoursintegerはい0~87600
policy.intervalMinutesintegerはい1~10080
policy.quotaBytesstringはい10進数字で表した整数(文字列として送信); nullも可
policy.warningPercentintegerはい1~98
policy.criticalPercentintegerはい2~99

レスポンス 200

フィールド型必須ルール
revisionintegerはい0~2147483647
policyobjectはい—
policy.enabledbooleanはい—
policy.groupingstringはい次のいずれか:package-channel, package, repository
policy.keepLastintegerはい1~100000
policy.channelsobjectの配列はい32個以内の要素
policy.channels[].labelstringはい1~64文字
policy.channels[].keepLastintegerはい1~100000
policy.protectedLabelsstringの配列はい32個以内の要素; 要素の重複なし; 各要素:1~64文字
policy.minAgeHoursintegerはい0~87600
policy.intervalMinutesintegerはい1~10080
policy.quotaBytesstringはい10進数字で表した整数(文字列として送信); nullも可
policy.warningPercentintegerはい1~98
policy.criticalPercentintegerはい2~99
nextRunAtstring (date-time)はいnullも可
lastRunAtstring (date-time)はいnullも可
lastDeletedintegerはい0~100
lastErrorstringはい64文字以内; nullも可

レスポンス: 200, 400, 401, 403, 404, 405, 409, 413, 415, 422, 503, 507

例

bash
curl -X PUT "$ARKVORY_URL/api/v1/repositories/$REPOSITORY/storage/policy" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"expectedRevision":0,"policy":{"enabled":false,"grouping":"package-channel","keepLast":1,"channels":[],"protectedLabels":[],"minAgeHours":0,"intervalMinutes":1,"quotaBytes":"1024","warningPercent":1,"criticalPercent":2}}'

リポジトリのストレージ使用量の取得 ​

GET HEAD /api/v1/repositories/{repository}/storage/usage

アクセス: リポジトリ権限:storage.read · 再試行: 再試行しても安全(読み取り)

リポジトリが予約しているバイト数を10進数の文字列で返します。内訳は、公開済み、保留中のアップロード、廃棄済み(削除またはキャンセルされ、まだ回収されていないもの)で、その合計がreservedBytesです。あわせてクォータとstate(unlimited、normal、warning、critical、exceeded)も返します。これはクォータに対して計上される論理的な予約量であり、ディスク上の使用量ではありません。

パラメーター

名前場所型必須ルール
repositoryパスstringはい^[a-z0-9][a-z0-9_-]{0,63}$に一致

レスポンス 200

フィールド型必須ルール
publishedBytesstringはい10進数字で表した整数(文字列として送信)
pendingBytesstringはい10進数字で表した整数(文字列として送信)
retiredBytesstringはい10進数字で表した整数(文字列として送信)
reservedBytesstringはい10進数字で表した整数(文字列として送信)
quotaBytesstringはい10進数字で表した整数(文字列として送信); nullも可
statestringはい次のいずれか:unlimited, normal, warning, critical, exceeded

レスポンス: 200, 400, 401, 403, 404, 409, 422, 503, 507

例

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

ストレージポリシーによる削除対象のプレビュー ​

GET HEAD /api/v1/repositories/{repository}/storage/preview

アクセス: リポジトリ権限:artifact.delete · 再試行: 再試行しても安全(読み取り)

保存済みのポリシーが現時点で削除するはずの登録済みビルドを最大100件、ポリシーのrevisionとhasMoreとともに返します(ポリシーが無効でも返します)。参照、ファイルパス、添付ファイル、保護ラベル、経過期間によって保持されるビルドは含まれません。何も予約されません。実行時にはビルドが改めてランク付けされます。

パラメーター

名前場所型必須ルール
repositoryパスstringはい^[a-z0-9][a-z0-9_-]{0,63}$に一致

レスポンス 200

フィールド型必須ルール
revisionintegerはい0~2147483647
itemsobjectの配列はい100個以内の要素
items[].idstring (uuid)はい—
items[].namestringはい240文字以内
items[].sizestringはい10進数字で表した整数(文字列として送信)
items[].publishedAtstring (date-time)はい—
items[].annotationRevisionintegerはい0~2147483647
items[].blockersstringの配列はい0個以内の要素
hasMorebooleanはい—

レスポンス: 200, 400, 401, 403, 404, 409, 422, 503, 507

例

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

ストレージポリシーの即時実行 ​

POST /api/v1/repositories/{repository}/storage/run

アクセス: リポジトリ権限:storage.manage, artifact.delete · 再試行: 自動的に再試行しない

有効なポリシーを、スケジュールを待たずに1バッチ分すぐに実行します。ビルドを改めてランク付けし、権限と依存関係を確認して、最大100件を論理削除し、それぞれの結果を返します。expectedRevisionは現在のポリシーのリビジョンでなければならず、ポリシーが有効である必要があります。そうでない場合は409です。バイト列は、独自のポリシー(setCleanup)を持つリポジトリの物理クリーンアップによって、後で回収されます。

パラメーター

名前場所型必須ルール
repositoryパスstringはい^[a-z0-9][a-z0-9_-]{0,63}$に一致

リクエスト本文 (application/json)

フィールド型必須ルール
expectedRevisionintegerはい0~2147483647

レスポンス 200

フィールド型必須ルール
itemsobjectの配列はい100個以内の要素
items[].idstring (uuid)はい—
items[].outcomestringはい次のいずれか:deleted, already_deleted, protected, changed, not_eligible, not_found
items[].blockersstringの配列はい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 POST "$ARKVORY_URL/api/v1/repositories/$REPOSITORY/storage/run" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"expectedRevision":0}'

リポジトリのストレージイベントの一覧表示 ​

GET HEAD /api/v1/repositories/{repository}/storage/events

アクセス: リポジトリ権限:diagnostics.read · 再試行: 再試行しても安全(読み取り)

ストレージポリシー、クォータ、保持、クリーンアップの診断イベントを、シーケンスafter(既定は0)より後から古いものの順に最大100件返します。各イベントにはレベル、コード、いくつかの詳細が含まれます。level(info、warning、error)で絞り込め、続きはafterにnextを設定して取得します。保持されるのはリポジトリごとに最新の1000件、全体で20,000件のみです。より長く保持したい場合はエクスポートしてください。

パラメーター

名前場所型必須ルール
repositoryパスstringはい^[a-z0-9][a-z0-9_-]{0,63}$に一致
afterクエリstringいいえ10進数字で表した整数(文字列として送信)
levelクエリstringいいえ次のいずれか:info, warning, error

レスポンス 200

フィールド型必須ルール
itemsobjectの配列はい100個以内の要素
items[].sequencestringはい10進数字で表した整数(文字列として送信)
items[].occurredAtstring (date-time)はい—
items[].levelstringはい次のいずれか:info, warning, error
items[].codestringはい96文字以内
items[].detailsstring | integerのマップはい16個以内のエントリ
nextstringはい10進数字で表した整数(文字列として送信); nullも可

レスポンス: 200, 400, 401, 403, 404, 409, 422, 503, 507

例

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

物理クリーンアップ設定の取得 ​

GET HEAD /api/v1/repositories/{repository}/storage/cleanup

アクセス: リポジトリ権限:storage.read · 再試行: 再試行しても安全(読み取り)

リポジトリの物理クリーンアップポリシーをrevision(enabled、graceHours、batchSize、intervalSeconds、delayMilliseconds)とともに返します。あわせて前回と次回の実行、直近のバッチで回収、延期、失敗したオブジェクト数、解放したバイト数も返します。物理クリーンアップは、キャンセルされたアップロードと削除されたアーティファクトを物理的に削除する処理で、既定ではオフです。

パラメーター

名前場所型必須ルール
repositoryパスstringはい^[a-z0-9][a-z0-9_-]{0,63}$に一致

レスポンス 200

フィールド型必須ルール
revisionintegerはい0~2147483647
policyobjectはい—
policy.enabledbooleanはい—
policy.graceHoursintegerはい0~8760
policy.batchSizeintegerはい1~100
policy.intervalSecondsintegerはい5~86400
policy.delayMillisecondsintegerはい0~1000
lastRunAtstring (date-time)はいnullも可
nextRunAtstring (date-time)はいnullも可
lastCollectedintegerはい0~100
lastDeferredintegerはい0~100
lastFailedintegerはい0~100
lastReclaimedBytesstringはい10進数字で表した整数(文字列として送信)
lastErrorstringはいnullも可

レスポンス: 200, 400, 401, 403, 404, 409, 422, 503, 507

例

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

物理クリーンアップの設定 ​

PUT /api/v1/repositories/{repository}/storage/cleanup

アクセス: リポジトリ権限:storage.manage · 再試行: 想定するリビジョンを指定した場合のみ再試行(compare-and-swap)

サーバーの稼働中にクリーンアップポリシーを置き換えます。enabled(一時停止にも使用)、graceHours(0〜8760。削除されたコンテンツが物理的に削除されるまでの猶予期間)、batchSize(1〜100オブジェクト)、intervalSeconds(5〜86400)、delayMilliseconds(オブジェクト間で0〜1000)を指定します。expectedRevisionは現在のリビジョン(最初の変更前は0)でなければならず、そうでない場合は409 revision_mismatchになります。変更はオブジェクトの処理の合間に反映され、1つのオブジェクトの処理の途中で反映されることはありません。

パラメーター

名前場所型必須ルール
repositoryパスstringはい^[a-z0-9][a-z0-9_-]{0,63}$に一致

リクエスト本文 (application/json)

フィールド型必須ルール
expectedRevisionintegerはい0~2147483647
policyobjectはい—
policy.enabledbooleanはい—
policy.graceHoursintegerはい0~8760
policy.batchSizeintegerはい1~100
policy.intervalSecondsintegerはい5~86400
policy.delayMillisecondsintegerはい0~1000

レスポンス 200

フィールド型必須ルール
revisionintegerはい0~2147483647
policyobjectはい—
policy.enabledbooleanはい—
policy.graceHoursintegerはい0~8760
policy.batchSizeintegerはい1~100
policy.intervalSecondsintegerはい5~86400
policy.delayMillisecondsintegerはい0~1000
lastRunAtstring (date-time)はいnullも可
nextRunAtstring (date-time)はいnullも可
lastCollectedintegerはい0~100
lastDeferredintegerはい0~100
lastFailedintegerはい0~100
lastReclaimedBytesstringはい10進数字で表した整数(文字列として送信)
lastErrorstringはいnullも可

レスポンス: 200, 400, 401, 403, 404, 405, 409, 413, 415, 422, 503, 507

例

bash
curl -X PUT "$ARKVORY_URL/api/v1/repositories/$REPOSITORY/storage/cleanup" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"expectedRevision":0,"policy":{"enabled":false,"graceHours":0,"batchSize":1,"intervalSeconds":5,"delayMilliseconds":0}}'

クリーンアップバッチの即時実行の要求 ​

POST /api/v1/repositories/{repository}/storage/cleanup/run

アクセス: リポジトリ権限:storage.manage · 再試行: 自動的に再試行しない

有効なクリーンアップポリシーの次のバッチを、ただちに開始するようスケジュールします。応答はクリーンアップの状態で、バイトが解放されるのはバッチが実行された後だけです(getCleanupのlastRunAtを参照)。expectedRevisionは現在のリビジョンでなければならず、クリーンアップが無効な場合は409 state_conflictになります。読み取り中または書き込み中のオブジェクトは、後のバッチに持ち越されます。

パラメーター

名前場所型必須ルール
repositoryパスstringはい^[a-z0-9][a-z0-9_-]{0,63}$に一致

リクエスト本文 (application/json)

フィールド型必須ルール
expectedRevisionintegerはい0~2147483647

レスポンス 200

フィールド型必須ルール
revisionintegerはい0~2147483647
policyobjectはい—
policy.enabledbooleanはい—
policy.graceHoursintegerはい0~8760
policy.batchSizeintegerはい1~100
policy.intervalSecondsintegerはい5~86400
policy.delayMillisecondsintegerはい0~1000
lastRunAtstring (date-time)はいnullも可
nextRunAtstring (date-time)はいnullも可
lastCollectedintegerはい0~100
lastDeferredintegerはい0~100
lastFailedintegerはい0~100
lastReclaimedBytesstringはい10進数字で表した整数(文字列として送信)
lastErrorstringはいnullも可

レスポンス: 200, 400, 401, 403, 404, 405, 409, 413, 415, 422, 503, 507

例

bash
curl -X POST "$ARKVORY_URL/api/v1/repositories/$REPOSITORY/storage/cleanup/run" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"expectedRevision":0}'

Arkvory · ProAnimaStudio