Get repository
client.managedDefense.vulnerabilityDiscovery.repositories.get(stringrepoID, RepositoryGetParams { account_id, scan_cursor, scan_limit } params, RequestOptionsoptions?): RepositoryGetResponse { repository, scans }
GET/accounts/{account_id}/managed-defense/vulnerability-discovery/repos/{repo_id}
Gets repository metadata, source readiness, and customer scan history.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Get repository
import Cloudflare from 'cloudflare';
const client = new Cloudflare({
apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});
const repository = await client.managedDefense.vulnerabilityDiscovery.repositories.get(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
);
console.log(repository.repository);{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": {
"repository": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"created_at": "2019-12-27T18:11:19.117Z",
"name": "x",
"readiness": "awaiting_source",
"source": "upload",
"import_error": {
"code": "worker_import_failed",
"message": "Worker import failed."
}
},
"scans": [
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"completed_at": "2019-12-27T18:11:19.117Z",
"message": "message",
"phase": "provisioning",
"repositories": [
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"name": "name",
"phase": "provisioning",
"report_status": "not_ready",
"status": "requested"
}
],
"started_at": "2019-12-27T18:11:19.117Z",
"status": "requested",
"submitted_at": "2019-12-27T18:11:19.117Z",
"telemetry_window": {
"end": "2019-12-27T18:11:19.117Z",
"start": "2019-12-27T18:11:19.117Z"
}
}
]
},
"result_info": {
"count": 0,
"cursor": "cursor",
"per_page": 1
},
"success": true
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": {
"repository": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"created_at": "2019-12-27T18:11:19.117Z",
"name": "x",
"readiness": "awaiting_source",
"source": "upload",
"import_error": {
"code": "worker_import_failed",
"message": "Worker import failed."
}
},
"scans": [
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"completed_at": "2019-12-27T18:11:19.117Z",
"message": "message",
"phase": "provisioning",
"repositories": [
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"name": "name",
"phase": "provisioning",
"report_status": "not_ready",
"status": "requested"
}
],
"started_at": "2019-12-27T18:11:19.117Z",
"status": "requested",
"submitted_at": "2019-12-27T18:11:19.117Z",
"telemetry_window": {
"end": "2019-12-27T18:11:19.117Z",
"start": "2019-12-27T18:11:19.117Z"
}
}
]
},
"result_info": {
"count": 0,
"cursor": "cursor",
"per_page": 1
},
"success": true
}