Skip to content
This repository was archived by the owner on Jun 18, 2026. It is now read-only.
This repository was archived by the owner on Jun 18, 2026. It is now read-only.

Некорректная информация о сканировании #3

Description

@GarrykZ

Привет,
В примере python-examples/projects.py есть не совсем корректная функция:

def get_scanning_projects() -> list[str]:
    res = auth.requests_session.get(BASE_URL + "api/scanAgents")
    json = res.json()

    currently_scanning_agents = list(filter(lambda agent: agent["statusType"] == "Scan", json))
    ids = list(map(lambda agent: agent["projectId"], currently_scanning_agents))

    return ids

Проблема в том, что здесь забирается статус агента, а не статус сканирования, что некорректно.
Кейс при котором проблема проявляется: в случае нажатия кнопки "Остановить по окончании сканирования", статус агента = "Stopping", но внутри проект в статусе = "Scan".

[
{
"id": "15437ad4-9de6-4134-ad04-55f69c91ee4f",
"statusType": "Stopping",
"name": "agent.local.domain",
"registeredDateTime": "2024-01-30T06:32:20.424643Z",
"lastActiveDateTime": "2024-05-20T09:40:18.960087Z",
"scanResultId": "a6706c53-6d69-4d70-966d-d05fae031248",
"projectId": "10757885-a7e4-4c9b-b619-de78977bf782",
"projectName": "test_project",
"progress": {
"stage": "Scan",
"subStage": null,
"value": 83
},
"operatingSystem": "Windows",
"version": "4.6.0.30145"
}
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions