Rule on the kept repos a store holds
const url = 'https://example.com/v1/system/kept-repos/rulings';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"ids":[{"tenantId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","projectId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/system/kept-repos/rulings \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "ids": [ { "tenantId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "projectId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ] }'For a store keeping repos for the runtime’s projects without a GitHub repo: one ruling for each id it names, in order. keep, with the mark the store sets on the repo, or purge, for reason. An unfinished erasure rules purge first, then a purge already recorded (with recorded: true), then a purged tenant; a project deleted, or a repo moved to GitHub, 90 days ago or more (its kept window) is retention, and a repo the runtime has no project for is no-record, unless something holds it (keep, marked held). Ids may span tenants. An id not in form, or more than 500, refuses the whole request. Takes system:kept-repos, on a runtime serving many tenants.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Examplegenerated
{ "ids": [ { "tenantId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "projectId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ]}Responses
Section titled “Responses”One ruling for each id.
object
Example
{ "rulings": [ { "ruling": "keep", "mark": "none", "reason": "erasure", "recorded": true } ]}The body names no ids in form, or more than 500 (bad-input). Nothing was ruled.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}A tenant’s key or session (system-principal-required), or a system key without system:kept-repos (system-scope-missing). On a runtime serving one tenant, any system key (system-key-scope-not-served, or system-scope-missing for one holding only the scopes it serves).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Idempotency-Key was reused with a different body, or resource-state conflict. Or idempotency-key-in-flight (with Retry-After): a request with the same Idempotency-Key still runs, so this one wasn’t run; send it again after Retry-After to get that request’s answer.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”The request body is over the API’s limit (request-too-large; details.maxBytes says how much).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Server error (unmapped domain code or framework crash).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The operator’s access record can’t be written, so nothing was done (access-record-unavailable), or the Idempotency-Key store couldn’t be read before the request ran (idempotency-store-unavailable, with Retry-After). Or the authorization store couldn’t be reached (authz-backend-unavailable, with Retry-After), or the database was too busy for the authorization check (database-busy, with Retry-After), so the request wasn’t run.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”See also
GET /v1/system/kept-repos/erasures: List the unfinished erasures of kept repos- Serve many tenants
- Error code
access-record-unavailable - Error code
authz-backend-unavailable - Error code
bad-input - Error code
database-busy - Error code
idempotency-key-in-flight - Error code
idempotency-store-unavailable - Error code
request-too-large - Error code
system-key-scope-not-served - Error code
system-principal-required - Error code
system-scope-missing - Every error code