Saltar al contenido principal

Reclamar el siguiente trabajo asignado

POST /api/v1/jobs/claim

Las preferencias opcionales sshInventory seleccionan host-keys-v1 (cinco conexiones) o host-keys-v2 (diez conexiones, escáner 0.26.90) con una fuente y un mapa acotado de huellas. Requieren claimId e instanceId estables y no pueden cambiar en la recuperación. El inventario remoto también requiere aprobación explícita de grupo y ejecución; las preferencias locales por sí solas no pueden ampliar una ejecución baseline. Las reclamaciones de grupos remotos requieren poolId, claimId e instanceId actual y prohíben jobId. Requieren anuncio local explícito actual del grupo y aprobación del servidor; las reclamaciones ordinarias nunca reclaman trabajo remoto. Las concesiones remotas tienen una caducidad corta fija y no se amplían al renovar. Utiliza claimId estable e instanceId del proceso al reintentar tras una respuesta perdida. jobId opcional selecciona solo ese trabajo asignado; nunca recurre a otro trabajo. Un recibo de reclamación no puede reutilizarse con otra selección de trabajo. instanceId opcional debe coincidir con el heartbeat más reciente; vincula las evidencias satisfactorias de escaneo a ese proceso. Un trabajo activo por agente. Las reclamaciones satisfactorias pueden repetirse hasta 24 horas sin reactivar concesiones terminadas.

Roles permitidos: agent.

Autenticación​

Las siguientes alternativas de OpenAPI describen la autenticación aceptada. Las modificaciones desde el navegador también requieren la cabecera Origin canónica.

[
{
"organizationCredential": []
},
{
"browserSession": []
}
]

Parámetros​

[]

Cuerpo de la solicitud​

{
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"claimId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"instanceId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"jobId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"poolId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"sshInventory": {
"type": "object",
"properties": {
"profile": {
"type": "string",
"enum": [
"host-keys-v1",
"host-keys-v2"
]
},
"source": {
"type": "string",
"minLength": 1,
"maxLength": 100,
"not": {
"const": "hosted-ssh"
}
},
"pins": {
"default": {},
"type": "object",
"propertyNames": {
"type": "string",
"minLength": 1,
"maxLength": 300,
"pattern": "^(?:\\[[0-9a-fA-F:]+\\]|[a-zA-Z0-9][a-zA-Z0-9.-]*)(?::[0-9]{1,5})?$"
},
"additionalProperties": {
"type": "string",
"pattern": "^SHA256:[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]$"
},
"maxProperties": 256
}
},
"required": [
"profile",
"source"
],
"additionalProperties": false
}
},
"additionalProperties": false,
"allOf": [
{
"if": {
"required": [
"poolId"
]
},
"then": {
"required": [
"claimId",
"instanceId"
],
"not": {
"required": [
"jobId"
]
}
}
},
{
"if": {
"required": [
"sshInventory"
]
},
"then": {
"required": [
"claimId",
"instanceId"
]
}
}
]
}
}
}
}

Respuestas​

{
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"job": {
"anyOf": [
{
"$ref": "#/components/schemas/LeasedJob"
},
{
"type": "null"
}
]
}
},
"required": [
"job"
]
}
}
}
},
"400": {
"description": "Validation error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Missing/expired/revoked credential",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Insufficient role",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "State or idempotency conflict",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "Body too large",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "Unsupported media type",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "Request budget exhausted; respect Retry-After",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"headers": {
"Retry-After": {
"schema": {
"type": "integer",
"minimum": 1
},
"description": "Seconds until sufficient budget is expected; concurrent traffic may consume replenished capacity."
}
}
},
"500": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"503": {
"description": "Not configured",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}

Las referencias como #/components/schemas/Asset se resuelven en los esquemas compartidos. Descarga el contrato OpenAPI para generar clientes. Esta página se genera automáticamente; describe la API de desarrollo implementada, no endpoints previstos.