イベント
カーソル以降のインストールのイベントフィードと、イベントタイプの一覧。
このグループの操作と、それぞれのアクセスルール、再試行ルール、パラメーター、レスポンスです。すべてのリクエストにはキーを付けます:Authorization: Bearer <key>(「認証」を参照)。
操作
インストールのイベントを読む
GET HEAD /api/v1/events
アクセス: 有効なキーまたはセッション · 再試行: 再試行しても安全(読み取り)
カーソル after より後のイベントを、古いものから最大 limit 件(1–500、既定は 100)、CloudEvents 1.0 として返します。対象は、呼び出し元が一覧できる(artifact.list)すべてのリポジトリの公開、削除、ファイルのリビジョン、パッケージの登録、アノテーション、添付ファイル、ステージ、プロモーション、イメージ・npm・Git LFS の変更です。after がなければ、保持されている最も古いイベントから始まります。続けるには next を after として渡します。呼び出し元に見えないイベントも越えて進みます(1 リクエストあたり最大 5000 件)。types は指定したタイプまたは artifact.* のようなプレフィックスに、repository は 1 つのリポジトリに絞ります。oldest より古いカーソルには 410 events_cursor_expired、別の epoch(サーバーがバックアップから復元された)のカーソルには 409 events_epoch_changed が返り、どちらも events に現在の epoch、oldest、head を含みます。id で重複を除いてください。イベントはヒントであり、現在の状態は通常のルートで読み込みます。
パラメーター
| 名前 | 場所 | 型 | 必須 | ルール |
|---|---|---|---|---|
after | クエリ | string | いいえ | ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}:(0|[1-9][0-9]{0,18})$に一致; Event id or next of a page; without it the feed starts at oldest |
limit | クエリ | integer | いいえ | 1~500 |
types | クエリ | string | いいえ | 2048文字以内; Comma-separated names or prefixes such as artifact.* |
repository | クエリ | string | いいえ | ^[a-z0-9][a-z0-9_-]{0,63}$に一致 |
レスポンス 200
| フィールド | 型 | 必須 | ルール |
|---|---|---|---|
epoch | string (uuid) | はい | — |
items | objectの配列 | はい | 500個以内の要素 |
items[].specversion | string | はい | 次のいずれか:1.0 |
items[].id | string | はい | ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}:(0|[1-9][0-9]{0,18})$に一致; イベント ID、<epoch>:<position>。これで重複を除きます |
items[].source | string | はい | — |
items[].type | string | はい | — |
items[].subject | string | はい | アーティファクト ID、ファイルのイベントではパス |
items[].time | string (date-time) | はい | — |
items[].datacontenttype | string | はい | 次のいずれか:application/json |
items[].dataschema | string | はい | — |
items[].partitionkey | string | はい | repository:<repository>。同じパーティションのイベントはコミット順を保ちます |
items[].arkvoryposition | string | はい | 10進数字で表した整数(文字列として送信) |
items[].arkvoryepoch | string (uuid) | はい | — |
items[].data | object | はい | タイプのデータ。その JSON Schema はタイプ一覧にあります |
next | string | はい | ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}:(0|[1-9][0-9]{0,18})$に一致 |
head | string | はい | 10進数字で表した整数(文字列として送信) |
oldest | string | はい | 10進数字で表した整数(文字列として送信) |
レスポンス: 200, 400, 401, 403, 404, 409, 410, 422, 503, 507
例
curl -X GET "$ARKVORY_URL/api/v1/events" \
-H "Authorization: Bearer $ARKVORY_TOKEN"イベントタイプを一覧する
GET HEAD /api/v1/events/types
アクセス: 有効なキーまたはセッション · 再試行: 再試行しても安全(読み取り)
このサーバーが書き込むすべてのイベントタイプを返します。名前、schemaVersion、スコープ、読み手に必要な権限、順序を保つパーティション、data の JSON Schema です。CloudEvents の type は arkvory.<name>.v<schemaVersion> です。
レスポンス 200
| フィールド | 型 | 必須 | ルール |
|---|---|---|---|
items | objectの配列 | はい | — |
items[].name | string | はい | — |
items[].schemaVersion | integer | はい | 1以上 |
items[].scope | string | はい | 次のいずれか:repository, system |
items[].permission | string | はい | 次のいずれか:artifact.list, administrator |
items[].partition | string | はい | — |
items[].description | string | はい | — |
items[].dataSchema | object | いいえ | — |
レスポンス: 200, 400, 401, 403, 404, 409, 422, 503, 507
例
curl -X GET "$ARKVORY_URL/api/v1/events/types" \
-H "Authorization: Bearer $ARKVORY_TOKEN"